Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert video to `m4v` with `ffmpeg`?

I'm trying to encode a video to m4v, so I can play it using jplayer on my website, but having troubles while specifieng correct parameter to ffmpeg. Here is the command I use:

ffmpeg -i 1.avi -vcodec mpeg4 -f m4v -qmax 8 1.m4v 2>&1

The video I get with this command won't play in jplayer and even in Totem Movie Player (on ubuntu). But if I try the demo video from jplayer website evrything works fine.

Can anyone give me a hint on what parameters I need to specify to ffmpeg to get a working m4v video, like the one with a bunny?

like image 703
Silver Light Avatar asked Dec 09 '11 11:12

Silver Light


2 Answers

Try:

tools/ffmpeg/./ffmpeg -i debug/assets/videos/sample_iPod.mp4 -vcodec libx264 debug/assets/videos/sample_iPod.m4v
like image 118
Michael Benin Avatar answered Oct 05 '22 22:10

Michael Benin


For those who find this question today still, because they're trying to play m4v, their software player won't let them and they need it converted to a "real" format and Google sent them to this question: m4v is not just "mp4 with DRM", but can also be a pure video stream without any playback metadata. This may be the case when you use certain digital cameras, you render video through Adobe's media encoder with certain h.264 presets, and other similar video-generating processes.

In those cases, it may very well be that all you need to do is get ffmpeg to add playback metadata on tope, which it will do by telling it to convert to mp4, turning your pure stream into a playable media resource.

$> ffmpeg -i input.m4v -vcodec copy -acodec copy output.mp4

Or you can use the short (but I find harder to remember) form:

$> ffmpeg -i input.m4v -c:v copy -c:a copy output.mp4

Done, you should now have a perfectly playable mp4 file.

like image 44
Mike 'Pomax' Kamermans Avatar answered Oct 05 '22 23:10

Mike 'Pomax' Kamermans