google-code-export / ffmpegthumbnailer

Automatically exported from code.google.com/p/ffmpegthumbnailer
GNU General Public License v2.0
1 stars 1 forks source link

Use byte seeking when time to seek is given in percentage #77

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The default seeking method in ffmpegthumbnailer-2.0.6 (linked against 
ffmpeg-0.6) is always failing with my MPEG2-TS files and the first frame is 
used instead:

> ffmpegthumbnailer -t 30 -i video.ts -o thumb.jpg
[mpeg2video @ 0x822d8f0]mpeg_decode_postinit() failure
[mpegts @ 0x82292a0]max_analyze_duration reached
[NULL @ 0x822e890]start time is not set in av_estimate_timings_from_pts
[NULL @ 0x822f060]start time is not set in av_estimate_timings_from_pts
Seeking in video failed, will use first frame
[mpeg2video @ 0x822d8f0]mpeg_decode_postinit() failure
[mpegts @ 0x8229250]max_analyze_duration reached
[NULL @ 0x822cc70]start time is not set in av_estimate_timings_from_pts
[NULL @ 0x822f250]start time is not set in av_estimate_timings_from_pts

However, thumbnailing works nicely if seeking is done directly with byte 
offsets (AVSEEK_FLAG_BYTE) as implemented in the attached patch.

Original issue reported on code.google.com by rahre...@gmail.com on 10 Jan 2011 at 12:05

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the effort, can you provide me with a file that fails so I can have 
a look at it?

Original comment by dirk.vdb on 14 Jan 2011 at 10:03

GoogleCodeExporter commented 9 years ago
You can use for example this one with a command-line option "-t 50":
http://samples.mplayerhq.hu/MPEG2/res_change_ffmpeg_aspect.ts

Without byte seeking a first frame is always used with all streaming containers 
that don't contain any duration information (i.e. MPEG2-TS). However, it might 
be convenient to add a new command-line option for the byte seeking as 50% of 
duration isn't exactly in the middle of the file (especially if VBR is used), 
but it's usually close enough.

Original comment by rahre...@gmail.com on 19 Jan 2011 at 1:45

GoogleCodeExporter commented 9 years ago
I applied the patch to ffmpegthumbnailer-2.0.2 because 2.0.6 is not working on 
Linux Debian Lenny because of too old version libavcodec51.

It works fine on MPEG2-TS files in SD resolution (720x576) but there's a 
problem on TS files in HD resolution (1920×1080). There are plenty of errors 
like:

[h264 @ 0x7f3ed8d03760]non existing PPS referenced
[h264 @ 0x7f3ed8d03760]decode_slice_header error
[h264 @ 0x7f3ed8d03760]no frame!
[h264 @ 0x7f3ed8d03760]B picture before any references, skip
[h264 @ 0x7f3ed8d03760]decode_slice_header error
[h264 @ 0x7f3ed8d03760]no frame!

Is this a known issue?

Thanks

Original comment by notr...@net-eclipse.net on 16 Jun 2011 at 4:28

GoogleCodeExporter commented 9 years ago
Updated the patch for recent ffmpeg library versions.

Original comment by rahre...@gmail.com on 12 Aug 2013 at 1:06

Attachments: