Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I get a lossless recording? #97

Closed
airbete opened this issue Aug 2, 2020 · 8 comments
Closed

How do I get a lossless recording? #97

airbete opened this issue Aug 2, 2020 · 8 comments
Labels

Comments

@airbete
Copy link

airbete commented Aug 2, 2020

How do I get a visual lossless recording ?

For the sake of the demonstration, I recorded a static image with vokoscreenNG (x264, quality 0). I extracted a screenshot of the .mkv file :
vokoscreenNG x264_q0

Here is a direct screenshot of the static image :
original

Finally, I also recorded the image with ffmpeg (-c:v libx264rgb -crf 0) and extracted a screenshot for comparison :
ffmpeg x264rgb

The recording with vokoscreenNG shows muddy colors and artifacts which don't show up with ffmpeg. Is there any way I get an equivalent quality with vokoscreenNG ?

Thank you.

@vkohaupt
Copy link
Owner

vkohaupt commented Aug 3, 2020

I could find out who caused it. It is the profile=baseline
Without this, the colors are ok.
Can you please provide the complete ffmpeg command for a better comparison.
Thanks.

@airbete
Copy link
Author

airbete commented Aug 3, 2020

The command is
ffmpeg -f x11grab -s 480x300 -r 30 -i :0.0 -c:v libx264rgb -crf 0 ffmpeg.x264rgb.mkv

I have also tried with huffyuv which gives a visually identical result as libx264rgb but with much bigger file size:
ffmpeg -f x11grab -s 480x300 -r 30 -i :0.0 -c:v huffyuv -crf 0 ffmpeg.huffyuv.avi

@vkohaupt
Copy link
Owner

I added a combo box with the profiles "baseline" and "high-4:4:4". "Baseline" is good for older video players and devices, but have a color sub-sampling from 4:2:0 and shows muddy colors. The "high-4:4:4" profile reproduces all colors very well, but the video player or device must support it. Vlc, mpv etc. support this.
screencast-02

@airbete
Copy link
Author

airbete commented Aug 15, 2020

Very nice! Colors look perfect now. Thank you so much.

@airbete
Copy link
Author

airbete commented Aug 22, 2020

I noticed today there is still something wrong.

I recorded the same static image as above with x264 / veryfast / high-4:4:4 / Quality 0.
I then played the mkv file with mpv, vlc and ffplay and recorded a screenshot in each.
Here is what I observed :
Original image == mpv == vlc != ffplay .

The recording is perfect when played with mpv and vlc, but not when played with ffplay.

This is the screenshot with mpv (identical to vlc and the original):
vokoscreenNG x264_q0_high mpv

And this is the screenshot with ffplay:
vokoscreenNG x264_q0_high ffplay

Clearly, there is a colorspace misidentification when using ffplay. This is a problem for me as I use ffmpeg (via kdenlive) to edit my clips and they still all show wrong colors. Now, is this

  • a bug in ffmpeg ?
  • a bug in gstreamer (incorrect colorspace tagging) ?
  • a bug in vokoscreenNG (incomplete colorspace tagging) ?

Here are some additional info:

ffplay / ffprobe
Stream #0:0(eng): Video: h264 (High 4:4:4 Predictive), yuv444p(tv, bt470bg/smpte170m/bt709, progressive), 480x300 [SAR 1:1 DAR 8:5], 30 fps, 30 tbr, 1k tbn, 60 tbc (default)
color_range=tv
color_space=bt470bg
color_transfer=bt709
color_primaries=smpte170m

mpv
[vf] [in] 480x300 yuv444p bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [out] 480x300 yuv444p bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264

vlc
Selection_090

The color_range=tv shown by ffprobe looks very strange to me. Shouldn't it be pc ? Is there any flag that can be added while recording in vokoscreenNG so that the correct colorspace will be identified by ffmpeg ?

Thank you

@vkohaupt
Copy link
Owner

I close this issue. I don't have time to search for ffplay the problem. Please understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@vkohaupt @airbete and others