Linux permette mediante l'utilizzo di diverse utility di registrare sequenza audio-video dal proprio desktop per creare tutorial.
Io utilizzo l'ottimo recordmydesktop sia da linea di comando che da interfaccia grafica (gtk-recordmydesktop) entrambi installabili da synaptic o similare.
Utilizzando gtk-recordmydesktop e' possibile selezionare l'area di cattura dello schermo e impostare diversi parametri per video e audio, iniziare la registrazione e stopparla mediante apposito pulsante posto nella barra delle applicazioni.
Il risultato e' un file ogg o meglio ogv che puo' essere caricato in youtube o convertito con utility come winff, avidemux o da linea di comando direttamemente con mencoder o ffmpeg.
Per un corretto funzionamento installare:
recormydesktop e gtk-recordmydesktop oppure krecordmydesktop per kde
inoltre installiamo mencoder e ffmpeg
Per convertire da linea di comando possiamo utilizzare :
- Conversione in avi
mencoder -idx out.ogg -ovc lavc -oac mp3lame -o out.avi
- Conversione in formato Flash
Per convertire i video in formato Flash swf o flv con supporto audio
mencoder -forceidx -of lavf -oac mp3lame -lameopts abr:br=64 -srate 22050 -ovc lavc \
-lavcopts vcodec=flv:vqscale=6:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -o output.flv input.avi
Approfondimenti sull'utilizzo di mencoder e codec audio video:
10.1. Selecting codecs and container formats
Audio and video codecs for encoding are selected with the -oac and -ovc options, respectively. Type for instance:
mencoder -ovc help
to list all video codecs supported by the version of MEncoder on your machine. The following choices are available:
Audio Codecs:
Audio codec name | Description |
---|---|
mp3lame | encode to VBR, ABR or CBR MP3 with LAME |
lavc | use one of libavcodec 's audio codecs |
faac | FAAC AAC audio encoder |
toolame | MPEG Audio Layer 2 encoder |
twolame | MPEG Audio Layer 2 encoder based on tooLAME |
pcm | uncompressed PCM audio |
copy | do not reencode, just copy compressed frames |
Video codecs:
Video codec name | Description |
---|---|
lavc | use one of libavcodec 's video codecs |
xvid | Xvid, MPEG-4 Advanced Simple Profile (ASP) codec |
x264 | x264, MPEG-4 Advanced Video Coding (AVC), AKA H.264 codec |
nuv | nuppel video, used by some realtime applications |
raw | uncompressed video frames |
copy | do not reencode, just copy compressed frames |
frameno | used for 3-pass encoding (not recommended) |
Output container formats are selected with the -of option. Type:
mencoder -of help
to list all containers supported by the version of MEncoder on your machine. The following choices are available:
Container formats:
Container format name | Description |
---|---|
lavf | one of the containers supported by libavformat |
avi | Audio-Video Interleaved |
mpeg | MPEG-1 and MPEG-2 PS |
rawvideo | raw video stream (no muxing - one video stream only) |
rawaudio | raw audio stream (no muxing - one audio stream only) |
The AVI container is the native container format for MEncoder, which means that it's the one that is best handled, and the one for which MEncoder was designed. As noted above, other container formats are usable, but you may experience problems when using them.
libavformat
containers:
If you selected libavformat
to do the muxing of the output file (by using the -of lavf), the appropriate container format will be determined by the file extension of the output file. You may force a particular container format with libavformat
's format option.
libavformat container name | Description |
---|---|
mpg | MPEG-1 and MPEG-2 PS |
asf | Advanced Streaming Format |
avi | Audio-Video Interleaved |
wav | Waveform Audio |
swf | Macromedia Flash |
flv | Macromedia Flash video |
rm | RealMedia |
au | SUN AU |
nut | NUT open container (experimental and not yet spec-compliant) |
mov | QuickTime |
mp4 | MPEG-4 format |
dv | Sony Digital Video container |
mkv | Matroska open audio/video container |
As you can see, libavformat
allows MEncoder to mux into a considerable variety of containers. Unfortunately, as MEncoder was not designed from the beginning to support container formats other than AVI, your should really be paranoid about the resulting file. Please check to be sure that the audio/video synchronization is OK and that the file can be played correctly by players other than MPlayer.
Example 10.1. encode to Macromedia Flash format
Creating a Macromedia Flash video suitable for playback in a web browser with the Macromedia Flash plugin:
mencoderinput.avi
-ooutput.flv
-of lavf \
-oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc \
-lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3
Roberto Lissandrin