VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Member
    Join Date
    Sep 2021
    Location
    Heaven
    Search PM
    Hello everyone, i'm newbie here, and i'm requesting for some help

    I have some FLAC files, which has the total duration is 41:59 and when i was trying to concatenate these files with ffmpeg:

    file 1.flac
    file 2.flac
    file 3.flac
    file 4.flac
    file 5.flac
    file 6.flac
    file 7.flac
    file 8.flac
    file 9.flac
    file 10.flac
    And this is my command in CMD:

    Code:
    ffmpeg -f concat -i D:\exported\list.txt -c copy out.flac
    ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
    * built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
    * configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
    * libavutil* * * 56. 70.100 / 56. 70.100
    * libavcodec* ** 58.134.100 / 58.134.100
    * libavformat* * 58. 76.100 / 58. 76.100
    * libavdevice* * 58. 13.100 / 58. 13.100
    * libavfilter* ** 7.110.100 /* 7.110.100
    * libswscale* * * 5.* 9.100 /* 5.* 9.100
    * libswresample** 3.* 9.100 /* 3.* 9.100
    * libpostproc* * 55.* 9.100 / 55.* 9.100
    Input #0, concat, from 'D:\exported\list.txt':
    * Duration: N/A, start: 0.000000, bitrate: N/A
    * Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
    Output #0, flac, to 'out.flac':
    * Metadata:
    * * encoder* * * ** : Lavf58.76.100
    * Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
    Stream mapping:
    * Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    size=* 290444kB time=00:41:51.99 bitrate= 947.2kbits/s speed= 544x
    video:0kB audio:290436kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.002787%
    As you can see, the output file just has the duration 00:41:51.99, but the actual file only has duration 5:11, which is the same duration of 1st file in the list.txt
    I don't know how this can happen, but if you know it, please tell me and it might help a lot!
    Image Attached Files
    Quote Quote  
  2. This is the concat demuxer syntax in list.txt:
    file '/path/to/file1.wav'
    file '/path/to/file2.wav'
    file '/path/to/file3.wav'
    You forgot the path.
    Quote Quote  
  3. Originally Posted by ProWo View Post
    This is the concat demuxer syntax in list.txt:
    file '/path/to/file1.wav'
    file '/path/to/file2.wav'
    file '/path/to/file3.wav'
    You forgot the path.
    The above user didn't forget to put the path in; if you simply refer to the file name then it looks in the current working directory.

    And if they were to use the full path, the error would be the same.

    I've made 2 files; half_sec.flac and 1_sec.flac. half_sec is 0.5 second of silence and 1_sec is 1.0 s of silence.
    mylist.txt:
    Code:
    file '/path/to/half_sec.flac'
    file '/path/to/1_sec.flac'
    ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.flac

    ffprobe output.flac
    Code:
    Input #0, flac, from 'output.flac':
      Metadata:
        encoder         : Lavf60.5.100
      Duration: 00:00:00.50, start: 0.000000, bitrate: 145 kb/s
      Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
    The file shows as 0.5 seconds in duration and when opened in a media player, it is 0.5 seconds in length.

    The second file is not concatenated.

    This is from ffmpeg version N-110642-g6b2ae90411

    Also reproduced in the most recent snapshot version, N-110692-gc4b3e882f8
    Last edited by slycordinator; 22nd May 2023 at 00:50. Reason: adding in version info
    Quote Quote  
  4. If you use the stream copy, the file produced will be of the wrong duration.

    ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.flac
    or
    ffmpeg -f concat -safe 0 -i mylist.txt -c:a copy output.flac

    output.flac will have the duration/contents of the first file in mylist.txt

    But if you re-encode it as flac, it'll have the correct duration/contents.
    ffmpeg -f concat -safe 0 -i mylist.txt -c:a flac output.flac

    output.flac will have the duration/contents of all of the files concatenated together.
    Last edited by slycordinator; 22nd May 2023 at 01:43. Reason: formatting
    Quote Quote  
  5. You can also remux any flac to mkv first and then concatenate the mkv's.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!