FFmpeg: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m →Usage |
||
| Line 35: | Line 35: | ||
FFmpeg needs to be run from the command line, but you can create batch scripts to automate the process for multiple files. There is also a plugin for Python (https://pypi.org/project/ffmpeg-python/), but it is fairly limited so we recommend using subprocess instead (see example below). | FFmpeg needs to be run from the command line, but you can create batch scripts to automate the process for multiple files. There is also a plugin for Python (https://pypi.org/project/ffmpeg-python/), but it is fairly limited so we recommend using subprocess instead (see example below). | ||
The following are examples of conversions that we commonly use. For [[Psychopy]] applications, please follow the more strict instructions under [[Video Playback#FFmpeg]] | The following are examples of conversions that we commonly use. For [[Psychopy]] applications, please follow the more strict instructions under [[Video Playback#FFmpeg]]. | ||
===Basic Format Conversion=== | ===Basic Format Conversion=== | ||
| Line 121: | Line 121: | ||
</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 [https://docs.python.org/3/tutorial/inputoutput.html#tut-f-strings 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. | ||
==External Links== | |||
*[https://github.com/rendi-api/ffmpeg-cheatsheet ffmpeg cheatsheet] - For more examples of helpful commands. | |||
==See Also== | ==See Also== | ||
* [[Video Codecs]] | * [[Video Codecs]] | ||