Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#4498 closed defect (invalid)

Second Video is always corrupted when "concat demuxer" is used

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

Description

Summary of the bug:
How to reproduce:

% ffmpeg -f concat -i mylist.txt -c copy out.mp4

mylist.txt has this inside : 
file 'part1.mp4'
file 'part2.mp4'

part1.mp4 is available here - https://www.dropbox.com/s/tcrds2xhmyb9b1a/part1.mp4?dl=0
part2.mp4 is available here - https://www.dropbox.com/s/lr9drkitie4shl3/part2.mp4?dl=0

Problem : After the videos are joined the second video is always corrupted

Even if i change the order in mylist.txt to 
file 'part2.mp4'
file 'part1.mp4'


ffmpeg version 2.3.3-tessus Copyright (c) 2000-2014 the FFmpeg developers
  built on Aug 19 2014 20:44:45 with clang version 3.3 (tags/RELEASE_33/final)
  configuration: --cc=/opt/local/bin/clang-mp-3.3 --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-libmodplug --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --disable-indev=qtkit --enable-runtime-cpudetect
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 48.100 / 55. 48.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.100 /  4. 11.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[concat @ 0x7fd3e380a000] Estimating duration from bitrate, this may be inaccurate
Input #0, concat, from 'mylist.txt':
  Duration: 00:00:00.02, start: 0.000000, bitrate: 11 kb/s
    Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x272 [SAR 1:1 DAR 40:17], 698 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
    Stream #0:1: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s
File 'out.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'out.mp4':
  Metadata:
    encoder         : Lavf55.48.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x272 [SAR 1:1 DAR 40:17], q=2-31, 698 kb/s, 25 fps, 12800 tbn, 12800 tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 127 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=104851 fps=30379 q=-1.0 Lsize=  426545kB time=01:09:54.07 bitrate= 833.1kbits/s    
video:357594kB audio:65527kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.809105%

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (5)

comment:1 Changed 4 years ago by Cigaes

H.264 in MP4 is braindead and can not be concatenated. Try -auto_convert 1 on the demuxer and possibly the bitstream filter fo the muxer.

comment:2 Changed 4 years ago by muruganandh

using -auto_convert 1 solved my problem. It even inserted the bsf automatically!
Auto-inserting h264_mp4toannexb bitstream filter

So the new command looks like this :

ffmpeg -auto_convert 1 -f concat -i mylist.txt -c copy out.mp4

Thanks Cigaes!!!

comment:3 Changed 4 years ago by michael

  • Resolution set to invalid
  • Status changed from new to closed

Seems this issue was the lack of "-auto_convert 1" so closing ticket

comment:4 Changed 4 years ago by cehoyos

  • Keywords demuxer tessus removed
  • Priority changed from important to normal
  • Version changed from 2.3.5 to git-master

comment:5 Changed 3 years ago by sarojkmb

Even though i tried through the solution you provided, I still had that issue. Could you please help.

Note: See TracTickets for help on using tickets.