Show pageDiscussionOld revisionsBacklinksExport to MarkdownBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ===== ffmpeg toolbox ===== //⚠ This page probably uses CLI tools referenced [[en:tools:linux:misc-tools|here]]// * [[man>ffmpeg]] * [[man>parallel]] ==== Davinci Resolve ==== [[en:tools:misc:davinci-startup|Davinci Resolve]] conversion of 1 ''.mov'' file: <code>ffmpeg -i monfichier.truc -vcodec mjpeg -q:v 2 -acodec pcm_s16be -q:a 0 -f mov monfichier.mov</code> The ''-q:v x'' option defines the quality of the conversion. Convert a folder at once : <code>for i in *.MTS; do ffmpeg -i "$i" -vcodec mjpeg -q:v 2 -acodec pcm_s16be -q:a 0 -f mov "${i%.*}.mov"; done</code> convert all tree at once : <code>find . -type f -not -name "*.jpg" -not -name "*.png" -not -name "*.JPG" -not -name "*.JPEG" -print0 | parallel -0 --eta ffmpeg -loglevel 0 -i {} -vcodec mjpeg -q:v 2 -acodec pcm_s16be -q:a 0 -f mov {.}-trans.mov</code> //⚠ Beware, this command takes into account several file types that could be found on a SD card and converts everything that doesn't match an image extension.// option to change size : ''-s 720x480'' proxy creation command : <code>mkdir proxy; for i in *.MOV; do ffmpeg -i "$i" -vcodec mjpeg -q:v 10 -acodec pcm_s16be -q:a 0 -f mov "proxy/${i%.*}.mov"; done</code> ==== Conversion to x.265 ==== In order to gain space on warez, the ideal is to convert the ''x264'' encoded movies to the ''x265'' allowing for size reduction up to a factor of 10! The ''-crf 26'' option defines the compression, with a value of ''0'' it is lossless, up to ''51'' the worst. The value ''26'' corresponds to the usual compression level of x264 media and allows therefore a good gain of space with minimal loss of quality. the pixel format defined by ''format=yuv420p'' (8bits) can be replaced by ''format=yuv420p10le'' (10bits) for compatible media at the cost of space advantage. (to find the pixel format of the original media: ''ffprobe -i myfile.mkv'' [[https://trac.ffmpeg.org/wiki/Encode/H.264|ffmpeg documentation]] <code>find . -type f -name "*mkv" -print0 | parallel -0 --eta ffmpeg -loglevel 0 -i {} -map 0 -c:v libx265 -crf 26 -vf format=yuv420p -c:a copy {.}-x265.mkv</code> ==== Reduce the size of MP3s ==== Command to reduce the size of a whole tree of ''.mp3'' files to use an ancestral mp3 player with only 256MB of internal memory: <code>find -type f -name "*.mp3" -o -name "*.wav" -print0 | parallel -0 --eta ffmpeg -loglevel 0 -i {} -vn -ac 2 -b:a 96k {.}-smol.mp3</code> en/tools/linux/ffmpeg.txt Last modified: 2024/01/26 14:28by crunchyslime