All Projects → CrushedPixel → moshpit

CrushedPixel / moshpit

Licence: MIT License
A powerful cross-platform command-line tool for datamoshing.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to moshpit

Autosubsync
Automatically synchronize subtitles with audio using machine learning
Stars: ✭ 179 (+141.89%)
Mutual labels:  ffmpeg, command-line-tool
vintage
[UNMAINTED] command-line tool to check for outdated Swift Package Manager dependencies
Stars: ✭ 33 (-55.41%)
Mutual labels:  command-line-tool
discord-ytdl-core
Simple ytdl wrapper for discord bots with custom ffmpeg args support.
Stars: ✭ 52 (-29.73%)
Mutual labels:  ffmpeg
malli-cli
Command-line interface from the comfort of a metosin/malli schema
Stars: ✭ 36 (-51.35%)
Mutual labels:  command-line-tool
CAM
macOS camera recording using ffmpeg
Stars: ✭ 43 (-41.89%)
Mutual labels:  ffmpeg
PyroGramBot
pluggable Telegram Bot based on Pyrogram
Stars: ✭ 168 (+127.03%)
Mutual labels:  ffmpeg
camstudio
CamStudio fork
Stars: ✭ 83 (+12.16%)
Mutual labels:  ffmpeg
xcode-cli
Command line helpers for Xcode
Stars: ✭ 17 (-77.03%)
Mutual labels:  command-line-tool
UniBorg
Pluggable Telegram bot and userbot based on Telethon
Stars: ✭ 196 (+164.86%)
Mutual labels:  ffmpeg
AudioManager
这是一个 Android 端万能音频播放器,只要给我一个路径我就能进行播放。
Stars: ✭ 26 (-64.86%)
Mutual labels:  ffmpeg
YKAVStudyPlatform
ffmpeg、ffplay、ffprobe 调试环境搭建,个人音视频全平台学习记录
Stars: ✭ 23 (-68.92%)
Mutual labels:  ffmpeg
diskusage
FANTASTIC SPEED utility to find out top largest folders/files on the disk.
Stars: ✭ 64 (-13.51%)
Mutual labels:  command-line-tool
canvas-capture
Record the canvas as an image, mp4 video, or gif from the browser
Stars: ✭ 35 (-52.7%)
Mutual labels:  ffmpeg
coinbash
💰 A bash script (CLI) for displaying crypto currencies market data in a terminal 🖥
Stars: ✭ 110 (+48.65%)
Mutual labels:  command-line-tool
dockerize
Utility to simplify running applications in docker containers
Stars: ✭ 91 (+22.97%)
Mutual labels:  command-line-tool
cassandra-nginx-cdn
Some config files and POC code to use Apache Cassandra as distributed storage for HLS chunks accross multiple datacenters and scripts for converting/transcoding UDP MPEG-TS to HLS and vice versa. The idea is take from Globo.com’s Live Video Platform for FIFA World Cup ’14.
Stars: ✭ 24 (-67.57%)
Mutual labels:  ffmpeg
php-bpm-detect
php class for bpm detection
Stars: ✭ 22 (-70.27%)
Mutual labels:  ffmpeg
json2xml
json to xml converter in python3
Stars: ✭ 76 (+2.7%)
Mutual labels:  command-line-tool
utility
Collection of command line utilities
Stars: ✭ 36 (-51.35%)
Mutual labels:  command-line-tool
ffEdit
Minimal visual editor for ffmpeg
Stars: ✭ 17 (-77.03%)
Mutual labels:  ffmpeg

moshpit

A command-line tool for surgical I-Frame removal, so-called datamoshing.
Comes with built-in scene cut detection for optimal results.

tutorial original moshed

Table of contents

Installation

Aside from the moshpit binary, which can be downloaded from the releases page, you need a copy of FFmpeg installed on your machine.

Usage

Arguments

moshpit [options] <file>

moshpit takes the video file you want to mosh as the last argument.

Option Description Default
-ffmpeg Specifies the location of the FFmpeg binary. ffmpeg
-log Specifies the target location of the FFmpeg log file. no logging

Commands

After starting moshpit, you can use the following commands to create a datamoshed video:

scenes

scenes <threshold>

Datamoshing via I-Frame removal yields the best results when applied at scene cuts. The scenes command finds scene cuts in the input file, using the threshold parameter to determine the similarity of each frame with the preceding frame.

A threshold of 0.2 usually gives good results.

mosh

mosh <output> <frame> [frame...]

Moshes the input file, writing it to the specified output file.
I-Frame removal is performed at the given frame indices, with scene cuts previously detected using the scenes command being suggested.
Using all as a frame parameter performs I-Frame removal at all previously detected scene cuts.

exit

Exits moshpit.
Moshpit can also be terminated at any time using Ctrl+C (SIGINT).

How it works

The theory behind datamoshing

Source

Modern compressed video files have very complex methods of reducing the amount of storage or bandwidth needed to display the video. To do this most formats, such as the AVI format, don't store the entire image for each frame.

Frames which store an entire picture are called I-frames (Intra-coded), and can be displayed without any additional information.

Frames which don’t contain the entire picture require information from other frames in order to be displayed, either previous or subsequent frames, these frames are called P-frames (Predicted) and B-frames (Bi-predictive). Instead of storing full pictures, these P-frames and B-frames contain data describing only the differences in the picture from the preceding frame, and/or from the next frame, this data is much smaller compared to storing the entire picture — especially in videos where there isn’t much movement.

When a video is encoded, or compressed, a combination of these types of frames are used. In most cases this means many P-frames with I-frames interspersed at regular intervals and where drastic visual changes in the video occur. More information on frame types can be found here.

If an I-frame is corrupted, removed or replaced, the data contained in the following P-frames is applied to the wrong picture. In the above video I-frames have been removed and so instead of scenes changing properly you see the motion from a new scene applied to a picture from a previous frame. This process of corrupting, removing or replacing I-frames is the video datamoshing technique that moshpit uses.

What moshpit does

When running the mosh command, moshpit converts the input file into an AVI file, placing I-Frames only at the frames specified by the user. This is done because single frames can be very easily identified and changed in the AVI format.

Each of the I-Frames in the resulting AVI file is then replaced with the next P-Frame, which means that the moshed video has the same duration as the original video, as opposed to removing the I-Frames, which would cause the moshed video to be shorter.

Finally, the moshed AVI file is "baked", which means it's converted back into an MP4 file, persisting the artifacts in the AVI file into a stable video file.

Building from source

go get github.com/CrushedPixel/moshpit/cmd/moshpit
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].