7

I'm trying to figure out a command for high quality screen capture on REHL.

I have tried various options, but none really worked. The quality is not good enough. I'm quite new to ffmpeg and doesn't quite understand all the different flags. So any help would be appreciated!

The commands I have tried:

ffmpeg -y -f x11grab -r 30 -s 1920x1080 -i :0.0+0,0 -vcodec libx264 -strict -2 -b:v 16M output.mov

The first command I tried. The weird thing is it doesn't seem to preserve the bitrate specified -b:v 16M. The output video's bitrate is only 2mb/s. Is that not the correct way to specify bitrate when doing screen capture?

ffmpeg -f x11grab -s 1920x1080 -r 30 -i :0.0 -qscale 0 -vcodec huffyuv output.mov

The huffyuv codec is supposed to be lossless, but the quality doesn't seem to be any better than the libx264 output.

ffmpeg -f x11grab -r 30 -s 1920x1080 -i :0.0+0,0 -vcodec copy -pix_fmt yuv420p -qscale 0 -an output.mkv
ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -r 30 -i output.mkv -an -c:v libx264 -qscale 0 result.mov 

I'm even trying to capture rawvideo and then convert it to libx264 codec viedeo. But the output is corrupted.

I'm using the version of ffmpeg that's built on April 23rd this year. It doesn't have the preset like -vpre lossless_ultrafast which I see mentioned in a lot posts.

Edit:

After more research, this is the command I end up using. I have to use h264 codec and yuv420p as pixel_fmt since I need to be able to play the quicktimes using quicktime.

ffmpeg -y -f x11grab -framerate 30 -video_size 1920x1080 -i :0.0+0,0 -c:v libx264 -pix_fmt yuv420p -qp 0 -preset ultrafast output.mov

The quality doesn't seem to be much improved even though -qp is set to 0. But it could also because of the rgb conversion to yuv color space according to this post.

https://trac.ffmpeg.org/wiki/Encode/H.264

plumzl
  • 83
  • 1
  • 1
  • 5

1 Answers1

-1

Found this on the internet, maybe it will answer your question:

http://wiki.oz9aec.net/index.php/High_quality_screen_capture_with_Ffmpeg

Edit: This answer is outdated as mentioned in the comments. Please ignore.

matan7890
  • 521
  • 3
  • 22
  • Thanks for link. Yeah, I saw that one, but the ffmpeg build we have don't have the presets used in those commands. – plumzl Aug 18 '14 at 15:03
  • 1
    What presets do you have? – matan7890 Aug 18 '14 at 15:05
  • Very limited... libvpx-1080p50_60, libvpx-360p, libvpx-720p, libx264-ipod640, libvpx-1080p, libvpx-720p50_60, libx264-ipod320 – plumzl Aug 18 '14 at 15:12
  • Yea, seems very limited... If I understand correctly, the 1080p isn't enough for you, right? – matan7890 Aug 18 '14 at 15:14
  • The 1080p is for libvpx. And I just give it a try. No good. :( – plumzl Aug 18 '14 at 15:25
  • Try to use `-vpre ultrafast`, as the presets have slightly changed: http://ubuntuforums.org/showthread.php?t=1931867 – matan7890 Aug 18 '14 at 15:30
  • Highly outdated link. Old file based "emulating" presets for libx264 were removed long ago in favor of using the actual, internal x264 presets. See [FFmpeg and H.264 Video Encoding](https://trac.ffmpeg.org/wiki/Encode/H.264). – llogan Aug 18 '14 at 22:54