meoiswa / vrchat-transcode-utilities

Collection of utilities to make transcoding video suitable for streaming into VRChat easier
3 stars 4 forks source link

Ensure output file only has one audio track #7

Open philpax opened 7 months ago

philpax commented 7 months ago

VRChat video players don't let you switch the audio track, so whatever one comes up first is the one that the video will play with. We should make sure that the output video only has one track (through ffmpeg command construction).

If you do end up accidentally encoding a video with multiple audio tracks, this is how you fix it:

ffmpeg -i output.mp4 -map 0:v -map 0:a:N -c copy output2.mp4

where N is the zero-indexed audio track; e.g. if you have

ffprobe -v error -show_entries stream=index,codec_type:stream_tags=language,title -of default=noprint_wrappers=1 output.mp4
index=0
codec_type=video
TAG:language=und
index=1
codec_type=audio
TAG:language=jpn
index=2
codec_type=audio
TAG:language=eng
index=3
codec_type=audio
TAG:language=eng
index=4
codec_type=data
TAG:language=eng

and you want the jpn audio, you should use N=0.