De Help Desk punt NL
Kennisbank
De Helpdesk > De Helpdesk > Kennisbank

Video converteren met FFmpeg

Oplossing

- Installeer FFMPEG -

#sudo apt-get install ffmpeg

 

- Informatie over een VIDEO bestand opvragen -

#ffmpeg -i mijnvideo.avi

 

 

- Exporteer elk frame naar een JPEG van een video -

#ffmpeg -i video.avi afbeelding%d.jpg

 
If you want to try this, work inside a specific folder or you'll fill your home with thousands of jpeg.

 

- Video maken van een serie JPEG bestanden -

ffmpeg -f afbeelding2 -i afbeelding03d.jpg mijnvideo.mpg

 

Note the parameter imagepercent03d.jpg. You must type in terminal % and not percent [I must use this trick beacuse editor misunderstand the combination %zerosometing]. This one works on files named "image001.jpg", "image002.jpg", "image999.jpg". You can adjust it to your need. For example %d is good for images named image1.jpg, image2.jpg, etc. Jpeg are the most common type, but you can work with every kind of bitmap file.

 

 

 

The command is really useful if you're working on a stopmotion video and want a quick test. We can do more, setting fps and bitrate this way.

 

ffmpeg -r 24 -b 1800 -i image%d.jpg myvideo.mpg

 

-r 24 means "24 frames per second" and -b 1800 means "video bitrate at 1800 kb/s".

 

- TO EXTRACT THE AUDIO TRACK FROM A VIDEO AND SAVE IT MP3 -

 

ffmpeg -i myvideo.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 myaudio.mp3

 

This means:

 

  • Original video: myvideo.avi
  • Sampling frequency: 44100 Hz
  • Audio bitrate: 192 kb / s
  • Output Format: mp3
  • Audio generated: myaudio.mp3

 

The quick&dirty version is:

 

ffmpeg -i myvideo.avi myaudio.mp3

 

- TO CONVERT A VIDEO FROM FORMAT A TO FORMAT B -

 

ffmpeg -i originalvideo.avi convertedvideo.mpg

 

Here we are converting an AVI file into an MPEG one [quick&dirty mode = ON].

 

- TO QUICK CONVERT A VIDEO TO iPhone -

 

This is good for 4:3 videos.

 

ffmpeg -i originalvideo.avi -s 480x320 -aspect 4:3 -b 768k -ab 64k -ar 22050 -r 30000/1001 convertedvideo.mp4

 

Change -aspect 4:3 to -aspect 16:9 if you are working on a 16:9 video.

 

- TO CONVERT A VIDEO TO iPad -

 

When the going gets tough, the toughs get going! Don't fear, just sneak where the files names are and the -aspect parameter.

 

ffmpeg -y -i originalvideo.avi -acodec aac -ar 48000 -ab 128k -ac 2 -s 1024×768 -vcodec libx264 -b 1200k -flags +loop+mv4 -cmp 256 -partitions +parti4x4+partp8x8+partb8x8 -subq 7 -trellis 1 -refs 5 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 1200k -maxrate 1200k -bufsize 1200k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect 16:9 -r 30 -g 90 -async 2 convertedvideo.mp4

 

- TO QUICK CONVERT A VIDEO TO WEBM -

 

ffmpeg -i originalvideo.avi convertedvideo.webm

 

WebM is an audio-video format designed to provide a royalty-free, open video compression format for use with HTML5 video. The project's development is sponsored by Google.

 

- TO CAPTURE SCREEN AND MIC - 

 

ffmpeg -f alsa -itsoffset 00:00:02.000 -ac 2 -i hw:0,0 -f x11grab -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -r 10 -i :0.0 -sameq -f mp4 -s wvga -y mydesktopmovie.mp4

 

 
Was dit artikel bruikbaar? ja / nee
Gerelateerde artikelen screenshots van video maken
Hoe installeer je FFMPEG
FFmpeg installeren in CentOS, Fedora en Redhat
How to Install DVDStyler 3.0 in Ubuntu & Linux Mint
Audio CD rippen in Linux
Artikel details
Artikel ID: 795
Categorie: Grafisch
Zoekwoorden video, convert, converteren, opslaan, exporteren, jpg, wemb, mp4, mpeg, avi, mkv
Datum toegevoegd: 20-Mar-2024 12:03:04
Aantal bekeken: 785
Beoordeling (Stemmen): Artikel beoordeeld 3.9/5.0 (7)

 
« Ga terug