domingo, 28 de fevereiro de 2016

Gravar o desktop com o Gnu Linux

Funciona mas sem som, pega o audio do microfone
avconv -video_size 1920x1080 -framerate 25 -f x11grab -i :0.0 -f pulse -ac 2 -i default output.mkv


x = 100 e y = 200, vai gravar esse quadrado na tela
ffmpeg -video_size 1024x768 -framerate 25 -f x11grab -i :0.0+100,200 -f alsa -ac 2 -i hw:0 output.mkv


Resolução
xdpyinfo | grep 'dimensions:'|awk '{print $2}'


Comando para encontra o audio usado pelo  sistema:
pactl list sources | grep analog-stereo.monitor
Name: alsa_output.pci-0000_00_14.2.analog-stereo.monitor

Com AUDIO!!!!!!!!!
avconv -f pulse -i alsa_output.pci-0000_00_14.2.analog-stereo.monitor -f x11grab -r 25 -s 1280x720 -i :0.0+0,24 -acodec libmp3lame -ab 63k -vcodec libx264  -threads 0 output.mkv


USAR ESSE CARA AQUI! DÁ PRA FAZER MIRRORING, VAI GRAVANDO E MANDANDO PRA TV VIA DLNA

avconv -f pulse -i alsa_output.pci-0000_00_14.2.analog-stereo.monitor -f x11grab -r 25 -s 1920x1080 -i :0.0 -acodec libmp3lame -crf 22 -ab 63k -vcodec libx264  -threads 0 output.mkv


Apenas Audio
avconv -f pulse -ac 2 -i alsa_output.pci-0000_00_14.2.analog-stereo.monitor    -acodec libmp3lame -crf 15 -ab 48k out.mp3




-crf

Consider this to be as close as you can get to a "constant quality" mode. Range is 0-51: 0 is lossless, 18 is often considered to be roughly "visually lossless", 23 is the default, and 51 is the worst. Generally you want to use the highest value that still provides an acceptable quality. If you do not know what to choose then 23-28 will probably be acceptable for streaming.

-preset

This provides the compression to encoding speed ratio. Use the slowest preset you can: ultrafast,superfastveryfastfasterfastmediumslowslowerveryslowplacebo. Try -preset veryfast if you are unsure of what to choose, then watch the console output or the video to see if the encoder is keeping up with your desired output frame rate: if it is not then use a faster preset and/or reduce your -video_size.

-maxrate

Anytime you are encoding video with bandwidth as a limiting factor you should be using VBV (Video Buffer Verifier) with the -maxrate and -bufsize options:
  • Assuming your upload rate is 1024kbit/s (1 megabit/s), and assuming you can reliably utilize 80% of that = 820 kbit/s. Audio will consume 128 kbit/s (64k/channel for stereo, but you can of course use a different audio bitrate) leaving ~692 kbit/s for video: this is your -maxrate value.
  • If you have a sane upload rate, or do not know what to choose then a -maxrate value of up to 3000k-4000k will probably be fine if your upload rate can handle it (depending on your input complexity and -video_size). Refer to your streaming service for any limitations that may apply.
  • Note that the claimed data rate pay your ISP for may not actually be what you get. You can use a site like speedtest.net to test.

-bufsize

-bufsize sets the buffer size, and can be 1-2 seconds for most gaming screencasts, and up to 5 seconds for more static content. If you use -maxrate 960k then use a -bufsize of 960k-1920k. You will have to experiment to see what looks best for your content. Refer to your streaming service for the recommended buffer size (it may be shown in seconds or bits).

-g

Use a 2 second GOP (Group of Pictures), so simply multiply your output frame rate * 2. For example, if your input is -framerate 30, then use -g 60.

Nenhum comentário: