#11182: yuvtestsrc and yuv444p->rgba->yuv444p conversion result in huge
difference
-------------------------------------+-------------------------------------
Reporter: Andrew-R | Owner: (none)
Type: defect | Status: closed
Priority: normal | Component:
| undetermined
Version: unspecified | Resolution: invalid
Keywords: colorspace | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by Andrew-R):
Interesting!
Using this command (colorspace and trc set to "5" according to
https://trac.ffmpeg.org/wiki/colorspace) :
bash-5.1$ /dev/shm/ffmpeg/ffmpeg -color_range 2 -color_trc 5 -colorspace 5
-i /dev/shm/yuv-mpeg-yuv444p.y4m -frames 1 -r 25 /dev/shm/yuv-mpeg-rgba-
yuv444p.bmp -debug log
resulting bpm and yuv files match, if I set YUView's colorspace mode for
this yuv file to bt601 full!
Files do not match if I use bt709 as trc/colorspace for this one stage
yuv->rgb conversion.
ffmpeg version N-115788-ga3f79fd22a Copyright (c) 2000-2024 the FFmpeg
developers
built with gcc 11.2.0 (GCC)
configuration: --disable-debug
libavutil 59. 36.100 / 59. 36.100
libavcodec 61. 13.100 / 61. 13.100
libavformat 61. 5.101 / 61. 5.101
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
matched as AVOption 'debug' with argument 'log'.
Trailing option(s) found in the command: may be ignored.
Finished splitting the commandline.
Parsing a group of options: global .
Successfully parsed a group of options.
Parsing a group of options: input url /dev/shm/yuv-mpeg-yuv444p.y4m.
Successfully parsed a group of options.
Opening an input file: /dev/shm/yuv-mpeg-yuv444p.y4m.
[AVFormatContext @ 0xc530880] Opening '/dev/shm/yuv-mpeg-yuv444p.y4m' for
reading
[file @ 0xc530e80] Setting default whitelist 'file,crypto,data'
[yuv4mpegpipe @ 0xc530880] Format yuv4mpegpipe probed with size=2048 and
score=100
[yuv4mpegpipe @ 0xc530880] Before avformat_find_stream_info() pos: 67
bytes read:32768 seeks:0 nb_streams:1
[yuv4mpegpipe @ 0xc530880] All info found
[yuv4mpegpipe @ 0xc530880] After avformat_find_stream_info() pos: 230473
bytes read:230473 seeks:0 frames:1
Input #0, yuv4mpegpipe, from '/dev/shm/yuv-mpeg-yuv444p.y4m':
Duration: 00:00:00.04, start: 0.000000, bitrate: 46094 kb/s
Stream #0:0, 1, 1/25: Video: rawvideo, 1 reference frame (444P /
0x50343434), yuv444p(pc, bt470bg/unknown/bt470bg, progressive), 320x240,
0/1, SAR 1:1 DAR 4:3, 25 fps, 25 tbr, 25 tbn
Successfully opened the file.
Parsing a group of options: output url /dev/shm/yuv-mpeg-rgba-yuv444p.bmp.
Applying option frames (set the number of frames to output) with argument
1.
Applying option r (override input framerate/convert to given output
framerate (Hz value, fraction or abbreviation)) with argument 25.
Successfully parsed a group of options.
Opening an output file: /dev/shm/yuv-mpeg-rgba-yuv444p.bmp.
[out#0/image2 @ 0xc533f40] No explicit maps, mapping streams
automatically...
[vost#0:0/bmp @ 0xc532fc0] Created video stream from input stream 0:0
File '/dev/shm/yuv-mpeg-rgba-yuv444p.bmp' already exists. Overwrite? [y/N]
y
Successfully opened the file.
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> bmp (native))
[vost#0:0/bmp @ 0xc532fc0] Starting thread...
[vf#0:0 @ 0xc536d40] Starting thread...
[vist#0:0/rawvideo @ 0xc533900] [dec:rawvideo @ 0xc5380c0] Starting
thread...
[in#0/yuv4mpegpipe @ 0xc530600] Starting thread...
Press [q] to stop, [?] for help
[in#0/yuv4mpegpipe @ 0xc530600] EOF while reading input
[in#0/yuv4mpegpipe @ 0xc530600] Terminating thread with return code 0
(success)
[rawvideo @ 0xc5387c0] PACKET SIZE: 230400, STRIDE: 960
[vist#0:0/rawvideo @ 0xc533900] [dec:rawvideo @ 0xc5380c0] Decoder thread
received EOF packet
[vist#0:0/rawvideo @ 0xc533900] [dec:rawvideo @ 0xc5380c0] Decoder
returned EOF, finishing
[vist#0:0/rawvideo @ 0xc533900] [dec:rawvideo @ 0xc5380c0] Terminating
thread with return code 0 (success)
detected 4 logical cores
[graph -1 input from stream 0:0 @ 0xf51016c0] Setting 'video_size' to
value '320x240'
[graph -1 input from stream 0:0 @ 0xf51016c0] Setting 'pix_fmt' to value
'5'
[graph -1 input from stream 0:0 @ 0xf51016c0] Setting 'time_base' to value
'1/25'
[graph -1 input from stream 0:0 @ 0xf51016c0] Setting 'pixel_aspect' to
value '1/1'
[graph -1 input from stream 0:0 @ 0xf51016c0] Setting 'colorspace' to
value '5'
[graph -1 input from stream 0:0 @ 0xf51016c0] Setting 'range' to value '2'
[graph -1 input from stream 0:0 @ 0xf51016c0] Setting 'frame_rate' to
value '25/1'
[graph -1 input from stream 0:0 @ 0xf51016c0] w:320 h:240 pixfmt:yuv444p
tb:1/25 fr:25/1 sar:1/1 csp:bt470bg range:pc
[format @ 0xf5102280] Setting 'pix_fmts' to value
'bgra|bgr24|rgb565le|rgb555le|rgb444le|rgb8|bgr8|rgb4_byte|bgr4_byte|gray|pal8|monob'
[auto_scale_0 @ 0xf5104080] w:iw h:ih flags:'' interl:0
[format @ 0xf5102280] auto-inserting filter 'auto_scale_0' between the
filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0xf5100a40] query_formats: 4 queried, 6 merged, 3 already
done, 0 delayed
[auto_scale_0 @ 0xf5104080] picking bgr24 out of 12 ref:yuv444p alpha:0
[swscaler @ 0xf510e800] [swscaler @ 0xf5117d80] Forcing full internal H
chroma due to input having non subsampled chroma
[swscaler @ 0xf510e800] [swscaler @ 0xf512c240] Forcing full internal H
chroma due to input having non subsampled chroma
[swscaler @ 0xf510e800] [swscaler @ 0xf513ff00] Forcing full internal H
chroma due to input having non subsampled chroma
[swscaler @ 0xf510e800] [swscaler @ 0xf51543c0] Forcing full internal H
chroma due to input having non subsampled chroma
[swscaler @ 0xf510e800] [swscaler @ 0xf5168080] Forcing full internal H
chroma due to input having non subsampled chroma
[auto_scale_0 @ 0xf5104080] w:320 h:240 fmt:yuv444p csp:bt470bg range:pc
sar:1/1 -> w:320 h:240 fmt:bgr24 csp:gbr range:pc sar:1/1 flags:0x00000004
[auto_scale_0 @ 0xf5104080] [framesync @ 0xf5104154] Selected 1/25 time
base
[auto_scale_0 @ 0xf5104080] [framesync @ 0xf5104154] Sync level 1
[graph -1 input from stream 0:0 @ 0xf51016c0] video frame properties
congruent with link at pts_time: 0
Output #0, image2, to '/dev/shm/yuv-mpeg-rgba-yuv444p.bmp':
Metadata:
encoder : Lavf61.5.101
Stream #0:0, 0, 1/25: Video: bmp, 1 reference frame, bgr24(pc,
gbr/unknown/bt470bg, progressive), 320x240 [SAR 1:1 DAR 4:3], 0/1, q=2-31,
200 kb/s, 25 fps, 25 tbn
Metadata:
encoder : Lavc61.13.100 bmp
[out#0/image2 @ 0xc533f40] Starting thread...
[out#0/image2 @ 0xc533f40] sq: send 0 ts 0.04
[out#0/image2 @ 0xc533f40] sq: 0 frames_max 1 reached
[out#0/image2 @ 0xc533f40] sq: finish 0; head ts 0.04
[out#0/image2 @ 0xc533f40] sq: finish queue
[out#0/image2 @ 0xc533f40] sq: receive 0 ts 0.04 queue head 0 ts 0.04
[vf#0:0 @ 0xc536d40] All consumers returned EOF
[out#0/image2 @ 0xc533f40] sq: 0 EOF
[out#0/image2 @ 0xc533f40] sq: finish queue
[vf#0:0 @ 0xc536d40] Terminating thread with return code 0 (success)
[image2 @ 0xc534040] The specified filename '/dev/shm/yuv-mpeg-rgba-
yuv444p.bmp' does not contain an image sequence pattern or a pattern is
invalid.
[image2 @ 0xc534040] Use a pattern such as %03d for an image sequence or
use the -update option (with -frames:v 1 if needed) to write a single
image.
[image2 @ 0xc534040] Opening '/dev/shm/yuv-mpeg-rgba-yuv444p.bmp' for
writing
[vost#0:0/bmp @ 0xc532fc0] Encoder thread received EOF
[vost#0:0/bmp @ 0xc532fc0] Terminating thread with return code 0 (success)
[file @ 0xf4d00500] Setting default whitelist 'file,crypto,data'
[AVIOContext @ 0xf4d00f00] Statistics: 230454 bytes written, 0 seeks, 1
writeouts
[out#0/image2 @ 0xc533f40] All streams finished
[out#0/image2 @ 0xc533f40] Terminating thread with return code 0 (success)
[out#0/image2 @ 0xc533f40] Output file #0 (/dev/shm/yuv-mpeg-rgba-
yuv444p.bmp):
[out#0/image2 @ 0xc533f40] Output stream #0:0 (video): 1 frames encoded;
1 packets muxed (230454 bytes);
[out#0/image2 @ 0xc533f40] Total: 1 packets (230454 bytes) muxed
[out#0/image2 @ 0xc533f40] video:225KiB audio:0KiB subtitle:0KiB other
streams:0KiB global headers:0KiB muxing overhead: unknown
frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
speed=5.13x
[in#0/yuv4mpegpipe @ 0xc530600] Input file #0 (/dev/shm/yuv-mpeg-
yuv444p.y4m):
[in#0/yuv4mpegpipe @ 0xc530600] Input stream #0:0 (video): 1 packets
read (230400 bytes); 1 frames decoded; 0 decode errors;
[in#0/yuv4mpegpipe @ 0xc530600] Total: 1 packets (230400 bytes) demuxed
[AVIOContext @ 0xc539200] Statistics: 230473 bytes read, 0 seeks
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11182#comment:8>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac
To unsubscribe, visit link above, or email
ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".