1

I need to convert quicktime (.mov) video file recorded by iphone, into mp4 format using ffmpeg in php.

I tried several commands but it did not work for me.

I tried following command that converted into .mp4 but just audio was there. No video was playing.

exec("ffmpeg -i input.mov out.mp4");

Any help in this case will be appreciated.

Thanks

  • 1
    What is the ffmpeg output when you execute the command. Also post some more info about the file. Preferably a MediaInfo or ffprobe output. – PTS Nov 17 '15 at 22:49
  • 2
    Have you tried just renaming the .mov extension to .mp4 ? – Adam Mann Pro Nov 18 '15 at 10:15
1

I'm new to ffmpeg, but if you want the codecs to remain the same and the data wrapped in mp4 instead of mov, I believe the following will work:

 ffmpeg -i video.mov -c copy video.mp4

The command you posted may have worked just fine, but your computer is having trouble playing the video data. This is almost always a codec issue.

You can compare the data in the mov input with the mp4 output using ffprobe. Compare the output of the commands ffprobe video.mov and ffprobe video.mp4. If the above command works as expected, then the data should read the same under the codecs. Only the container related data should be different.

| improve this answer | |
0

MP4 file format is based on QuickTime file format. Usually, renaming the file suffix to .mp4 just works.

The spec are here

| improve this answer | |
  • 1
    That is false information. While ideas were taken from QuickTime, they are different formats and simply renaming a file doesn't convert it into a mp4 file. As it also says in the second link you posted. – PTS Jan 25 '17 at 0:11
  • 2
    Container structure is the same and often renaming can work. FFmpeg has the same demuxer for mov,mp4,m4a,3gp,3g2,mj2. But QT allows lot more codecs than the official MP4 format, So a player coded as per the spec to vet streams will refuse to play a MP4 with e.g. PCM audio or just won't play the audio, just like ffmpeg won't create such a MP4. But nothing technical prevents PCM in MP4. Sony's cameras produce such MP4s. ----------- TL;DR difference between MP4 and MOV is administrative rather than technical. The viability of renaming MP4/MOV depends on the app the file is to be used in. – Gyan Jan 25 '17 at 7:05
  • Renaming would work for VLC (anything would work for VLC) but not for players like QuickTime. – Macindows Jan 27 '17 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.