Posts Tagged ‘debian sid’

How to live stream to Youtube thanks to simplescreenrecorder from Debian

marzo 1, 2015

First of all you need to install simplescreenrecorder in Debian.

So the youtube side is quite explained in the official documentation. There is an explanation on how to create a live event. Then check the live encoder settings, bit rates and resolutions. I personally choose 480p because my upload bandwith is not so good.

The trick here is to choose “Other encoders” under the Select your encoder question.

This will show some special data that you need to feed into your encoder.

What you see is similar to:

youtube_live_encoder_settings

Recording name: username-1234.abcd-efgh-1ab2c-335ds (This will change for each new live event)

Main server URL: rtmp://a.rtmp.youtube.com/live2

Secondary server URL: rtmp://b.rtmp.youtube.com/live2?backup=1 (We will not use it)

.

Then you go to Live Control Room to check that the stream status is “Without data”.

youtube_live_control_room_no_stream

Now, it’s time to run simplescreenrecorder.

  • Click on Continue on the welcome screen
  • simple_screen_recorder_welcome
  • Profile
  •  simple_screen_recorder_input_options
    • I just created a new one
  • Video input
    • Record the entire screen (I record my second screen which I previously setup as 1024×768 so that everything is read ok. Your settings may vary).
    • Photograms rate: 30 (I just used the default one)
    • Record cursor: Yes
    • Scale video: I have it unchecked so that it does not use so much cpu
  • Audio Input
    • Record audio: PulseAudio. Internal Audio
  • Finally we press on Continue button
  • Profile
  •  simple_screen_recorder_output_options
    • Live Stream 1000 kbps which we will adapt for 500 kbps
  • File
    • Save as:
      • This is the main server URL concatenated with the recording name thanks to /.
      • This is what should be explained on Youtube site and it is not.
      • So here there is what would be based on our example:
      • rtmp://a.rtmp.youtube.com/live2/username-1234.abcd-efgh-1ab2c-335ds
    • Container: Other
    • Container name: flv
  • Video
    • Codec: Others
    • Code name: libx264
    • Bitrate (bps): 500 (Changed from 1000 default)
    • Custom options:  preset=faster,minrate=500,maxrate=500,bufsize=500,keyint=60 (Change appropiated settings to 500)
  • Audio
    • Codec: MP3
    • Bitrate (kbps): 128
  • We press on Continue button
  • We check the input size to be 1024×768 as expected and press “Start recording”. That’s ok. We are not actually going live yet.

simple_screen_recorder_start_streaming

So, now back to Youtube we can click into Basic Info tab and then again into the Live Control Room where we should see if our emission is right or not. If it’s right we can check a preview. You just have to click on Generate Preview button in Youtube. A youtube player will appear which will let you check how the streaming goes. Even if you record at 480p somehow the preview is 240p or 360p only.

youtube_live_control_room_stream_ok

So, that’s it.

If you ever want to go live once in the youtube preview page you have a button that says: Start streaming. So you just click on it and you are done.

youtube_live_control_room_ready_streaming

By the way, you can click on “Cancel Recording” in Simplescreenrecorder if you want to go live later (some hours later). But, that needs to be done before going into Live Streaming (before clicking on Start streaming button on Youtube) else you will finish your event.

How to install simplescreenrecorder in Debian

marzo 1, 2015

In order to install simplescreenrecorder in my Debian GNU/Linux Sid I just used the Debian instructions on the github page.

sudo dpkg --add-architecture i386
 sudo apt-get update
 sudo apt-get install build-essential pkg-config qt4-qmake libqt4-dev libavformat-dev \
 libavcodec-dev libavutil-dev libswscale-dev libasound2-dev libpulse-dev libjack-jackd2-dev \
 libgl1-mesa-dev libglu1-mesa-dev libx11-dev libxfixes-dev libxext-dev libxi-dev g++-multilib \
 libx11-6 libxext6 libxfixes3 libxfixes3:i386 libglu1-mesa:i386
cd /usr/lib/i386-linux-gnu
 sudo ln -s libGL.so.1 libGL.so
 sudo ln -s libGLU.so.1 libGLU.so
 sudo ln -s libX11.so.6 libX11.so
 sudo ln -s libXext.so.6 libXext.so
 sudo ln -s libXfixes.so.3 libXfixes.so
 sudo ldconfig

 

Then I run the suggested script that takes care of compiling and installing it.

 

./simple-build-and-install

 

and that’s it!

 

 

Modular brillo pantalla en Mac Book Pro

marzo 19, 2012

Realmente el artículo es para quién a parte de tener un Mac Book Pro tenga por un lado KDE puesto que las teclas rápidas las configuro en base a él y puede que quién tenga un Debian Unstable. No sé qué soporte hay de esto en Ubuntu, quizás ya venga de serie. Y, bueno, de facto, es para todo el mundo que tenga un Mac Book Pro. Se mira el script y listo. En mi caso el Mac Book Pro es un 6,2.

 

Lo primero es crear el fichero:

/usr/local/bin/custom-backlight-macbookpro

que he adaptado de: Script to set-up brightness of backlight in XFCE

Su contenido será

#!/bin/bash

# Adapted from http://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/script-to-set-up-brightness-of-backlight-in-xfce-903704/
# Script for changing backlight brightness in /sys/class/backlight/acpi_video0/brightness
# can take values 0-15, in real (my notebook) works only values 2-15

#IMPORTANT: you must have writing rights to /sys/.../brightness (I must solute it with visudo or something like that...)
#IMPORTANT: for proper work after reboot must exist directory .bright in your home directory and file last_bright in .bright directory 

#reads content of brightness and save it into variable

BRIGHTNESS_FILE="/sys/devices/virtual/backlight/apple_backlight/brightness"
BRIGHT_CONF_DIR="$HOME/.bright"
LAST_BRIGHT_FILE="${BRIGHT_CONF_DIR}/last_bright"
BRIGHT=$(cat ${BRIGHTNESS_FILE})

while getopts "pmlhc" optname
 do
  case "$optname" in
   "p")
    #Add more brightness
    #BRIGHT++
    BRIGHT=$(($BRIGHT+1))
    #protect mechanism (BRIGHT must be lower or equal to 15)
     if (($BRIGHT>15))
     then
        BRIGHT=$((15))
     fi
    ;;
   "m")
    #decrease brightness
    #BRIGHT--
    BRIGHT=$(($BRIGHT-1))
    #protect mechanism (BRIGHT must be bigger or equal to 2)
     if (($BRIGHT<2))
     then
        BRIGHT=$((2))
     fi    
    ;;
   "l")
    echo "Loading last value of brightness."
    #Load last value, saved in file last_bright
    BRIGHT=$(cat ${LAST_BRIGHT_FILE})
    echo "Last value of brightness was: $BRIGHT"
    ;;
   "h")
     echo "Help: "
     echo "-p    Increase brightness"
     echo "-m    Decrease brightness"
     echo "-l    Load last brightness value"
     echo "-c N Set to custom value"
     echo "-h    This help"
     echo "Programmed by: ElectricZero"
     echo "Improved by: adrian15"
     exit 0;
     ;;
    "c")
     BRIGHT=$2
     if (($BRIGHT>15))
     then
        BRIGHT=$((15))
     fi

     if (($BRIGHT<2))
     then
        BRIGHT=$((2))
     fi
     ;;
    "?")
     echo "Unknown argument, try bright -h for help"
     exit 1;
     ;;
    *)
    # Should not occur
    echo "Unknown error while processing options"
    exit 2;
    ;;
  esac
done
echo "Brightness set on $BRIGHT"
#Save variable BRIGHT into file brightness
echo $BRIGHT > ${BRIGHTNESS_FILE}
#Save variable BRIGHT into file last_bright
if [ ! -d ${BRIGHT_CONF_DIR} ] ; then mkdir ${BRIGHT_CONF_DIR} ; fi
echo $BRIGHT > ${LAST_BRIGHT_FILE}

Ahora le daremos permisos de ejecución con

chmod +x /usr/local/bin/custom-backlight-macbookpro

y para que esto pueda funcionar sin hacer muchas comedias vamos a autorizar a nuestro usuario a ejecutar el script como root. Para ello editaremos el fichero sudoers:

sudoedit /etc/sudoers

añadiendo una linea tal que:

usuario ALL= NOPASSWD:/usr/local/bin/custom-backlight-macbookpro

.

Hasta aquí sería la parte no gráfica. Ahora pasaremos a lo aburrido.

Nos vamos a Preferencias Generales (Es una aplicación exclusiva de KDE). Acceso rápidos y gestos. Accesos rápidos personalizados.

En estos he creado un nuevo grupo (botón derecho en espacio blanco), y dentro de él dos Nuevos acceso rápidos globales basados en orden/Url.

El acceso rápido aumentar brillo como disparador tiene la tecla “Aumentar brillo” del mac. Como orden/URL tiene:

sudo /usr/local/bin/custom-backlight-macbookpro -p

De forma análoga el acceso rápido disminuir brillo como disparador tiene la tecla “Disminuir brillo” del mac. Como orden/URL tiene:

sudo /usr/local/bin/custom-backlight-macbookpro -m

Marcamos el tick para que todo el grupo esté activo y aplicamos.

En principio desde ahora cuando pulsemos las teclas “disminuir brillo” y “aumentar brillo” harán lo que se nombre indica en el rango 2-15 aunque el permitido fuera 0-15.

Si habéis consultado el enlace del script original veréis que no tenía una opción custom (para poner el valor de brillo que uno quiera) y este sí. Esto es así porque lo usaré en el cambio de modos de ahorro energía de KDE. Pero esto ya será para otro post.