[FFmpeg-trac] #8635(avcodec:closed): FFV1 not lossless when encoding RGB data (bgr0 pixel format)
FFmpeg
trac at avcodec.org
Mon Apr 27 16:44:17 EEST 2020
#8635: FFV1 not lossless when encoding RGB data (bgr0 pixel format)
-------------------------------------+-------------------------------------
Reporter: | Owner:
JustAnotherArchivist |
Type: defect | Status: closed
Priority: normal | Component: avcodec
Version: unspecified | Resolution: invalid
Keywords: ffv1 | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Changes (by JustAnotherArchivist):
* status: new => closed
* resolution: => invalid
Comment:
Interesting, thank you. Since x11grab produces bgr0 output, I assumed that
using the same pix_fmt throughout should be lossless. Indeed, the fourth
byte is the difference between the streams:
{{{
$ ffmpeg -i rgb.mkv -c:v rawvideo -f rawvideo -pix_fmt bgr0 - 2>/dev/null
| xxd | head -1
00000000: f4f5 f6ff f4f5 f6ff f4f5 f6ff f4f5 f6ff ................
$ ffmpeg -i ffv1.mkv -c:v rawvideo -f rawvideo -pix_fmt bgr0 - 2>/dev/null
| xxd | head -1
00000000: f4f5 f600 f4f5 f600 f4f5 f600 f4f5 f600 ................
}}}
And with gbrp, the streams are identical:
{{{
$ ffmpeg -i rgb.mkv -c:v rawvideo -f rawvideo -pix_fmt gbrp - 2>/dev/null
| md5sum
79058c74ef8d9ff27483828ac57c10fe -
$ ffmpeg -i ffv1.mkv -c:v rawvideo -f rawvideo -pix_fmt gbrp - 2>/dev/null
| md5sum
79058c74ef8d9ff27483828ac57c10fe -
}}}
Sorry for the noise. I got identical streams with bgr0 with all other
lossless codecs and settings I tried (x264, x265, vp9, huffyuv, rawvideo),
so it seemed reasonable to assume that it's a stable colour encoding. Very
confusing that the "0" actually means undefined, not NUL bytes.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8635#comment:3>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list