Re: HOWTO: Proper Screencasting on Linux
Quote:
Originally Posted by
andrew.46
Hi verb3k,
Thanks for the great guide :). A small query about Example 4: had you considered using the FFmpeg native 'Xvid' (MPEG-4) encoder rather than the external xvid library? Some details here:
3.10 How do I encode Xvid or DivX video with ffmpeg?
http://www.ffmpeg.org/faq.html#SEC22
In my experience the FFmpeg version looks better and runs faster, but I would be interested to hear the experiences of others with this...
All the best,
Andrew
Actually I hadn't :D
I hardly encode anything to MPEG-4 ASP, so for the sake of the guide I went straight to xvid because I thought FFmpeg's ASP encoder wasn't as good as xvid, which turned out to be a surprise. Your comment triggered my interest to do a small comparison and the result was that they were visually very close, I couldn't make out any real difference between the two. The internal encoder had a huge edge in speed as you said. I will perhaps update the guide with a fifth example. (xvid's presence is a must to assure those who want nothing but "xvid" :D )
Thanks for your useful suggestion,
verb3k
Re: HOWTO: Proper Screencasting on Linux
Verb3k,
There's a minor problem with the order of command line options in the first post which causes ffmpeg to only "see" 1 audio channel on the incoming side. The proper syntax order for 2 channel capture is therefore:
Code:
ffmpeg -f alsa -ac 2 -ab 128k -i pulse -acodec pcm_s16le -f x11grab -r 30 -s 1280x1024 -i :0.0 -aspect 4:3 -vcodec libx264 -vpre lossless_ultrafast -threads 0 SCREENCAST.mkv
You can also specify an audio bitrate after the "-ac 2" part as I've shown, but if you don't it just defaults to 64 kbps. This method always captures to MP2 audio and I'm not sure why. I experimented with AAC audio capture and MPEG4 and AVI containers, but they don't work very well.
Thanks for making this tutorial! I'll never touch recordmydesktop again!
Re: HOWTO: Proper Screencasting on Linux
You could add a use case for encoding using flashsv codec.
It as four advantages:
- Fast
- Good for postproduction editing.
- Output file is directly playable in browser using Flash Plugin.
- Encoding is lossless /and/ RGB. This means that you get true losslessness and not YUV color subsampling as in x264
Disadvantage, it is high bitrate. FFMpeg is looking at flashsv2, which is more efficient, but there are few bitstream examples in the wild.
Byzanz offers flashsv nowadays too.
Re: HOWTO: Proper Screencasting on Linux
Quote:
Originally Posted by
mocha
Verb3k,
There's a minor problem with the order of command line options in the first post which causes ffmpeg to only "see" 1 audio channel on the incoming side. The proper syntax order for 2 channel capture is therefore:
Code:
ffmpeg -f alsa -ac 2 -ab 128k -i pulse -acodec pcm_s16le -f x11grab -r 30 -s 1280x1024 -i :0.0 -aspect 4:3 -vcodec libx264 -vpre lossless_ultrafast -threads 0 SCREENCAST.mkv
You can also specify an audio bitrate after the "-ac 2" part as I've shown, but if you don't it just defaults to 64 kbps. This method always captures to MP2 audio and I'm not sure why. I experimented with AAC audio capture and MPEG4 and AVI containers, but they don't work very well.
Thanks for making this tutorial! I'll never touch recordmydesktop again!
You don't need to specify a bitrate when you capture raw PCM. Also, since the input is usually a mic, so there is no difference whether you record with -ac 2 or not. It will have the same audio on 2 channels once you encode your compressed version.
I'm glad you found the tutorial useful :)
Re: HOWTO: Proper Screencasting on Linux
Quote:
Originally Posted by
verb3k
Step 2:
Example 3:
Code:
ffmpeg -ss 10 -t 07:22 -i output.mkv -acodec libvorbis -ab 128k -ac 2 -vcodec libx264 -vpre hq -crf 22 -threads 0 our-final-product.mkv
In the above example, we specified the starting point of the encoding of our final product after 10 seconds from the start of the original input file using -ss 10. We also specify the duration of the encoding to be 7 minutes and 22 seconds
Example 4;
Code:
ffmpeg -i output.mkv -acodec libmp3lame -ab 128k -ac 2 -vcodec libxvid -qscale 8 -me_method full -mbd rd -flags +gmc+qpel+mv4 -trellis 1 -threads 0 our-final-product.avi
Here we have a typical avi with xvid and mp3.
Shortened version of the guide above for quick reference.
If I take the first part in example 3 and add it to the command in example 4 to specify the duration of the encoding.
Example
Code:
ffmpeg -t 03:48 -i output.mkv -acodec libmp3lame -ab 128k -ac 2 -vcodec libxvid -qscale 8 -me_method full -mbd rd -flags +gmc+qpel+mv4 -trellis 1 -threads 0 our-final-product.avi
Using a capture length of 3 min.54 sec. and using -t 03:48 should trim it at 3 min. 48 sec. but instead trims it at 3.0 seconds.
Changing it to - t 00:03:48 trims it properly at 3 min. 48 sec..
Also the file size of the avi is too big (almost 3/4 the size of the mkv) so I found this.
Quote:
To have a constant quality (but a variable bitrate), use the option '-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst quality).
So a larger number makes the file smaller (with lower quality) and a lower number makes the file larger (with higher quality).
A setting of 13-14 will make it about 1/2 the size of the mkv file.
Excellent how to, thank you for all your time and effort in creating it. I will be sending people here when they complain about the record my desktop applications in ubuntu.
Re: HOWTO: Proper Screencasting on Linux
ok going to try this thanks /:D
Re: HOWTO: Proper Screencasting on Linux
What is the best way to record a video for sites like Youtube, Blip etc. ?
I tried a few methods with this but it simply turns out to be crap after the Youtube or Blip finishes with it (making the video literally unrecognizable).
The quality before is very nice and I love it (HD ftw) ^^
Re: HOWTO: Proper Screencasting on Linux
Thank you this is the cats meow of screencast with mic. I tried everything ... all else had sound sync fail. I'm a copy paste guy ... worked flawlessly. The output was spot on ... actually the sound 'gained' a few after youtube processing. 720 HD eh all :) Thanks!
Re: HOWTO: Proper Screencasting on Linux
Quote:
Originally Posted by
jarmore
Thank you this is the cats meow of screencast with mic. I tried everything ... all else had sound sync fail. I'm a copy paste guy ... worked flawlessly. The output was spot on ... actually the sound 'gained' a few after youtube processing. 720 HD eh all :) Thanks!
So you have no problems? What are your settings?
Re: HOWTO: Proper Screencasting on Linux
Very useful guide thanks. I've been using capturemydesktop but I've found that it doesn't work too well with compiz. How's this solution with it?