Showing posts with label ffmpeg. Show all posts
Showing posts with label ffmpeg. Show all posts

Thursday, June 2, 2011

Converting Media in Ubuntu using FFMPEG

Let's say, we have a media in FLV format that we got it somewhere. Ubuntu's default ffmpeg wasn't compile with conversion option into MP3 (at least from what I understood). In order to make use of FFMPEG to the most is by getting FFMPEG straight from it's farm (terbaik dari ladang, so to speak).

The complete HOWTOS is here

The only thing that I could say important is libmp3lame support, which could allow the conversion. After the steps from the website that I linked before being done, we can check the flag of the compiled, installed FFMPEG;


najmi@vostro:~/ffmpeg-git$ ffmpeg
ffmpeg version git-N-30459-g58fd70b, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jun  2 2011 19:52:29 with gcc 4.5.2
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libxvid --enable-x11grab
  libavutil    51.  3. 0 / 51.  3. 0
  libavcodec   53.  6. 1 / 53.  6. 1
  libavformat  53.  2. 0 / 53.  2. 0
  libavdevice  53.  1. 0 / 53.  1. 0
  libavfilter   2. 11. 0 /  2. 11. 0
  libswscale    0. 14. 0 /  0. 14. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...


Use -h to get full help or, even better, run 'man ffmpeg'


As we can see, given the right flag being ENABLED, we can make use FFMPEG to the most. 

Tuesday, January 11, 2011

Zenity dan merakam audio/video menggunakan FFMPEG

Zenity membolehkan kita membuat graphical interface dengan mudah untuk skrip kita. Contohnya di dalam hal ini saya ingin merakam gambar melalui kamera web (webcam) saya dengan FFMPEG:


 ffmpeg -f video4linux2 -s 1200x960 -i /dev/video0 -r 30 -f avi -vcodec mpeg4 -vtag xvid -sameq $HOME/Pictures/`echo $(date +%a%H%M%S)`.avi 2>&1|zenity --title "Rakaman guna FFMPEG dan Zenity by Najmi  ::  Simpan ke $HOME/Pictures/" --width 900 --height 600 --text-info;reset

Di dalam skrip di atas, saya merekod video ke dalam format AVI dan ia akan dinamakan mengikut timestamp mula rakam video tersebut. 

Hasilnya, jika kebiasaannya log verbose akan dipaparkan ke terminal, ia akan dipaparkan ke dalam tetingkap luar:

Mon141019.avi 
Sat212450.avi  
Sun081112.avi  
Sun081845.avi  
Sun175308.avi  
Sun201402.avi  
Sun201459.avi  
Tue103057.avi


Dalam contoh di atas, skrip FFMPEG saya hanya merakam gambar bisu, disebabkan saya tidak meletakkan mikrofon untuk merakam suara.