Why you have more than one kind of screwdriver
cmw.osdude 120000QT77 Visits (695)
This morning I had a request from a colleague to help with a video that was refusing to upload to YouTube. The video would load and then die at 95% of processing. How frustrating!
My first thought was to convert the video to a different format. It was already in a WMV format, which is supported, but sometimes a conversion process will clean things up a bit. I figured I'd try my standard:
avconv -i in.wmv -q 1 out.wmv
This will do a basic conversion with options to keep the quality high. It usually "just works". However, this time there was a message "Multiple frames in a packet from stream 0". A corrupt file!
One option was to ask the originator to redo the file, but this was a live recording, so that was likely not an option and I didn't want to insite a panic. So, I poked around a little more and tried different tools. VLC wouldn't play the video on the file. (Not a good sign.) Melt (which I wrote about in a previous entry) just... well... melted. Finally I tinkered with mencoder.
Mencoder is pretty mature. In fact it's the first console video program that I every used. I had to refresh myself on the recipes for encoding and stumbled across this basic one.
mencoder -oac copy -ovc lavc -lavcopts vcodec=msmpeg4v2 in.wmv -o out.wmv
This worked like a champ. Sure enough, as the conversion occurred I had a stream of ugly messages about the video. Normally this would be pretty alarming because it would foretell audio sync nightmares, but since this was basically a talking slide show the audio sync was not as critical.
Once I got it uploaded I used YouTube's editor to trip a little bit off the front where the person recording was activating his slide show. I could have done that on my end, but then I would have had to upload the whole thing again. Might as well use the server tool.
The reason I'm sharing this is that I think it's really important to have more than one tool in your toolbox. I haven't used mencoder for quite some time because I'd begun to favor avconv. However, in this case, mencoder dealt with the video errors much more gracefully. It made the difference between a finished product and really bad news. The same way that you have more than one kind of screwdriver in your toolbox, collect different software tools, both commercial and open-source. When one fails on you, reach for another one. There is almost always an answer!
If you'd care to see this particular video it's here: