[FFmpeg-user] frame grabbing from MP4 file takes too long (says: muxing overhead -inf%)
Lou
lou at lrcd.com
Mon Nov 21 00:03:13 CET 2011
On Sun, 20 Nov 2011 13:33:51 -0800 (PST)
zeo <zeoxyvid at gmail.com> wrote:
> Hi everybody,
> I am trying to grab a frame from a MP4 video, which is recorded on my
> Samsung Galaxy S android phone. But it takes too long to grab a frame,
> ffmpeg produces the following output. If I use a smaller starting
> time like -ss 00:00.04, then it performs faster without saying
> "muxing overhead -inf%". Any help is appreciated, thank you very much.
> Zeo
>
>
> ----------------------------------------------------------------------------------------------------
> $ ./ffmpeg.exe -i input.mp4 -ss 00:01:34 -vframes 1 -y out.jpg
>
> Seems stream 1 codec frame rate differs from container frame rate:
> 30000.00 (30000/1) -> 30.00 (30/1)
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'utkunamik.mp4':
> Metadata:
> major_brand : 3gp4
> minor_version : 768
> compatible_brands: 3gp43gp6
> Duration: 00:01:21.57, start: 0.000000, bitrate: 11099 kb/s
> Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, mono,
> s16, 62 kb/s
> Metadata:
> handler_name : SoundHandler
> Stream #0:1(eng): Video: mpeg4 (Simple Profile) (mp4v /
> 0x7634706D), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 11032 kb/s, 29.70
> fps, 30 tbr, 30k tbn, 30k tbc
> Metadata:
> handler_name : VideoHandler
> Incompatible pixel format 'yuv420p' for codec 'mjpeg', auto-selecting
> format 'yuvj420p'
> [buffer @ 0x10464ae0] w:1280 h:720 pixfmt:yuv420p tb:1/1000000 sar:1/1
> sws_param:
> [buffersink @ 0x1046e3e0] auto-inserting filter 'auto-inserted scale
> 0' between the filter 'src' and the filter 'out'
> [scale @ 0x1046e140] w:1280 h:720 fmt:yuv420p -> w:1280 h:720
> fmt:yuvj420p flags:0x4
> Output #0, image2, to 'out.jpg':
> Metadata:
> major_brand : 3gp4
> minor_version : 768
> compatible_brands: 3gp43gp6
> encoder : Lavf53.21.0
> Stream #0:0(eng): Video: mjpeg, yuvj420p, 1280x720 [SAR 1:1 DAR
> 16:9], q=2-31, 200 kb/s, 90k tbn, 30 tbc
> Metadata:
> handler_name : VideoHandler
> Stream mapping:
> Stream #0:1 -> #0:0 (mpeg4 -> mjpeg)
> Press [q] to stop, [?] for help
> frame= 0 fps= 0 q=0.0 Lsize= -0kB time=00:00:00.00 bitrate=
> 0.0kbits/s
> video:0kB audio:0kB global headers:0kB muxing overhead -inf%
Try moving -ss as an input option:
ffmpeg -ss 00:01:34 -i input.mp4 -vframes 1 -y out.jpg
This can be faster than using ss as an output option, but has the
potential of not being frame accurate and may not provide satisfactory
results (depending on your input format). To generalize: with -ss as an
output option, the video will decode until 1:34 and then ffmpeg will
start encoding. As an input option ffmpeg will attempt to immediately
seek to 1:34 and then start decoding.
If you must use -ss as an output option then you can try to decrease
decoding time with -threads as an input option:
ffmpeg -threads 4 -i input.mp4 -ss 00:01:34 -vframes 1 -y out.jpg
However not all decoders can utilize -ss, if I recall correctly, so it
may not provide any speed increase depending on your input format.
More information about the ffmpeg-user
mailing list