Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ffmpeg [2015/05/29 05:32]
slackermedia
ffmpeg [2021/06/03 19:48] (current)
Line 1: Line 1:
-[[{arrowp.png|border:​0;​background:​none;​width:​0;​display:​inline-block;​position:​absolute;​top:​0;​left:​0;​}digikam|]] 
- 
-[[{arrown.png|border:​0;​background:​none;​width:​0;​display:​inline-block;​position:​absolute;​top:​0;​margin-left:​2.5em;​}ffmpeg2theora|]] 
- 
 ====== Ffmpeg HOWTO ====== ====== Ffmpeg HOWTO ======
  
Line 340: Line 336:
  
 <​code>​ <​code>​
-$ grep proc /​proc/​cpuinfo ​\\+$ grep proc /​proc/​cpuinfo
 processor: ​   : 1 processor: ​   : 1
 processor: ​   : 2 processor: ​   : 2
Line 381: Line 377:
 $ ffmpeg -i hackmovie_snippet.mkv -ss 03:30:00 -t 01:00:00 \ $ ffmpeg -i hackmovie_snippet.mkv -ss 03:30:00 -t 01:00:00 \
 -s hd720 -threads 8 compression-test.webm -s hd720 -threads 8 compression-test.webm
 +</​code>​
  
 Run a few hundred encoding tests overnight, study the results, and you'll be an expert in no time. Run a few hundred encoding tests overnight, study the results, and you'll be an expert in no time.
  
-=====Calling an Editor'​s Bluff=====+=====Performance Boost=====
  
-On Linux, a common design scheme is to enable everything with the expectation that the user (you) will be the best judge of how to use with all the bits of exposed circuitry. This is absolutely the best policy, without question, but it is up to the user (you) to refrain from blindly taking an application up on bad offer. For exampleyour video editing application may well //be able//technicallyto open any variety of compressed ​formats, but that does not mean that it's in your best interest to attempt real-time editing ​with them. In other words, just because you //can// do something doesn'​t mean that you //should//; it may be that an option is available because someone smarter than you or I will think of a new and exciting way of exploiting it, or it may be good in a pinch but not practical for everyday use+Linux video and audio editors generally support every possible codec they canand that's quite lot. This affords you great freedom, but should ​you experience performance issues while working with compressed file format (such as MP3Vorbis, TheoraDiracand so on), consider extracting the video and audio streams from their compressed ​containers and working ​with them as native ​or [nearly] uncompressed files.
  
-An artist just trying ​to get work donehowevershould ride well within the safety regulationsfirmly buckled in and with a pragmatic eye on the goal+If you do find that you need to convert mediayou obviously want to avoid losing qualityso ensure that you are using a //less// compressed container, and that you are retaining the exact same settings as the source video.
  
-For instancecompressed formats are not generally meant to be editable formats+If ''​mediainfo''​ or ''​video-meta''​ reports a bit rate of 67M at 29.97 fpsthen when you convert, use at least 67M for the bit rate and 29.97 for the frame rate.
  
 +Here are some example commands for the various native and [mostly] uncompressed formats:
  
-====Lossless Codecs====+<WRAP indent>​ 
 +**WAV**
  
 +//​Uncompressed PCM audio.//
  
 +<​code>​
 +ffmpeg -i foo.bar -vn -ar 48000 foo.wav
 +</​code>​
  
-=====A Full Command=====+**AIFF**
  
-Ffmpeg commands can become very complex, as you can imagine. Of course, you should never confuse "​complex"​ with "​good";​ sometimes, less is more. Very frequently, ffmpeg commands ​//evolve//, not built. In other words, if you have spent a month editing your movie in Kdenlive and output  ​+//Uncompressed PCM audio.//
  
 +<​code>​
 +ffmpeg -i foo.bar -vn -ar 48000 foo.aiff
 +</​code>​
 +
 +**AU**
 +
 +//Sun Microsystems uncompressed PCM data.//
 +
 +<​code>​
 +ffmpeg -i foo.bar -vn -ar 48000 foo.au
 +</​code>​
 +</​WRAP>​
 +
 +Native and [mostly] uncompressed video formats:
 +
 +<WRAP indent>
 +**FFV1**
 +
 +//Native ffmpeg video format.//
 +
 +<​code>​
 +ffmpeg -i foo.bar -an -vcodec FFV1 -b:v 80M -threads 8 foo.mkv
 +</​code>​
 +
 +**Huff YUV**
 +
 +//Lossless video format.//
 +
 +<​code>​
 +ffmpeg -i foo.bar -an -vcodec huffyuv ​ -b:v 80M -threads 8 foo.mkv
 +</​code>​
 +
 +**MOV**
 +
 +//Quicktime movie file.//
 +
 +<​code>​
 +ffmpeg -i foo.bar -an -vcodec libquicktime ​ -b:v 80M -threads 8 foo.mov
 +</​code>​
 +</​WRAP>​
 +
 +There are other formats, but these are well supported and tested.
 +
 +
 +=====Lossless Codecs=====
 +
 +Ffmpeg supports a number of lossless formats ideal for Gold Masters and long term storage, including FFV1 and HuffYUV for video, FLAC and WAVPACK for sound.
  
  
 <WRAP tip> <WRAP tip>
 **See Also** \\ **See Also** \\
-mencoder+[[http://​www.mplayerhq.hu/​DOCS/​HTML/​en/​mencoder.html|Mencoder]] \\ 
 +[[http://​gstreamer.freedesktop.org/​|Gstreamer]] \\ 
 +[[https://​xiph.org/​flac/​|Flac]] \\ 
 +[[http://​www.wavpack.com/​|wavpack]] \\ 
 +[[http://​www.imagemagick.org|Imagemagick]] 
 +</​WRAP>​ 
 + 
 +<WRAP centeralign>​ 
 +<wrap fa>​[[fabla|R]]</​wrap>​ <wrap fa>​[[start|S]]</​wrap>​ <wrap fa>​[[ffmpeg2theora|Q]]</​wrap>​
 </​WRAP>​ </​WRAP>​
  
-[[{arrown.png|border:​0;​background:​none;​width:​0;​display:​inline-block;​float:​right;​}ffmpeg2theora|]][[{arrowp.png|border:​0;​background:​none;​width:​0;​float:​right;​}digikam|]]