faissaloo / SponSkrub

Strip advertisements from downloaded YouTube videos
GNU General Public License v3.0
177 stars 7 forks source link

Ensure all streams are copied #12

Closed pukkandan closed 3 years ago

pukkandan commented 3 years ago

When only -c copy is passed to ffmpeg without -map 0, only the first stream of each type is copied. So multiple audio/subs are lost.

See https://github.com/blackjack4494/yt-dlc/issues/193 and https://github.com/blackjack4494/yt-dlc/pull/205

faissaloo commented 3 years ago

I've merged this but be aware that subtitles will end up being desynced if they go over any sponsor spots at the moment

pukkandan commented 3 years ago

I always use it with -chapter, so I never thought about that issue. Do you have any ideas how it could be fixed?

faissaloo commented 3 years ago

Not sure about multiple streams but for subtitles I could just duplicate and modify cut_and_cat_clips_filter() to take an array of subtitles with their timestamps and decide which of them should be included in the final file depending on whether their timestamp is getting cut or not.
I'd appreciate an example video with multiple streams though, because I don't think I've ever encountered any in the wild.

faissaloo commented 3 years ago

Now that I'm looking at the board again this also needs to be done for chapters because they don't get cut down at the moment either.

pukkandan commented 3 years ago

I have encountered such videos often, but of course, when I am looking for one, I can find any!

Here's an example I got from google: https://www.youtube.com/watch?v=qfJthDvcZ08