Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#6376 closed defect (invalid)

Concatenating files which have different pix_fmt results in corrupted file

Reported by: guest123 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 Changed 3 months ago by Cigaes

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

comment:2 Changed 3 months ago by guest123

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

comment:3 Changed 3 months ago by guest123

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

comment:4 Changed 3 months ago by cehoyos

  • Keywords video pix_fmt removed
  • Priority changed from important to normal
Note: See TracTickets for help on using tickets.