I need to be able to programmatically transcode mpeg-2 files to .mp4, .mp3, .wmv, .rm (optional), and .flv (optional), and hopefully generate a thumbnail as well. I found the Java Media Framework, but it frankly looks pretty crappy. This will be running a Linux server, so I could shell out to ffmpeg using Commons Exec – does ffmpeg do everything I need to do? FFmpeg seems pretty daunting, which is why I’m having trouble finding this information, but it definitely seems to be a jack-of-all-trades. Any suggestions?
I need to be able to programmatically transcode mpeg-2 files to .mp4, .mp3, .wmv,
Share
Ffmpeg is the best and easiest. To output/convert video:
And your screenshot:
15 fps is standard for flv and audio sample rate should be 44100 for flv. Options to use:
-rspecifies a frame rate of 1 fps (one frame used as the screenshot),-ssseeks to the position you wanthh:mm:ss:fff,-tis the duration (one second to match your one fps),-antells ffmpeg to ignore audio, and-sis the size of the screenshot. The%dis necessary as it will be the digit incremented on how many screenshots you use. With the above,%dwill always be the number 1 (one frame, one screenshot). Good luck.