Difference between revisions of "Ffmpeg syntax"
(19 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | Convert an avi file to mp4 for using with Telegram:<br> | ||
+ | ffmpeg -i cat.avi -c:v libx264 -crf 26 cat.mp4<br> | ||
+ | |||
+ | https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu debian, ubuntu,mint install<br> | ||
+ | The below taken from : http://linuxers.org/book/export/html/593<br> | ||
ffmpeg -i inputfile.fmt1 outputfile.fmt2<br> | ffmpeg -i inputfile.fmt1 outputfile.fmt2<br> | ||
− | ffmpeg -i input.avi -target dvd output.mpg<br> | + | ffmpeg -i input.avi -target pal-dvd output.mpg<br> |
ffmpeg -i input.fmt1 -t 30 output.fmt2<br> | ffmpeg -i input.fmt1 -t 30 output.fmt2<br> | ||
The time specified is in seconds. But the format hh.mm.ss is also supported.<br> | The time specified is in seconds. But the format hh.mm.ss is also supported.<br> | ||
This command will convert the first 30 seconds of the file input.fmt2 into output.fmt2.<br> | This command will convert the first 30 seconds of the file input.fmt2 into output.fmt2.<br> | ||
+ | ffmpeg -sn -i "/run/media/george/My Passport/FRINGE_SEASON_1_DISC_1/BDMV/STREAM/00001.m2ts" -target film-dvd output.mp4 | ||
+ | <br><br> | ||
+ | '''To convert from mkv to mp4 :'''<br> | ||
+ | ffmpeg -i LostInTranslation.mkv -vcodec copy -acodec copy LostInTranslation.mp4<br> | ||
+ | |||
+ | Audio only convert : | ||
+ | ffmpeg -i input.mp4 -c:v copy -c:a libfdk_aac -vbr 3 output.mp4 ( mp3 can be specified i instead of libfdk_aac )<br> | ||
+ | |||
+ | Below specifies to convert the audio to mp3, but the video gets converted as well to h???<br> | ||
+ | ffmpeg -i input_file.mp4 -acodec mp3 out.mp4<br> | ||
+ | |||
+ | Resizing images : <br> | ||
+ | ffmpeg -i input.jpg -vf scale=320:-1 output_320.png ( sets the x value and scales the y )<br> | ||
+ | location of wiki logo : /var/www/html/wiki/skins/common/images/wiki.jpg<br> | ||
+ | |||
+ | [[ Creating a thumbnail image from video]]<br> | ||
+ | |||
+ | '''Resizing a video :'''<br> | ||
+ | ffmpeg -i input.mp4 -s 480x320 -c:a copy output.mp4<br> | ||
+ | |||
+ | [[ Complete webcam script ]] This is the original one, makes only one page !<br> | ||
+ | |||
+ | <br> | ||
+ | trying to make smaller size<br> | ||
+ | ffmpeg -i input.wmv -s hd720 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4<br | ||
+ | ffmpeg -i input_file.avi -codec:v libx264 -profile:v high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -codec:a libfdk_aac -b:a 128k output_file.mp4<br> | ||
+ | '''To join a number of .avi files'''<br> | ||
+ | <source lang="text"> | ||
+ | file '/path/here/file1.avi' | ||
+ | file '/path/here/file2.avi' | ||
+ | file '/path/here/file3.avi' | ||
+ | |||
+ | Then pass that file to ffmpeg | ||
+ | |||
+ | ffmpeg -f concat -i mylist.txt -c copy video_draft.avi | ||
+ | </source> |
Latest revision as of 13:32, 28 April 2018
Convert an avi file to mp4 for using with Telegram:
ffmpeg -i cat.avi -c:v libx264 -crf 26 cat.mp4
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu debian, ubuntu,mint install
The below taken from : http://linuxers.org/book/export/html/593
ffmpeg -i inputfile.fmt1 outputfile.fmt2
ffmpeg -i input.avi -target pal-dvd output.mpg
ffmpeg -i input.fmt1 -t 30 output.fmt2
The time specified is in seconds. But the format hh.mm.ss is also supported.
This command will convert the first 30 seconds of the file input.fmt2 into output.fmt2.
ffmpeg -sn -i "/run/media/george/My Passport/FRINGE_SEASON_1_DISC_1/BDMV/STREAM/00001.m2ts" -target film-dvd output.mp4
To convert from mkv to mp4 :
ffmpeg -i LostInTranslation.mkv -vcodec copy -acodec copy LostInTranslation.mp4
Audio only convert :
ffmpeg -i input.mp4 -c:v copy -c:a libfdk_aac -vbr 3 output.mp4 ( mp3 can be specified i instead of libfdk_aac )
Below specifies to convert the audio to mp3, but the video gets converted as well to h???
ffmpeg -i input_file.mp4 -acodec mp3 out.mp4
Resizing images :
ffmpeg -i input.jpg -vf scale=320:-1 output_320.png ( sets the x value and scales the y )
location of wiki logo : /var/www/html/wiki/skins/common/images/wiki.jpg
Creating a thumbnail image from video
Resizing a video :
ffmpeg -i input.mp4 -s 480x320 -c:a copy output.mp4
Complete webcam script This is the original one, makes only one page !
trying to make smaller size
ffmpeg -i input.wmv -s hd720 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4<br
ffmpeg -i input_file.avi -codec:v libx264 -profile:v high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -codec:a libfdk_aac -b:a 128k output_file.mp4
To join a number of .avi files
file '/path/here/file1.avi' file '/path/here/file2.avi' file '/path/here/file3.avi' Then pass that file to ffmpeg ffmpeg -f concat -i mylist.txt -c copy video_draft.avi