Opened 9 years ago

Closed 8 years ago

#3108 closed enhancement (fixed)

concat demuxer doesn't accept CR as line separators

Reported by: Xtophe Owned by:
Priority: wish Component: avformat
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes


The concat demuxer does not work correct. It creates a valid playable file but all files in the concat file are not added. Just the first file is copied.

A simple example to concat two small files (in the case two of the same files but it also does not work when you use different sources).

The used concatfile.txt :

file /Users/imac/Desktop/
file /Users/imac/Desktop/

The used FFmpeg command line:

ffmpeg -f concat -i /Users/imac/Desktop/concatfile.txt -codec copy -y /Users/imac/Desktop/

ffmpeg output:

ffmpeg version 2.1 Copyright (c) 2000-2013 the FFmpeg developers

built on Aug 1 2013 16:03:22 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration: --prefix=/Volumes/tempdisk/sw --as=yasm --enable-gpl --enable-pthreads --disable-ffplay --disable-ffserver --disable-shared --enable-static --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --enable-avfilter --enable-fontconfig --enable-libfreetype --enable-libass --enable-libutvideo --enable-filters --enable-postproc --enable-runtime-cpudetect
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100

[concat @ 0x7fe280818600] Estimating duration from bitrate, this may be inaccurate
Input #0, concat, from '/Users/imac/Desktop/concatfile.txt':

Duration: 00:00:00.02, start: 0.000000, bitrate: 26 kb/s

Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x270 [SAR 1:1 DAR 16:9], 976 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
Stream #0:1: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 131 kb/s

Output #0, mov, to '/Users/imac/Desktop/':


encoder : Lavf55.12.100
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p, 480x270 [SAR 1:1 DAR 16:9], q=2-31, 976 kb/s, 25 fps, 12800 tbn, 12800 tbc
Stream #0:1: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, 131 kb/s

Stream mapping:

Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)

Press [q] to stop, ? for help
frame= 250 fps=0.0 q=-1.0 Lsize= 1361kB time=00:00:10.03 bitrate=1111.3kbits/s
video:1191kB audio:160kB subtitle:0 global headers:0kB muxing overhead 0.666447%

The resulting file is working BUT:

  • It has the file size of the first file (
  • The movie length is also the same as the first file (

Basically this means the concat hasn't been done. It just copied the video and audio streams of the first file.

BTW this also happens with the latest GIT version.

Attachments (1) (1.3 MB ) - added by Xtophe 9 years ago.

Download all attachments as: .zip

Change History (6)

by Xtophe, 9 years ago

Attachment: added

comment:1 by Xtophe, 9 years ago

To be clear:
In this example the result should be a movie of 20 seconds and 2,6MB in size (read: twice the length and size of the two source files).
The result you now get is 10secs and 1.3MB

comment:2 by Nicolas George, 9 years ago

Analyzed by developer: set
Component: FFmpegavformat
Status: newopen
Summary: concat demuxer doesn't work rightconcat demuxer doesn't accept CR as line separators
Type: defectenhancement

Your concat script has carriage returns instead of the normal line feeds to separate the lines; this is a quirk of obsolete macos software. Use an editor that separates lines with LF, or even CR-LF like windows software, and it should work.

comment:3 by Xtophe, 9 years ago

Bummer .. thanks it works now.
This ticket can be closed.

comment:4 by Carl Eugen Hoyos, 9 years ago

Priority: normalwish
Version: 2.1git-master

comment:5 by Michael Niedermayer, 8 years ago

Reproduced by developer: set
Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.