Tuesday, May 8, 2012

Edit videos using ffmpeg in linux ubuntu

FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec - the leading audio/video codec library and the ffmpeg command line program for transcoding multimedia files.
  • Install ffmpeg in Ubuntu : "sudo apt-get install ffmpeg"
 FFmpeg commands to edit videos :

1. Extracting a clip from a longer video( -ss for start time , -t for end time and -sameq for same quality)
  • "ffmpeg -ss 00:06:09 -t 00:00:15 -i infile.avi  -sameq  outfile.avi"

 2. Merge audio and video
  • "ffmpeg -i input.mp3 -i input.avi -sameq output.avi"
3. Convert a file from one format to another
  • "ffmpeg -i input.mp4 -vcodec copy -acodec copy output.mpg"
4. Change resolution of video ( -s = size)
  • "ffmpeg -i  inputfile.avi  -s 320x240  outputfile.avi"
5. Crop a video
  • "ffmpeg -i inputfile.avi -croptop 88 -cropbottom 88 -cropleft 360 -cropright 360 outputfile.avi"
6. Extract (save) all Frames of a videos ( "-r"=  rate (fps)  )
  • "ffmpeg -i inputfile.avi -r 1  image-%3d.jpeg"
7. Extract audio from a video ( -b = bit rate)
  • "ffmpeg -i inputfile.avi -b 128k out.mp3"


Enjoy !!!!

5 comments:

  1. I used this before...very useful...

    ReplyDelete
  2. thanks sir for this, please tell me more command like merge two or more videos from any path

    ReplyDelete
  3. I really appreciate this journal and that i can positive promote this journal to others in my circle.
    Mp3skull UK proxy

    ReplyDelete
  4. Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post

    ReplyDelete