[FFmpeg-trac] #7558(undetermined:new): Ignore coded resolutions in using -c:v copy?

FFmpeg trac at avcodec.org
Thu Mar 13 11:44:18 EET 2025


#7558: Ignore coded resolutions in using -c:v copy?
-------------------------------------+-------------------------------------
             Reporter:  ponpon       |                    Owner:  (none)
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by tomwillow):

 I tested the file 1080.mp4 with newer ffmpeg(commit
 7225e307be6a98a463b7cbb118ff1f20391f21e4 Fri Feb 14 14:52:33 2025 +0100).

 This issue has been fixed at some time before.

 And I played the output video, it can be playing well(a pure green frame).

 {{{
 ./ffmpeg -y -v debug -i 1080.mp4 -c:v copy test.mp4
 ffmpeg version N-118658-g7225e307be Copyright (c) 2000-2025 the FFmpeg
 developers
   built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
   configuration: --enable-shared --disable-stripping --prefix=build
 --extra-cflags='-fsanitize=address -g' --extra-ldflags='-fsanitize=address
 -g'
   libavutil      59. 58.100 / 59. 58.100
   libavcodec     61. 33.102 / 61. 33.102
   libavformat    61.  9.107 / 61.  9.107
   libavdevice    61.  4.100 / 61.  4.100
   libavfilter    10.  9.100 / 10.  9.100
   libswscale      8. 13.100 /  8. 13.100
   libswresample   5.  4.100 /  5.  4.100
 Splitting the commandline.
 Reading option '-y' ... matched as option 'y' (overwrite output files)
 with argument '1'.
 Reading option '-v' ... matched as option 'v' (set logging level) with
 argument 'debug'.
 Reading option '-i' ... matched as input url with argument '1080.mp4'.
 Reading option '-c:v' ... matched as option 'c' (select encoder/decoder
 ('copy' to copy stream without reencoding)) with argument 'copy'.
 Reading option 'test.mp4' ... matched as output url.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option y (overwrite output files) with argument 1.
 Applying option v (set logging level) with argument debug.
 Successfully parsed a group of options.
 Parsing a group of options: input url 1080.mp4.
 Successfully parsed a group of options.
 Opening an input file: 1080.mp4.
 [AVFormatContext @ 0x617000000080] Opening '1080.mp4' for reading
 [file @ 0x610000000340] Setting default whitelist 'file,crypto,data'
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x617000000080] Format mov,mp4,m4a,3gp,3g2,mj2
 probed with size=2048 and score=100
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x617000000080] ISO: File Type Major Brand:
 isom
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x617000000080] Unknown dref type 0x206c7275
 size 12
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x617000000080] Processing st: 0, edit list 0 -
 media time: 1024, duration: 12800
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x617000000080] Offset DTS by 1024 to make
 first pts zero.
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x617000000080] Setting codecpar->delay to 2
 for stream st: 0
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x617000000080] Before
 avformat_find_stream_info() pos: 3962 bytes read:3962 seeks:0 nb_streams:1
 [h264 @ 0x619000000580] nal_unit_type: 7(SPS), nal_ref_idc: 3
 [h264 @ 0x619000000580] Decoding VUI
 [h264 @ 0x619000000580] nal_unit_type: 8(PPS), nal_ref_idc: 3
 [h264 @ 0x619000000580] nal_unit_type: 7(SPS), nal_ref_idc: 3
 [h264 @ 0x619000000580] Decoding VUI
 [h264 @ 0x619000000580] nal_unit_type: 8(PPS), nal_ref_idc: 3
 [h264 @ 0x619000000580] nal_unit_type: 6(SEI), nal_ref_idc: 0
 [h264 @ 0x619000000580] nal_unit_type: 5(IDR), nal_ref_idc: 3
 [h264 @ 0x619000000580] Format yuv420p chosen by get_format().
 [h264 @ 0x619000000580] Reinit context to 1920x1088, pix_fmt: yuv420p
 [h264 @ 0x619000000580] no picture
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x617000000080] All info found
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x617000000080] After
 avformat_find_stream_info() pos: 1168 bytes read:3962 seeks:0 frames:1
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1080.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf58.18.101
   Duration: 00:00:01.00, start: 0.000000, bitrate: 31 kb/s
   Stream #0:0[0x1](und), 1, 1/12800: Video: h264 (High), 1 reference frame
 (avc1 / 0x31637661), yuv420p(progressive, left), 1920x1080 [SAR 1:1 DAR
 16:9], 0/1, 22 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
     Metadata:
       handler_name    : VideoHandler
       vendor_id       : [0][0][0][0]
 Successfully opened the file.
 Parsing a group of options: output url test.mp4.
 Applying option c:v (select encoder/decoder ('copy' to copy stream without
 reencoding)) with argument copy.
 Successfully parsed a group of options.
 Opening an output file: test.mp4.
 [out#0/mp4 @ 0x611000001440] No explicit maps, mapping streams
 automatically...
 [vost#0:0/copy @ 0x617000001200] Created video stream from input stream
 0:0
 [file @ 0x610000001f40] Setting default whitelist 'file,crypto,data'
 Successfully opened the file.
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
 Output #0, mp4, to 'test.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf61.9.107
   Stream #0:0(und), 0, 1/12800: Video: h264 (High), 1 reference frame
 (avc1 / 0x31637661), yuv420p(progressive, left), 1920x1080 [SAR 1:1 DAR
 16:9], 0/1, q=2-31, 22 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
     Metadata:
       handler_name    : VideoHandler
       vendor_id       : [0][0][0][0]
 [out#0/mp4 @ 0x611000001440] Starting thread...
 [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x613000000200] Starting thread...
 Press [q] to stop, [?] for help
 [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x613000000200] EOF while reading input
 [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x613000000200] Terminating thread with
 return code 0 (success)
 [out#0/mp4 @ 0x611000001440] All streams finished
 [out#0/mp4 @ 0x611000001440] Terminating thread with return code 0
 (success)
 [AVIOContext @ 0x613000001000] Statistics: 3985 bytes written, 2 seeks, 4
 writeouts
 [out#0/mp4 @ 0x611000001440] Output file #0 (test.mp4):
 [out#0/mp4 @ 0x611000001440]   Output stream #0:0 (video): 25 packets
 muxed (2809 bytes);
 [out#0/mp4 @ 0x611000001440]   Total: 25 packets (2809 bytes) muxed
 [out#0/mp4 @ 0x611000001440] video:3KiB audio:0KiB subtitle:0KiB other
 streams:0KiB global headers:0KiB muxing overhead: 41.723033%
 frame=   25 fps=0.0 q=-1.0 Lsize=       4KiB time=00:00:00.92 bitrate=
 34.6kbits/s speed= 500x
 [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x613000000200] Input file #0 (1080.mp4):
 [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x613000000200]   Input stream #0:0
 (video): 25 packets read (2809 bytes);
 [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x613000000200]   Total: 25 packets (2809
 bytes) demuxed
 [AVIOContext @ 0x6130000003c0] Statistics: 3962 bytes read, 0 seeks
 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/7558#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list