Ajatt-Tools / impd

🍵 AJATT-style passive listening and condensed audio without bloat.
https://tatsumoto-ren.github.io/blog/passive-listening
GNU General Public License v3.0
40 stars 4 forks source link

use first audio/subtitle track when best_track could not be confirmed #4

Closed nairyosangha closed 2 years ago

nairyosangha commented 2 years ago

When dealing with files which contain multiple unnamed subtitle (or audio) tracks, the best_track function will not return anything and the ffmpeg will use -s (or -a) as map parameter. According to the ffmpeg docs this will select all suitable streams. This causes the subtitle extract to fail with the error below

[srt @ 0x558672431600] SRT supports only a single subtitles stream. Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Error initializing output stream 0:1 --

tatsumoto-ren commented 2 years ago

Thank you!