[FFmpeg-user] Near lossless encoding is it even possible?

David Klasinc bigwhale at lubica.net
Tue Dec 27 10:44:48 CET 2011


Greetings all,

After days of searching trying and experimenting I gave up on getting
'lossless' screen capture.

I am running Ubuntu 11.10 and I've built ffmpeg from source with the
help of this guide: http://ubuntuforums.org/showthread.php?t=786095

I am grabbing screen with x11grab and no matter how I encode the video
there are always problems with some 'bleeding' artifacts in the video.
First I suspected that it might be the problem with x11grab, but
grabbing a single frame works and there is no bleed. Here's the command
line I used for grabbing:

$ ffmpeg -y -f x11grab -r 1 -s 800x600 -i :0.0+0,0 \
  -f image2 test_frame.png

And here's the result:
http://ubuntuone.com/4xWZkewo3PTU0kwbj5hEoJ

Now, below is a comparison of real image on the left side and a captured
screen on the right side.

http://ubuntuone.com/6CoEBUnoPUM644PPOSiY84

Please note the very obvious color bleed in the terminal window where
letters are red. The command used to capture this:

$ ffmpeg -y -f x11grab -r 25 -s 800x800 -i :0.0+0,0 \
-vcodec huffyuv test_vid.avi

The problem is that I get those artifacts no matter how I encode the
video among the various commands that I tried are those listed below:

http://pastebin.com/RH41evEB

Results are pretty much the same with various levels of artifacts. Most
of the things I am grabbing are actually terminal screens and this red
bleed is really visible and I'd like to get rid of it.

If anyone has any suggestions on which codec, parameter, preset or
whatever, I should use to get the best result, I am open for all
suggestions.

Oh and here's my ffmpeg version:

ffmpeg version N-32924-gb725443, Copyright (c) 2000-2011 the FFmpeg
developers
  built on Dec 27 2011 09:12:18 with gcc 4.6.1
  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora
--enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc
--enable-version3 --enable-x11grab
  libavutil      51. 33.100 / 51. 33.100
  libavcodec     53. 48.100 / 53. 48.100
  libavformat    53. 28.100 / 53. 28.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 54.100 /  2. 54.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  5.100 /  0.  5.100
  libpostproc    51.  2.100 / 51.  2.100

Pulled from git and built today. :)

Regards,
David


More information about the ffmpeg-user mailing list