How to convert .flv to .m4v files through FFmpeg

2

I want to convert FLV files to M4V files. What is the exec (PHP) Linux code for this conversion?

user126629

Posted 2012-04-04T20:12:28.133

Reputation: 21

2

There is a great blog post about ffmpeg. Everything you need is in there (and more). http://blog.superuser.com/2012/02/24/ffmpeg-the-ultimate-video-and-audio-manipulation-tool/

– soandos – 2012-04-04T20:16:06.790

Answers

2

In the most simple case:

ffmpeg -i input.flv -an -c:v copy output.m4v

This will copy the raw video stream, discard audio, and change the container.

Just wrap this in your PHP exec line as you need it. For example:

<? exec("ffmpeg -y -i $infile -an -c:v copy $outfile"); ?>

Don't forget to update FFmpeg to the latest version depending on your operating system. And, as @soandos mentioned, check out my blog post on that subject: FFmpeg: The ultimate Video and Audio Manipulation Tool - Super User Blog

slhck

Posted 2012-04-04T20:12:28.133

Reputation: 182 472