36
10
When I try to open a movie I just created with the command:
ffmpeg -pattern_type glob -i '*.JPG' -s 640x480 movie.mp4
I get an error from QuickTime:
The document “movie.mp4” could not be opened.
The file may be damaged or may not be a movie file that is compatible with QuickTime Player.
I used the same command on a set of images generated from an iSight time lapse, but in this case the above images are from a digital camera. The resolution is a lot higher, but I am scaling it to 640x480 and I don't see anything in the output that suggests a problem:
Input #0, image2, from '*.JPG':
Duration: 00:00:04.76, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj422p(pc), 4928x3264, 25 tbr, 25 tbn, 25 tbc
vs. the working movie:
Input #0, image2, from '*.JPG':
Duration: 00:01:23.72, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p(pc), 640x480 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 25 tbn, 25 tbc
And for the output:
Output #0, mp4, to 'movie.mp4':
Metadata:
encoder : Lavf55.19.104
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj422p, 640x480, q=-1--1, 12800 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> libx264)
vs. for the working one:
Output #0, mp4, to 'movie.mp4':
Metadata:
encoder : Lavf55.19.104
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 12800 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> libx264)
Aside from the working movie being longer and a lower source resolution, the only difference I can see is that there is an extra "[SAR 1:1 DAR 4:3]" mentioned in the video stream, but I have no idea what this is, or how to try to force it in the non-working movie.
Update: I just downloaded VLC and it plays the movie fine. So I know ffmpeg isn't at fault here.
2For the future, when asking about ffmpeg, please always include the full, uncut command line output. It should have told you something about the pixel format not being compatible with some players, if I'm not mistaken (and if you have a recent version). – slhck – 2014-10-03T18:06:29.640
ffprobe video.mp4
can be used to check which pixel format is used. – l --marc l – 2019-02-27T20:22:09.197