Video Fixer Upper
So recently I've started getting into using torrents to get stuff. I've been mostly using the program rtorrent since being on the command line it's easy to monitor from anywhere with a screen session or such. However, there has been one thing that bothers me about it compared to the way programs such as Limewire work. When downloading a video such as an AVI, Limewire will usually at least start out downloading the first 4k of file giving you the AVI headers needed to preview the file with a decent media player like MPlayer. While other video players such as Microsoft Media Player will not play an AVI file that doesn't have the index (which appears at the end of the file so it probably won't get downloaded until the last few megabyte of the file get downloaded) MPlayer will play AVI files without the index allowing them to be previewed while they download. Problem is, rtorrent (and maybe other torrent programs?) never seem to download the first 4k of the file anywhere near the start of the download, making it impossible to even preview it with MPlayer.
I wrote Video Fixer Upper to take these broken AVI files with no header and put whatever pieces it can together to allow the video to be previewed, hopefully saving people from downloading garbage they either already had with a different name or some low quality boring video. Currently it only works with AVI, but it could be modified to work with other programs.
How To Use
So after 8 megs or so of your video file has downloaded, you can simply run the following command on the command line:
./video_fixer_upper the_downloading_filename.avi out.avi
Video Fixer Upper will take input file and filter out all the complete video frames it can and create a new file called out.avi which should be viewable under MPlayer. Depending on how many iframe you've downloaded, the video should be at least partially viewable so you can see what it is and hopefully the quality of it. There will be mpeg errors and depending on how much was downloaded could look distorted, but it still should be enough.
I just finished this program pretty quickly yesterday so I didn't have a lot of time to polish it up. The download will require libkohn_avi to build and run. In the next few days I'll add a binary for Windows users and maybe a GUI for it if I get requests for it.
Copyright 1997-2018 - Michael Kohn