[FFmpeg-trac] #4905(undetermined:open): Splitting a flac file using -ss and -t creates chunks with wrong duration

FFmpeg trac at avcodec.org
Mon Jul 24 00:05:10 EEST 2023


#4905: Splitting a flac file using -ss and -t creates chunks with wrong duration
-------------------------------------+-------------------------------------
             Reporter:  cdrsgi       |                    Owner:  (none)
                 Type:  defect       |                   Status:  open
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  git-master   |               Resolution:
             Keywords:  flac         |               Blocked By:
             Blocking:               |  Reproduced by developer:  1
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by whatdoido):

 Similar to OP, taking an {{{input flac file -> segment filter
 w/reset_timestamps -> flac}}}, I have these findings.

 Using head, I have observed that when an flac output is generated via the
 segment filter, the {{{flacenc.c}}} ONLY receives the {{{streaminfo}}}
 data for the FINAL segment output (the 3rd in my case) and thus the
 trailer update is never performed all other segment outputs (file 1 and 2
 in this case).

 Indeed {{{avformat_open_input}}} on the non final segment flacs the
 {{{AVFormatContext.duration}}} is an invalid value (-9223372036854775808)
 and the final segment having the same reported duration as the original
 input file.

 An initial look at {{{libavformat/segment.c}}} its not apparent where this
 bug would exist (if indeed its here) - {{{seg_write_packet}}} does some
 determination of whether to create {{{AV_PKT_DATA_NEW_EXTRADATA}}} but
 this is never called for any of the segments so it may suggest additional
 handling in {{{segment_end}}} but I'd need some guidance on additional
 work here.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/4905#comment:6>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list