Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6376 closed defect (invalid)

Concatenating files which have different pix_fmt results in corrupted file

Reported by: Thomas Thomas 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: If input format is "concat" and files which are being concatenated differ in pixel format, the output file is corrupted.

How to reproduce:

ffmpeg -f concat -i 1.txt -y -quality best -pix_fmt yuv420p 3.mp4
# 1.txt
file '1.mp4'
file '2.mp4'

Output of ffprobe:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.57.100
  Duration: 00:00:12.00, start: 0.000000, bitrate: 12922 kb/s
    Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), y
uv444p, 640x480, 12918 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.57.100
  Duration: 00:00:12.00, start: 0.000000, bitrate: 11004 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480,
11001 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler

As you can see, 1.mp4 has pixel format of type yuv444p and 2.mp4 has yuv420p. I solved the problem by firstly converting 1.mp4 to yuv420p and then concatenating. But, I read the whole documentation and I didn't find anything saying that files must be of the same pixel format in order to be concatenated.

If needed, I can upload test files.

Change History (4)

comment:1 by Cigaes, 7 years ago

The doc says: “All files must have the same streams (same codecs, same time base, etc.).”

comment:2 by Thomas Thomas, 7 years ago

Resolution: invalid
Status: newclosed

comment:3 by Thomas Thomas, 7 years ago

@Cigaes. I can confirm you are right. My mistake. Sorry for invalid issue.

comment:4 by Carl Eugen Hoyos, 7 years ago

Keywords: video pix_fmt removed
Priority: importantnormal
Note: See TracTickets for help on using tickets.