Linux Mint - Free and powerful

Thursday, 19 April 2012

Capturing the linux desktop via a command line using ffmpeg ready for youtube

Capturing the desktop using ffmpeg

http://unix.stackexchange.com/questions/11702/how-to-record-skype-video-calls-on-linux

ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq out.mpg
ffmpeg -f x11grab -s 1920x1080 -r 25 -i :0.0 -sameq out.mpg
ffmpeg -f x11grab -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -r 25 -i :0.0 -sameq out.mpg 

http://linux.die.net/man/1/xwininfo
ffmpeg -f x11grab -s --windowid 0x2a00025 -r 25 -i :0.0 -sameq out.mpg

ffmpeg -f x11grab -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -r 25 -i :0.0 -sameq out.mpg

ffmpeg -f x11grab -s $(xwininfo -root | grep 'Width' | awk '{print $2;}'x | grep 'Width' | awk '{print $2;}') -r 25 -i :0.0 -sameq out.mpg

xwininfo -root | grep 'Width' | awk '{print $2;}'x | grep 'Width' | awk '{print $2;}'

http://gleeda.blogspot.com/2009/08/briefly-recordmydesktop.html


to record a specific window with recordmydesktop, use "xwininfo" to get the window id, then with recordmydesktop use the "--windowid" parameter. If you want to scale your window to a specific size (in pixels) there's different ways to do it--I believe Compiz has this as an option, also Openbox will tell you the window dimensions. (I'm using Fedora.) Also I believe Openbox will let you "undecorate" a window, which is helpful if recordmydesktop is recording your window border. However, I'm not sure if this is possible with ffmpeg?

Fullscreen

ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -r 30 -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 -y output.mkv



----------------------------------------------

Single Window

#Note use this script, an X cursor will appear and then select the window you want to record.

#!/bin/sh

INFO=$(xwininfo -frame)

WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+')
WIN_XY=$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' | grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/\+/,/' )

ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -r 30 -s $WIN_GEO -i :0.0+$WIN_XY -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 -y output-single.mkv


-----------------------------------------------

Convert to Youtube Standard

Note: $1 is your input file

ffmpeg -i "$1" -s 1280x720 -aspect 16:9 -r 30000/1001 -b 10000k -vcodec libx264 -pass 1 -vpre fast_firstpass -an "$1"-out.mp4 && ffmpeg -y -i "$1" -s 1280x720 -aspect 16:9 -r 30000/1001 -b 10000k -vcodec libx264 -pass 2 -vpre fast -acodec libfaac -ac 2 -ar 48000 -ab 320k "$1"-out.mp4





0 comments :

Post a Comment

Thank you for taking the time to comment. Your opinion is important and of value and we appreciate the positive feedback! If you are "Negative Nancy" then please do us, and humanity, a favor, and piss off.

Total Pageviews

Google+ Followers

Pages

Blog Archive

Popular Posts

Recent Comments

Rays Twitter feed

Ads

Web sites come and go and information is lost and therefore some pages are archived. @rayd123. Powered by Blogger.