[FFmpeg-trac] #2336(undetermined:new): Incorrect seeking/decoding for AVCHD file

FFmpeg trac at avcodec.org
Thu Mar 7 21:58:31 CET 2013


#2336: Incorrect seeking/decoding for AVCHD file
-------------------------------------+-------------------------------------
             Reporter:  rmk          |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 It appears seeking is incorrect and a frame gets duplicated when dealing
 with the attached AVCHD sample.

 Please check the output for the attached small sample file for the two
 command lines (file is 25 FPS AFAIK it is a PsF file):

 ffmpeg -ss 0.04 -i gh2-50i-psf.mts -vframes 1 frame-2-ss.jpg
 ffmpeg version N-50443-g454c5d1 Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Mar  3 2013 11:03:34 with llvm-gcc 4.2.1 (LLVM build
 2336.11.00)
   configuration:
   libavutil      52. 17.103 / 52. 17.103
   libavcodec     54. 92.100 / 54. 92.100
   libavformat    54. 63.102 / 54. 63.102
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 41.100 /  3. 41.100
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
 Input #0, mpegts, from 'gh2-50i-psf.mts':
   Duration: 00:00:01.38, start: 0.710178, bitrate: 46737 kb/s
   Program 1
     Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p,
 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
     Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo,
 fltp, 192 kb/s
     Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] /
 0x0090)
 Output #0, image2, to 'frame-2-ss.jpg':
   Metadata:
     encoder         : Lavf54.63.102
     Stream #0:0: Video: mjpeg, yuvj420p, 1920x1080 [SAR 1:1 DAR 16:9],
 q=2-31, 200 kb/s, 90k tbn, 25 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 -> mjpeg)
 Press [q] to stop, [?] for help
 [h264 @ 0x7fd3093c6000] Missing reference picture, default is 0
 [h264 @ 0x7fd3093c6000] decode_slice_header error
 frame=    1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
 video:138kB audio:0kB subtitle:0 global headers:0kB muxing overhead
 -100.015517%

 and

 ffmpeg -i gh2-50i-psf.mts -vframes 8 frame-%d-vframes.jpg
 ffmpeg version N-50443-g454c5d1 Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Mar  3 2013 11:03:34 with llvm-gcc 4.2.1 (LLVM build
 2336.11.00)
   configuration:
   libavutil      52. 17.103 / 52. 17.103
   libavcodec     54. 92.100 / 54. 92.100
   libavformat    54. 63.102 / 54. 63.102
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 41.100 /  3. 41.100
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
 Input #0, mpegts, from 'gh2-50i-psf.mts':
   Duration: 00:00:01.38, start: 0.710178, bitrate: 46737 kb/s
   Program 1
     Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p,
 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
     Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo,
 fltp, 192 kb/s
     Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] /
 0x0090)
 Output #0, image2, to 'frame-%d-vframes.jpg':
   Metadata:
     encoder         : Lavf54.63.102
     Stream #0:0: Video: mjpeg, yuvj420p, 1920x1080 [SAR 1:1 DAR 16:9],
 q=2-31, 200 kb/s, 90k tbn, 25 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 -> mjpeg)
 Press [q] to stop, [?] for help
 frame=    8 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.32 bitrate=N/A dup=1
 drop=0
 video:1031kB audio:0kB subtitle:0 global headers:0kB muxing overhead
 -100.002084%

 Two things seem to be wrong: The seeking (-ss) does not produce the
 correct frame  (it's equivalent to the 8th frame of the second command)
 and if just dumping frames, it seems the first frame is duplicated.

 I ran into this when I noticed that our application, written based on
 libavcodec/avformat did not work correctly when seeking in these files.
 This is only an attempt to make this reproducible with ff* tools, because
 I hope the reason for the incorrect behaviour of avformat_seek_file for
 these files is the same as for the described ffmpeg behaviour but I do not
 know that for sure.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2336>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list