Changes

Jump to navigation Jump to search
m
Line 42: Line 42:  
<code>-i</code> specifies input file
 
<code>-i</code> specifies input file
   −
The last argument is always the output file. Without specifying any codec or bit rate (see examples below), FFmpeg will encode the video using some arbitrary default settings.
+
The last argument is always the output file. Without specifying any codec or bit rate (see examples below), FFmpeg will encode the video (and audio, if included) using some arbitrary default settings, depending on the input file and output format.
    
===Encoding===
 
===Encoding===
Line 120: Line 120:  
subprocess.run(f'ffmpeg -i "{inputFile}" -vcodec h264 -b:v 8M "{outputFile}"')
 
subprocess.run(f'ffmpeg -i "{inputFile}" -vcodec h264 -b:v 8M "{outputFile}"')
 
</syntaxhighlight >
 
</syntaxhighlight >
The command within <code>subprocess.run()</code> is the same as you would type into the command line. You can use Python's string formatting to insert variables.
+
The command within <code>subprocess.run()</code> is the same as you would type into the command line. You can use Python's [https://docs.python.org/3/tutorial/inputoutput.html#tut-f-strings string formatting] to insert variables.
    
==See Also==  
 
==See Also==  
 
* [[Video Codecs]]
 
* [[Video Codecs]]

Navigation menu