Opened 4 years ago

Last modified 4 years ago

#4905 open defect

Splitting a flac file using -ss and -t creates chunks with wrong duration

Reported by: cdrsgi Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: flac
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
When i try to split a large flac files with ffmpeg, created chunks still have the large file's duration and sample count.
How to reproduce:

ffmpeg -v 9 -loglevel 99 -ss 0 -y -i "D:\1.flac" -vn -c:a copy -t 77.222 "C:\1_1.flac"
Exit code: 0
Console output:
ffmpeg version N-75563-g235381e Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.3 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  3.100 / 57.  3.100
  libavformat    57.  2.100 / 57.  2.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  8.100 /  6.  8.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-ss' ... matched as option 'ss' (set the start time offset) with argument '0'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ... matched as input file with argument 'D:\Mp3\Pearl Jam\Pearl Jam\1991 - Ten\01 - Pearl Jam - Once.flac'.
Reading option '-vn' ... matched as option 'vn' (disable video) with argument '1'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '77.222'.
Reading option 'C:\1_1.flac' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file D:\Mp3\Pearl Jam\Pearl Jam\1991 - Ten\01 - Pearl Jam - Once.flac.
Applying option ss (set the start time offset) with argument 0.
Successfully parsed a group of options.
Opening an input file: D:\Mp3\Pearl Jam\Pearl Jam\1991 - Ten\01 - Pearl Jam - Once.flac.
Probing aac score:1 size:2048
Probing flac score:50 size:2048
[flac @ 00000000002e2f60] Format flac probed with size=2048 and score=50
[flac @ 00000000002e2f60] Before avformat_find_stream_info() pos: 1973 bytes read:32768 seeks:0
[flac @ 00000000002ecc00] sample/frame number mismatch in adjacent frames
    Last message repeated 14 times
[flac @ 00000000002e2f60] All info found
[flac @ 00000000002e2f60] 0: start_time: 0.000 duration: 10.216
[flac @ 00000000002e2f60] stream: start_time: 0.000 duration: 231.667 bitrate=919 kb/s
[flac @ 00000000002e2f60] After avformat_find_stream_info() pos: 19381 bytes read:32768 seeks:0 frames:1
[flac @ 00000000002e2f60] read_seek: 0 0
[flac @ 00000000002e2f60] gen_seek: 0 0
[NULL @ 00000000002ecc00] sample/frame number mismatch in adjacent frames
    Last message repeated 14 times
Input #0, flac, from 'D:\Mp3\Pearl Jam\Pearl Jam\1991 - Ten\01 - Pearl Jam - Once.flac':
  Metadata:
    ALBUM           : Ten
    ALBUMARTISTSORT : Pearl Jam
    ARTIST          : Pearl Jam
    ARTISTSORT      : Pearl Jam
    CATALOGNUMBER   : 88697398492
    COMMENT         : Track 1
    DATE            : 2009-03-23
    disc            : 1
    GENRE           : Grunge
    LABEL           : Bertelsmann Music Group
    LANGUAGE        : eng
    MEDIA           : CD
    MUSICBRAINZ_ALBUMARTISTID: 83b9cbe7-9857-49e2-ab8e-b57b01038103
    MUSICBRAINZ_ALBUMID: 06fc304e-d70a-4846-93e5-544d6aa618d6
    MUSICBRAINZ_ARTISTID: 83b9cbe7-9857-49e2-ab8e-b57b01038103
    MUSICBRAINZ_TRACKID: 94bed552-376f-492d-8e87-f470aa7fda0c
    MUSICIP_PUID    : 15ee9b0f-beda-b60f-cb39-e59d719d9f67
    ORIGINALDATE    : 1991-08-27
    RELEASECOUNTRY  : GB
    RELEASESTATUS   : official
    RELEASETYPE     : album
    SCRIPT          : Latn
    TITLE           : Once
    track           : 01
    REPLAYGAIN_ALBUM_GAIN: -5.72 dB
    REPLAYGAIN_ALBUM_PEAK: 1.119748
    REPLAYGAIN_TRACK_GAIN: -6.22 dB
    REPLAYGAIN_TRACK_PEAK: 0.950928
    ENCODEDBY       : Easy CD-DA Extractor (http://www.poikosoft.com)
    TOTALTRACKS     : 11
    TOTALDISCS      : 2
    album_artist    : Pearl Jam
  Duration: 00:03:51.67, start: 0.000000, bitrate: 919 kb/s
    Stream #0:0, 1, 1/44100: Audio: flac, 44100 Hz, stereo, s16
    Side data:
      replaygain: track gain - -6.220000, track peak - 0.000022, album gain - -5.720000, album peak - 0.000026, 
Successfully opened the file.
Parsing a group of options: output file C:\1_1.flac.
Applying option vn (disable video) with argument 1.
Applying option c:a (codec name) with argument copy.
Applying option t (record or transcode "duration" seconds of audio/video) with argument 77.222.
Successfully parsed a group of options.
Opening an output file: C:\1_1.flac.
Successfully opened the file.
Output #0, flac, to 'C:\1_1.flac':
  Metadata:
    ALBUM           : Ten
    ALBUMARTISTSORT : Pearl Jam
    ARTIST          : Pearl Jam
    ARTISTSORT      : Pearl Jam
    CATALOGNUMBER   : 88697398492
    DESCRIPTION     : Track 1
    DATE            : 2009-03-23
    DISCNUMBER      : 1
    GENRE           : Grunge
    LABEL           : Bertelsmann Music Group
    LANGUAGE        : eng
    MEDIA           : CD
    MUSICBRAINZ_ALBUMARTISTID: 83b9cbe7-9857-49e2-ab8e-b57b01038103
    MUSICBRAINZ_ALBUMID: 06fc304e-d70a-4846-93e5-544d6aa618d6
    MUSICBRAINZ_ARTISTID: 83b9cbe7-9857-49e2-ab8e-b57b01038103
    MUSICBRAINZ_TRACKID: 94bed552-376f-492d-8e87-f470aa7fda0c
    MUSICIP_PUID    : 15ee9b0f-beda-b60f-cb39-e59d719d9f67
    ORIGINALDATE    : 1991-08-27
    RELEASECOUNTRY  : GB
    RELEASESTATUS   : official
    RELEASETYPE     : album
    SCRIPT          : Latn
    TITLE           : Once
    TRACKNUMBER     : 01
    REPLAYGAIN_ALBUM_GAIN: -5.72 dB
    REPLAYGAIN_ALBUM_PEAK: 1.119748
    REPLAYGAIN_TRACK_GAIN: -6.22 dB
    REPLAYGAIN_TRACK_PEAK: 0.950928
    ENCODEDBY       : Easy CD-DA Extractor (http://www.poikosoft.com)
    TOTALTRACKS     : 11
    TOTALDISCS      : 2
    ALBUMARTIST     : Pearl Jam
    encoder         : Lavf57.2.100
    Stream #0:0, 0, 1/44100: Audio: flac, 44100 Hz, stereo (16 bit)
    Side data:
      replaygain: track gain - -6.220000, track peak - 0.000022, album gain - -5.720000, album peak - 0.000026, 
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[NULL @ 00000000002ecc00] sample/frame number mismatch in adjacent frames
    Last message repeated 1678 times
No more output streams to write to, finishing.
size=    7284kB time=00:01:17.18 bitrate= 773.1kbits/s    
video:0kB audio:7275kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.123952%
Input file #0 (D:\Mp3\Pearl Jam\Pearl Jam\1991 - Ten\01 - Pearl Jam - Once.flac):
  Input stream #0:0 (audio): 833 packets read (7461572 bytes); 
  Total: 833 packets (7461572 bytes) demuxed
Output file #0 (C:\1_1.flac):
  Output stream #0:0 (audio): 832 packets muxed (7449633 bytes); 
  Total: 832 packets (7449633 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 00000000002f5860] Statistics: 2 seeks, 834 writeouts
[AVIOContext @ 00000000002ec740] Statistics: 7569408 bytes read, 0 seeks

Change History (3)

comment:1 Changed 4 years ago by cehoyos

  • Keywords split removed
  • Priority changed from important to normal
  • Version changed from unspecified to git-master

Please provide console output for ffmpeg -i 1_1.flac -f null -

comment:2 Changed 4 years ago by cdrsgi

ffmpeg.exe -i 1_1.flac -f null -

ffmpeg version N-75563-g235381e Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.3 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version
 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --en
ble-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --
nable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable
libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --en
ble-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable
libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-li
vo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-l
bwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --
nable-libxvid --enable-lzma --enable-decklink --enable-zlib
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  3.100 / 57.  3.100
  libavformat    57.  2.100 / 57.  2.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  8.100 /  6.  8.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, flac, from '1_1.flac':
  Metadata:
    ALBUM           : Ten
    ALBUMARTISTSORT : Pearl Jam
    ARTIST          : Pearl Jam
    ARTISTSORT      : Pearl Jam
    CATALOGNUMBER   : 88697398492
    comment         : Track 1
    DATE            : 2009-03-23
    disc            : 1
    GENRE           : Grunge
    LABEL           : Bertelsmann Music Group
    LANGUAGE        : eng
    MEDIA           : CD
    MUSICBRAINZ_ALBUMARTISTID: 83b9cbe7-9857-49e2-ab8e-b57b01038103
    MUSICBRAINZ_ALBUMID: 06fc304e-d70a-4846-93e5-544d6aa618d6
    MUSICBRAINZ_ARTISTID: 83b9cbe7-9857-49e2-ab8e-b57b01038103
    MUSICBRAINZ_TRACKID: 94bed552-376f-492d-8e87-f470aa7fda0c
    MUSICIP_PUID    : 15ee9b0f-beda-b60f-cb39-e59d719d9f67
    ORIGINALDATE    : 1991-08-27
    RELEASECOUNTRY  : GB
    RELEASESTATUS   : official
    RELEASETYPE     : album
    SCRIPT          : Latn
    TITLE           : Once
    track           : 01
    REPLAYGAIN_ALBUM_GAIN: -5.72 dB
    REPLAYGAIN_ALBUM_PEAK: 1.119748
    REPLAYGAIN_TRACK_GAIN: -6.22 dB
    REPLAYGAIN_TRACK_PEAK: 0.950928
    ENCODEDBY       : Easy CD-DA Extractor (http://www.poikosoft.com)
    TOTALTRACKS     : 11
    TOTALDISCS      : 2
    album_artist    : Pearl Jam
    ENCODER         : Lavf57.2.100
  Duration: 00:03:51.67, start: 0.000000, bitrate: 257 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
    Side data:
      replaygain: track gain - -6.220000, track peak - 0.000022, album gain - -
.720000, album peak - 0.000026,
Output #0, null, to 'pipe:':
  Metadata:
    ALBUM           : Ten
    ALBUMARTISTSORT : Pearl Jam
    ARTIST          : Pearl Jam
    ARTISTSORT      : Pearl Jam
    CATALOGNUMBER   : 88697398492
    comment         : Track 1
    DATE            : 2009-03-23
    disc            : 1
    GENRE           : Grunge
    LABEL           : Bertelsmann Music Group
    LANGUAGE        : eng
    MEDIA           : CD
    MUSICBRAINZ_ALBUMARTISTID: 83b9cbe7-9857-49e2-ab8e-b57b01038103
    MUSICBRAINZ_ALBUMID: 06fc304e-d70a-4846-93e5-544d6aa618d6
    MUSICBRAINZ_ARTISTID: 83b9cbe7-9857-49e2-ab8e-b57b01038103
    MUSICBRAINZ_TRACKID: 94bed552-376f-492d-8e87-f470aa7fda0c
    MUSICIP_PUID    : 15ee9b0f-beda-b60f-cb39-e59d719d9f67
    ORIGINALDATE    : 1991-08-27
    RELEASECOUNTRY  : GB
    RELEASESTATUS   : official
    RELEASETYPE     : album
    SCRIPT          : Latn
    TITLE           : Once
    track           : 01
    REPLAYGAIN_ALBUM_GAIN: -5.72 dB
    REPLAYGAIN_ALBUM_PEAK: 1.119748
    REPLAYGAIN_TRACK_GAIN: -6.22 dB
    REPLAYGAIN_TRACK_PEAK: 0.950928
    ENCODEDBY       : Easy CD-DA Extractor (http://www.poikosoft.com)
    TOTALTRACKS     : 11
    TOTALDISCS      : 2
    album_artist    : Pearl Jam
    encoder         : Lavf57.2.100
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
    Metadata:
      encoder         : Lavc57.3.100 pcm_s16le
Stream mapping:
  Stream #0:0 -> #0:0 (flac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
size=N/A time=00:01:17.27 bitrate=N/A
video:0kB audio:13312kB subtitle:0kB other streams:0kB global headers:0kB muxin
 overhead: unknown

comment:3 Changed 4 years ago by cehoyos

  • Reproduced by developer set
  • Status changed from new to open

Reproducible with ffmpeg -i fate-suite/filter/seq-3341-7_seq-3342-5-24bit.flac -t 1 -acodec copy out.flac

Note: See TracTickets for help on using tickets.