occivink / mpv-scripts

Various scripts for mpv
The Unlicense
420 stars 38 forks source link

youtube-dl and audio #25

Closed AeliusSaionji closed 5 years ago

AeliusSaionji commented 5 years ago

Hello!

When playing a video from youtube with separate audio and video streams, encode.lua only operates on the video stream and omits the audio. Would it be possible to include external audio streams in the conversion?

Thanks!

occivink commented 5 years ago

Is this a video that was downloaded as a file using youtube-dl and then opened with mpv, or is it being streamed from youtube directly? In either case, could you provide an example of how to reproduce this?

AeliusSaionji commented 5 years ago

Simply stream basically any HQ YouTube video from the last 5 years with mpv http://YouTube....

I assume the issue would probably happen with any video where mpv loaded audio/subs from an external file.

occivink commented 5 years ago

You're right, for such videos the audio track appears as external and has its own url. It looks all the necessary information is available so I think it's just a matter of passing that properly to ffmpeg, I'll take a look at it this weekend

AeliusSaionji commented 5 years ago

Thanks! But I think this may have broken using encode and crop at the same time?

occivink commented 5 years ago

Right, this is what I get for refactoring without testing much. Fixed now