Difference between revisions of "High quality screen capture with Ffmpeg"
From MyLabWiki
m |
|||
Line 5: | Line 5: | ||
Compress and convert to MP4 format (Youtube ready): | Compress and convert to MP4 format (Youtube ready): | ||
− | ffmpeg -i video.mkv -vcodec libx264 -vpre hq -crf '''22''' -threads 0 video. | + | ffmpeg -i video.mkv -vcodec libx264 -vpre hq -crf '''22''' -threads 0 video.mp4 |
− | Lower -crf gives higher quality. | + | Lower -crf gives higher quality. For post processing in iMovie or [[:Category:Final_Cut_Express|Final Cut Express]] better to use .mov container in the above conversion. |
For including audio: | For including audio: |
Revision as of 21:33, 1 March 2011
Capture without audio:
ffmpeg -f x11grab -r 25 -s 1280x720 -i :0.0+0,48 -vcodec libx264 -vpre lossless_ultrafast -threads 0 video.mkv
Compress and convert to MP4 format (Youtube ready):
ffmpeg -i video.mkv -vcodec libx264 -vpre hq -crf 22 -threads 0 video.mp4
Lower -crf gives higher quality. For post processing in iMovie or Final Cut Express better to use .mov container in the above conversion.
For including audio:
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1024x768 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 output.mkv
In order to make ffmpeg capture audio from other applications:
- Start the ffmpeg capture (it just has to run)
- Start pavucontrol
- In the Recording tab, ffmpeg should be visible and here we can choose between input and monitor
The settings will be remembered until we change them back.
Note: This does not work with Java running in firefox.
TODO:
The audio output can also be captured with gstreamer:
gst-launch -e pulsesrc device="alsa_output.pci-0000_00_1b.0.analog-stereo.monitor" ! audioconvert ! \ lamemp3enc target=1 bitrate=128 cbr=true ! filesink location=output.mp3
where the device name is the one returned by
pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2
Can we use this device name in ffmpeg recording?
References
- How to do Proper Screencasts on Linux Using Ffmpeg: http://verb3k.wordpress.com/2010/01/26/how-to-do-proper-screencasts-on-linux/
- https://bugs.launchpad.net/ubuntu/+source/ffmpeg/+bug/305286