ubuntu:video:ffmpeg:remove_video_audio_streams_by_language
This is an old revision of the document!
Ubuntu - Video - ffmpeg - Remove video/audio streams by language
Use the map command to remove streams from media files.
- The stream index begins at 0, so, for example, to remove the first stream in the file you would use -map -0:0, to remove the second stream you'd use -map -0:1:
ffmpeg -i "C:\Transcode\input.mkv" -map 0 -map -0:1 -c copy "C:\Transcode\output.mkv"
Streams can also be removed by type
For example, to remove the second video stream you'd use -map -0:v:1, to remove the second audio stream you'd use -map -0:a:1 and to remove the second subtitle stream you'd use -map -0:s:1.
You can use these commands together to do them all at once:
ffmpeg -i "C:\Transcode\input.mkv" -map 0 -map -0:v:1 -map -0:a:1 -map -0:s:1 -c copy "C:\Transcode\output.mkv"
You can automate this process on your files using the following Tdarr Plugins:
To remove subtitle streams:
Tdarr_Plugin_x7ab_Remove_Subs
To remove audio streams based on language:
Tdarr_Plugin_MC93_Migz3CleanAudio
ubuntu/video/ffmpeg/remove_video_audio_streams_by_language.1686080474.txt.gz · Last modified: 2023/06/06 19:41 by peter