occivink / mpv-scripts

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

encode.lua can't encode streams #7

Closed dardo82 closed 6 years ago

dardo82 commented 6 years ago

Can it work with streams too? http://gist.github.com/dardo82/63bdd3e1b2a8566e73367881acf452b3 For example with YouTube using something similar to my own shell script for downloading just a part of a video that bases the name of the output file on the id and time range or maybe even better the title?

occivink commented 6 years ago

Another direction we could take is use mpv's encoding capabilities directly and we would then benefit from the youtube-dl integration. It might also make #4 possible, but I need to take a look at what's possible with regards to tracks, filters, etc.

occivink commented 6 years ago

Ok so mpv's encoding is too restrictive, we can't copy streams or handle subtitles properly so I don't want to switch. Also it doesn't keep briightness/contrast/... settings. I suppose we can combine youtube-dl and ffmpeg to download the extract and reencode it, I'll look into that.

occivink commented 6 years ago

I dug around a bit and there is actually a property for the URL that we get back from youtube-dl, so it was just a matter of passing that to ffmpeg instead of the filepath. I've pushed some small changes that I tried with youtube and vimeo and it seems to work fine. Naturally, livestreams won't work.

dardo82 commented 6 years ago

You pushed it where? Not here…

occivink commented 6 years ago

It's 79db9ef430f06e468f5f4149b0ab8b6db6b43981, the changes are deceptively small

dardo82 commented 6 years ago

Now it quite make sense, thanks!

occivink commented 6 years ago

Let me know if you're missing anything.

dardo82 commented 6 years ago

If I try it again I will let you know if I have some questions.

dardo82 commented 5 years ago

It works! Really many thanks!