[FFmpeg-trac] #10287(undetermined:new): Trimming .FLAC files the duration doesn't get updated and remains as the input original

FFmpeg trac at avcodec.org
Tue Mar 28 12:48:42 EEST 2023


#10287: Trimming .FLAC files the duration doesn't get updated and remains as the
input original
-------------------------------------+-------------------------------------
             Reporter:  456325       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:  FLAC flac    |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:

 I am trying to cut out part of the flac audio file and the resulting file
 has full length of the original (wrong), though the file size is lower
 than original (good). Seeking in media player (for example MPV or VLC)
 beyond what was cut cause reset of the playback to beginning.

 Input file: https://drive.proton.me/urls/HZ2J3EWZNG#8KQk7SA6sLfN

 Command used to cut it:

 {{{
 $ ffmpeg -hide_banner -ss '111.17848' -i 'input.flac' -t '369.79157'
 -avoid_negative_ts make_zero -map '0:0' '-c:0' copy -map_metadata 0
 -movflags '+faststart' -default_mode infer_no_subs -ignore_unknown -f flac
 -y 'output.flac'
 }}}


 $ ./ffmpeg -v 9 -loglevel 99 -i 'input.flac'
 {{{
 ffmpeg version N-65014-g7c130d6911-static
 https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2023 the FFmpeg
 developers
   built with gcc 8 (Debian 8.3.0-6)
   configuration: --enable-gpl --enable-version3 --enable-static --disable-
 debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio
 --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp
 --enable-libgme --enable-gray --enable-libaom --enable-libfribidi
 --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame
 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
 --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt
 --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab
 --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264
 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid
 --enable-libzvbi --enable-libzimg
   libavutil      58.  3.100 / 58.  3.100
   libavcodec     60.  6.101 / 60.  6.101
   libavformat    60.  4.100 / 60.  4.100
   libavdevice    60.  2.100 / 60.  2.100
   libavfilter     9.  4.100 /  9.  4.100
   libswscale      7.  2.100 /  7.  2.100
   libswresample   4. 11.100 /  4. 11.100
   libpostproc    57.  2.100 / 57.  2.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 '-i' ... matched as input url with argument 'input.flac'.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option v (set logging level) with argument 9.
 Successfully parsed a group of options.
 Parsing a group of options: input url input.flac.
 Successfully parsed a group of options.
 Opening an input file: input.flac.
 [NULL @ 0x7819ac0] Opening 'input.flac' for reading
 [file @ 0x781a2c0] Setting default whitelist 'file,crypto,data'
 Probing flac score:100 size:2048
 [flac @ 0x7819ac0] Format flac probed with size=2048 and score=100
 [flac @ 0x7819ac0] Before avformat_find_stream_info() pos: 9509 bytes
 read:32768 seeks:0 nb_streams:1
 [flac @ 0x781ac80] sample/frame number mismatch in adjacent frames
     Last message repeated 20 times
 [flac @ 0x7819ac0] All info found
 [flac @ 0x7819ac0] stream 0: start_time: 0 duration: 561.75
 [flac @ 0x7819ac0] format: start_time: 0 duration: 561.75 (estimate from
 stream) bitrate=935 kb/s
 [flac @ 0x7819ac0] After avformat_find_stream_info() pos: 60416 bytes
 read:65536 seeks:0 frames:1
 Input #0, flac, from 'input.flac':
   Metadata:
     TITLE           : redacted
     ARTIST          : redacted
     ALBUM ARTIST    : redacted
     album_artist    : redacted
     ALBUM           : redacted
     track           : redacted
     PERFORMER       : redacted
     COMMENT         : redacted
     GENRE           : redacted
     DATE            : redacted
     COMPOSER        : redacted
     ENSEMBLE        : redacted
     RATING          : redacted
     TOTALTRACKS     : redacted
   Duration: 00:09:21.75, start: 0.000000, bitrate: 935 kb/s
   Stream #0:0, 1, 1/44100: Audio: flac, 44100 Hz, stereo, s16
 Successfully opened the file.
 At least one output file must be specified
 [AVIOContext @ 0x7822700] Statistics: 65536 bytes read, 0 seeks
 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10287>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list