User Tools

Site Tools


ffmpeg

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ffmpeg [2023/03/24 17:43] – [Converting] fixed busted example flac to mp3 rjtffmpeg [2025/04/14 16:40] (current) – more info on 'copy' ... mb don't need to bang on so much ... rjt
Line 17: Line 17:
 <code>ffmpeg -i [input].mp3 -c:a libvorbis -q:a 4 [output].ogg</code> <code>ffmpeg -i [input].mp3 -c:a libvorbis -q:a 4 [output].ogg</code>
  
-Fuck-off those .WEBMs:+Fuck-off those .WEBMs. ''copy'' here copies those streams, so they're no reencoded, it's just changing the container:
  
 <code>ffmpeg -i [input].webm -acodec copy -vcodec copy [output].mkv</code> <code>ffmpeg -i [input].webm -acodec copy -vcodec copy [output].mkv</code>
 +
 +A more compact way is to use ''-c'', which will copy over all streams (there's also ''-c:a'' (audio) ''-c:v'' (video) ''-c:s'' (subtitles)…:
 +
 +<code>ffmpeg -i [input].webm -c copy [output].mkv</code>
 +
 +So if you wanted to copy the video stream and just reencode/change the audio, for example:
 +
 +<code>ffmpeg -i [input].[ext] -acodec aac -vcodec copy [output].[ext]</code>
  
 === Multiple === === Multiple ===
Line 31: Line 39:
 <code>for i in *.mp3; do ffmpeg -i "$i" -c:a libvorbis -q:a 4 -map a "${i%.*}.ogg"; done</code> <code>for i in *.mp3; do ffmpeg -i "$i" -c:a libvorbis -q:a 4 -map a "${i%.*}.ogg"; done</code>
  
-You can use the wildcard ''*'' in the file extension to, so if you've got a mix of .mkv and .mp4 files from Youtube you can do. say:+You can use the wildcard ''*'' in the file extension too, so if you've got a mix of .mkv and .mp4 files from Youtube you can do. say:
  
 <code>for i in *.m*; do ffmpeg -i "$i" "${i%.*}.ogv"; done</code> <code>for i in *.m*; do ffmpeg -i "$i" "${i%.*}.ogv"; done</code>
Line 134: Line 142:
 Just had an .AVI file throwing error messages about a busted index. Copying the file seemed to fix it. Just had an .AVI file throwing error messages about a busted index. Copying the file seemed to fix it.
 <code>ffmpeg -i "inputfile.avi" -c:v copy -c:a copy "outputfile.avi"</code> <code>ffmpeg -i "inputfile.avi" -c:v copy -c:a copy "outputfile.avi"</code>
 +
 +===== Frontends =====
 +
 +  * [[https://ffmpeg.lav.io/|FFmpeg Explorer]] - Browser-based GUI with a node-based interface for changing parameters.
  
 ===== See Also ===== ===== See Also =====
ffmpeg.1679640234.txt.gz · Last modified: 2023/03/24 17:43 by rjt