[FFmpeg-user] How to speed up thumbnail generation for video files using FFMPEG on MIPS
Pavan Kulkarni
pavanvkbgm at gmail.com
Mon Jul 9 08:27:44 CEST 2012
Here is the output without the select filter:
*time ./ffmpeg -ss 18 -i Pirates_remux_short.ts -an -s 150x100 thumb2.jpg
(Unfortunately this gives a blank thumbnail)*
malloc: using debugging hooks
ffmpeg version 0.8.5, Copyright (c) 2000-2011 the FFmpeg developers
built on Jan 3 2012 14:43:18 with gcc 4.3.2
configuration: --enable-cross-compile --target-os=linux
--cross-prefix=mipsisa32r2el-timesys-linux-gnu- --arch=mips
--extra-cflags=-O2
libavutil 51. 9. 1 / 51. 9. 1
libavcodec 53. 7. 0 / 53. 7. 0
libavformat 53. 4. 0 / 53. 4. 0
libavdevice 53. 1. 1 / 53. 1. 1
libavfilter 2. 23. 0 / 2. 23. 0
libswscale 2. 0. 0 / 2. 0. 0
[h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
Last message repeated 1 times
Input #0, mpegts, from 'Pirates_remux_short.ts':
Duration: 00:00:59.22, start: 720.665000, bitrate: 33719 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1
DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Stream #0.1[0x1100](eng): Audio: pcm_bluray, 48000 Hz, 5.1, s32, 6912
kb/s
Incompatible pixel format 'yuv420p' for codec 'mjpeg', auto-selecting
format 'yuvj420p'
[buffer @ 0x10047c0] w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 sar:1/1
sws_param:
[scale @ 0x1004390] w:1920 h:1080 fmt:yuv420p -> w:150 h:100 fmt:yuvj420p
flags:0x4
[h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
Output #0, image2, to 'thumb2.jpg':
Metadata:
encoder : Lavf53.4.0
Stream #0.0: Video: mjpeg, yuvj420p, 150x100 [PAR 32:27 DAR 16:9],
q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop, [?] for help
[h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
[image2 @ 0x1010fa0] Could not get frame filename number 2 from pattern
'thumb2.jpg'
av_interleaved_write_frame(): Invalid argument
Command exited with non-zero status 1
*real 0m 10.01s*
user 0m 8.80s
sys 0m 0.36s
On Mon, Jul 9, 2012 at 11:52 AM, Pavan Kulkarni <pavanvkbgm at gmail.com>wrote:
> Hi,
> I have pasted the output of the commands:
>
> *time ./ffmpeg -i Pirates_remux_short.ts out1.jpg (This creates a
> thumbnail which is not very clear though)*
> malloc: using debugging hooks
> ffmpeg version 0.8.5, Copyright (c) 2000-2011 the FFmpeg developers
> built on Jan 3 2012 14:43:18 with gcc 4.3.2
> configuration: --enable-cross-compile --target-os=linux
> --cross-prefix=mipsisa32r2el-timesys-linux-gnu- --arch=mips
> --extra-cflags=-O2
> libavutil 51. 9. 1 / 51. 9. 1
> libavcodec 53. 7. 0 / 53. 7. 0
> libavformat 53. 4. 0 / 53. 4. 0
> libavdevice 53. 1. 1 / 53. 1. 1
> libavfilter 2. 23. 0 / 2. 23. 0
> libswscale 2. 0. 0 / 2. 0. 0
> [h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
> Last message repeated 1 times
>
>
> Input #0, mpegts, from 'Pirates_remux_short.ts':
> Duration: 00:00:59.22, start: 720.665000, bitrate: 33719 kb/s
> Program 1
> Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1
> DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
> Stream #0.1[0x1100](eng): Audio: pcm_bluray, 48000 Hz, 5.1, s32, 6912
> kb/s
> Incompatible pixel format 'yuv420p' for codec 'mjpeg', auto-selecting
> format 'yuvj420p'
> [buffer @ 0x10047c0] w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 sar:1/1
> sws_param:
>
> [buffersink @ 0x1004210] auto-inserting filter 'auto-inserted scaler 0'
> between the filter 'src' and the filter 'out'
> [scale @ 0x10125e0] w:1920 h:1080 fmt:yuv420p -> w:1920 h:1080
> fmt:yuvj420p flags:0x4
> [h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
> Output #0, image2, to 'out1.jpg':
>
>
> Metadata:
> encoder : Lavf53.4.0
> Stream #0.0: Video: mjpeg, yuvj420p, 1920x1080 [PAR 1:1 DAR 16:9],
> q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
> Stream mapping:
> Stream #0.0 -> #0.0
> Press [q] to stop, [?] for help
> [h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
> [image2 @ 0x1010fa0] Could not get frame filename number 2 from pattern
> 'out1.jpg'
>
> av_interleaved_write_frame(): Invalid argument
>
>
> Command exited with non-zero status 1
> *real 0m 10.90s*
> user 0m 9.61s
> sys 0m 0.50s
>
> *time ./ffmpeg -ss 18 -i Pirates_remux_short.ts -vframes 1 -f null - *
> malloc: using debugging hooks
> ffmpeg version 0.8.5, Copyright (c) 2000-2011 the FFmpeg developers
> built on Jan 3 2012 14:43:18 with gcc 4.3.2
> configuration: --enable-cross-compile --target-os=linux
> --cross-prefix=mipsisa32r2el-timesys-linux-gnu- --arch=mips
> --extra-cflags=-O2
> libavutil 51. 9. 1 / 51. 9. 1
> libavcodec 53. 7. 0 / 53. 7. 0
> libavformat 53. 4. 0 / 53. 4. 0
> libavdevice 53. 1. 1 / 53. 1. 1
> libavfilter 2. 23. 0 / 2. 23. 0
> libswscale 2. 0. 0 / 2. 0. 0
> [h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
> Last message repeated 1 times
>
>
> Input #0, mpegts, from 'Pirates_remux_short.ts':
> Duration: 00:00:59.22, start: 720.665000, bitrate: 33719 kb/s
> Program 1
> Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1
> DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
> Stream #0.1[0x1100](eng): Audio: pcm_bluray, 48000 Hz, 5.1, s32, 6912
> kb/s
> Incompatible sample format 's32' for codec 'pcm_s16le', auto-selecting
> format 's16'
> [buffer @ 0x10047c0] w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 sar:1/1
> sws_param:
>
> [h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
> Output #0, null, to 'pipe:':
>
>
> Metadata:
> encoder : Lavf53.4.0
> Stream #0.0: Video: rawvideo, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9],
> q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
> Stream #0.1(eng): Audio: pcm_s16le, 48000 Hz, 5.1, s16, 4608 kb/s
> Stream mapping:
> Stream #0.0 -> #0.0
> Stream #0.1 -> #0.1
> Press [q] to stop, [?] for help
> [h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
> frame= 1 fps= 0 q=0.0 Lsize= -0kB time=00:00:00.04 bitrate=
> -4.2kbits/s dup=20 drop=0
>
> video:0kB audio:84kB global headers:0kB muxing overhead -100.025463%
> *real 0m 9.66s*
> user 0m 8.48s
> sys 0m 0.51s
>
> *time ./ffmpeg -ss 18 -i Pirates_remux_short.ts -vframes 1 -vcodec copy
> -f rawvideo /dev/null*
> malloc: using debugging hooks
> ffmpeg version 0.8.5, Copyright (c) 2000-2011 the FFmpeg developers
> built on Jan 3 2012 14:43:18 with gcc 4.3.2
> configuration: --enable-cross-compile --target-os=linux
> --cross-prefix=mipsisa32r2el-timesys-linux-gnu- --arch=mips
> --extra-cflags=-O2
> libavutil 51. 9. 1 / 51. 9. 1
> libavcodec 53. 7. 0 / 53. 7. 0
> libavformat 53. 4. 0 / 53. 4. 0
> libavdevice 53. 1. 1 / 53. 1. 1
> libavfilter 2. 23. 0 / 2. 23. 0
> libswscale 2. 0. 0 / 2. 0. 0
> [h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
> Last message repeated 1 times
>
>
> Input #0, mpegts, from 'Pirates_remux_short.ts':
> Duration: 00:00:59.22, start: 720.665000, bitrate: 33719 kb/s
> Program 1
> Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1
> DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
> Stream #0.1[0x1100](eng): Audio: pcm_bluray, 48000 Hz, 5.1, s32, 6912
> kb/s
> File '/dev/null' already exists. Overwrite ? [y/N] y
> Output #0, rawvideo, to '/dev/null':
> Metadata:
> encoder : Lavf53.4.0
> Stream #0.0: Video: [27][0][0][0] / 0x001B, yuv420p, 1920x1080 [PAR
> 1:1 DAR 16:9], q=2-31, 90k tbn, 23.98 tbc
> Stream mapping:
> Stream #0.0 -> #0.0
> Press [q] to stop, [?] for help
> [NULL @ 0x100f690] non-existing SPS 13 referenced in buffering period
> frame= 1 fps= 0 q=-1.0 Lsize= 0kB time=00:00:01.01 bitrate=
> 0.0kbits/s
>
> video:429kB audio:0kB global headers:0kB muxing overhead -100.000000%
> *real 0m 11.10s*
> user 0m 6.64s
> sys 0m 0.30s
>
> *time ./ffmpeg -ss 18 -i Pirates_remux_short.ts -vf
> select='eq(pict_type\,PICT_TYPE_I)' -vframes 1 -an -s 150x100 thumb.jpg*
> malloc: using debugging hooks
> ffmpeg version 0.8.5, Copyright (c) 2000-2011 the FFmpeg developers
> built on Jan 3 2012 14:43:18 with gcc 4.3.2
> configuration: --enable-cross-compile --target-os=linux
> --cross-prefix=mipsisa32r2el-timesys-linux-gnu- --arch=mips
> --extra-cflags=-O2
> libavutil 51. 9. 1 / 51. 9. 1
> libavcodec 53. 7. 0 / 53. 7. 0
> libavformat 53. 4. 0 / 53. 4. 0
> libavdevice 53. 1. 1 / 53. 1. 1
> libavfilter 2. 23. 0 / 2. 23. 0
> libswscale 2. 0. 0 / 2. 0. 0
> [h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
> Last message repeated 1 times
>
>
> Input #0, mpegts, from 'Pirates_remux_short.ts':
> Duration: 00:00:59.22, start: 720.665000, bitrate: 33719 kb/s
> Program 1
> Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1
> DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
> Stream #0.1[0x1100](eng): Audio: pcm_bluray, 48000 Hz, 5.1, s32, 6912
> kb/s
> Incompatible pixel format 'yuv420p' for codec 'mjpeg', auto-selecting
> format 'yuvj420p'
> [buffer @ 0x10114a0] w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 sar:1/1
> sws_param:
>
> [scale @ 0x10043a0] w:1920 h:1080 fmt:yuv420p -> w:150 h:100 fmt:yuvj420p
> flags:0x4
> [h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
> Output #0, image2, to 'thumb.jpg':
>
>
> Metadata:
> encoder : Lavf53.4.0
> Stream #0.0: Video: mjpeg, yuvj420p, 150x100 [PAR 32:27 DAR 16:9],
> q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
> Stream mapping:
> Stream #0.0 -> #0.0
> Press [q] to stop, [?] for help
> [h264 @ 0x100f690] non-existing SPS 13 referenced in buffering period
> frame= 1 fps= 0 q=3.6 Lsize= -0kB time=00:00:00.04 bitrate=
> -4.2kbits/s dup=23 drop=0
>
> video:3kB audio:0kB global headers:0kB muxing overhead -100.642523%
> *real 0m 24.32s*
> user 0m 21.80s
> sys 0m 0.78s
>
>
>
>
> On Sat, Jul 7, 2012 at 4:56 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
>
>> Pavan Kulkarni <pavanvkbgm <at> gmail.com> writes:
>>
>> > I'm using the following command to get a thumbnail from a
>> > video file. It uses the seek option to grab a thumbnail.
>> > The problem is that this command takes up quite some time
>> > especially with certain containers such as MPEG-2 TS.
>> > (As much as 40 seconds).
>>
>> Did you try to find out what takes so long?
>> Seeking, decoding, encoding (or even startup of the executable)?
>> ffmpeg -i input.ts out.jpg
>> ffmpeg -ss 18 -i input.ts -vframes 1 -f null -
>> ffmpeg -ss 18 -i input.ts -vframes 1 -vcodec copy -f rawvideo /dev/null
>>
>> Why do you need the select filter?
>> Nowadays, FFmpeg should seek to a keyframe.
>> If I am wrong, please provide complete, uncut console output.
>>
>> Carl Eugen
>>
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>
>
More information about the ffmpeg-user
mailing list