{"id":15637600,"url":"https://github.com/crushedpixel/moshpit","last_synced_at":"2025-04-15T22:50:12.198Z","repository":{"id":43491101,"uuid":"136652359","full_name":"CrushedPixel/moshpit","owner":"CrushedPixel","description":"A powerful cross-platform command-line tool for datamoshing.","archived":false,"fork":false,"pushed_at":"2020-12-10T12:46:11.000Z","size":27,"stargazers_count":116,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T22:50:05.116Z","etag":null,"topics":["command-line-tool","datamoshing","ffmpeg","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrushedPixel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-08T18:18:43.000Z","updated_at":"2025-03-10T10:58:21.000Z","dependencies_parsed_at":"2022-08-12T10:41:39.921Z","dependency_job_id":null,"html_url":"https://github.com/CrushedPixel/moshpit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2Fmoshpit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2Fmoshpit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2Fmoshpit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrushedPixel%2Fmoshpit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrushedPixel","download_url":"https://codeload.github.com/CrushedPixel/moshpit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249167434,"owners_count":21223505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","datamoshing","ffmpeg","golang"],"created_at":"2024-10-03T11:12:16.895Z","updated_at":"2025-04-15T22:50:12.171Z","avatar_url":"https://github.com/CrushedPixel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# moshpit\n\nA command-line tool for surgical I-Frame removal, so-called datamoshing.  \nComes with built-in scene cut detection for optimal results.\n\n![tutorial](https://i.imgur.com/XGrR2Kv.gif)\n![original](https://i.imgur.com/nWUzNkC.gif)\n![moshed](https://i.imgur.com/qx776K6.gif)\n\n## Table of contents\n- [Installation](#installation)\n- [Usage](#usage)\n- [How it works](#how-it-works)\n- [Building from source](#building-from-source)\n\n## Installation\nAside from the *moshpit* binary, which can be downloaded from the [releases page](https://github.com/CrushedPixel/moshpit/releases),\nyou need a copy of [*FFmpeg*](https://www.ffmpeg.org/) installed on your machine.  \n\n## Usage\n### Arguments\n```\nmoshpit [options] \u003cfile\u003e\n```\n*moshpit* takes the video file you want to mosh as the last argument.\n\n| Option  | Description                                           | Default    |\n|---------|-------------------------------------------------------|------------|\n| -ffmpeg | Specifies the location of the FFmpeg binary.          | `ffmpeg`   |\n| -log    | Specifies the target location of the FFmpeg log file. | no logging |\n\n\n### Commands\nAfter starting moshpit, you can use the following commands to create a datamoshed video:\n\n#### scenes\n```scenes \u003cthreshold\u003e```\n\nDatamoshing via I-Frame removal yields the best results when applied at scene cuts.\nThe `scenes` command finds scene cuts in the input file, using the *threshold* parameter\nto determine the similarity of each frame with the preceding frame.\n\nA *threshold* of `0.2` usually gives good results.\n\n#### mosh\n```mosh \u003coutput\u003e \u003cframe\u003e [frame...]```\n\nMoshes the input file, writing it to the specified output file.  \nI-Frame removal is performed at the given frame indices, \nwith scene cuts previously detected using the `scenes` command being suggested.  \nUsing `all` as a frame parameter performs I-Frame removal at all previously detected scene cuts.\n\n#### exit\nExits moshpit.  \nMoshpit can also be terminated at any time using `Ctrl+C` (`SIGINT`).\n\n## How it works\n### The theory behind datamoshing\n[Source](http://datamoshing.com/2016/06/26/how-to-datamosh-videos/)\n\nModern 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.\n\nFrames which store an entire picture are called I-frames (Intra-coded), and can be displayed without any additional information.\n\nFrames 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.\n\nWhen 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](https://en.wikipedia.org/wiki/Video_compression_picture_types).\n\nIf 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.\n\n### What moshpit does\nWhen running the `mosh` command, *moshpit* converts the input file into an *AVI file*,\nplacing *I-Frames* only at the frames specified by the user.\nThis is done because single frames can be very easily identified and changed in the AVI format.\n\nEach 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.\n\nFinally, the moshed AVI file is \"baked\", which means it's converted back into an *MP4 file*,\npersisting the artifacts in the AVI file into a stable video file.\n\n## Building from source\n\n```shell\ngo get github.com/CrushedPixel/moshpit/cmd/moshpit\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrushedpixel%2Fmoshpit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrushedpixel%2Fmoshpit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrushedpixel%2Fmoshpit/lists"}