occivink / mpv-scripts

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

Does clipping streams work? #31

Closed Kerobyte closed 4 years ago

Kerobyte commented 4 years ago

I've seen some mentions of clipping streams but I'm having trouble with it. Here's what's passed through with these settings,

only_active_tracks=yes
preserve_filters=no
append_filter=
codec=-c copy
output_format=$f_$n.$x
output_directory=WINDOWS PATH\
detached=yes
ffmpeg_command=ffmpeg
print=yes
ffmpeg -ss 00:01.455 -i 'edl://!no_clip;!no_chapters;%847%https://r2---sn-c5ioiv45c-5goe.googlevideo.com/videoplayback?expire=1569730344&ei=yNqPXcGUIYroyQXAxqqoCw&ip=185.159.156.18&id=o-AIFcq4x0DshBJ_wt3FvFp4q-J_i_BVcTIG8gvTGafJ2i&itag=242&aitags=133%2C160%2C242%2C278&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-c5ioiv45c-5goe%2Csn-i5heen7s&ms=au%2Conr&mv=m&mvi=1&pl=24&initcwndbps=1948750&mime=video%2Fwebm&gir=yes&clen=314635&dur=20.091&lmt=1501671820684451&mt=1569708581&fvip=2&keepalive=yes&fexp=23842630&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRQIhAJmwcYUWljb1GoJfoWZ7z9AtUB5qx2RwX85EvdALzSg0AiA5gztEH8fEOKX3KEjt0I6LJB7uxIdiceqQ5l5JMmRztQ%3D%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIhANta1G8Y7zKyLrNMVYxt_iiMQ9NSFTw-LjK3UUexw5wEAiBO6x4bFa_4H_Hc2slFPKPP9O7K5xf71UVYnTHIeze4iQ%3D%3D&ratebypass=yes;!new_stream;!no_clip;!no_chapters;%814%https://r2---sn-c5ioiv45c-5goe.googlevideo.com/videoplayback?expire=1569730344&ei=yNqPXcGUIYroyQXAxqqoCw&ip=185.159.156.18&id=o-AIFcq4x0DshBJ_wt3FvFp4q-J_i_BVcTIG8gvTGafJ2i&itag=251&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-c5ioiv45c-5goe%2Csn-i5heen7s&ms=au%2Conr&mv=m&mvi=1&pl=24&initcwndbps=1948750&mime=audio%2Fwebm&gir=yes&clen=340363&dur=20.201&lmt=1501671719011165&mt=1569708581&fvip=2&keepalive=yes&fexp=23842630&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRgIhAMb8t36ldaM-3HwJMzPde5CIxTrOcTQVArDlDUppGOUBAiEAztgsnD69KJGkwjglU-wB8qH40t4LGXplNlAhGmnwDOE%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIhANta1G8Y7zKyLrNMVYxt_iiMQ9NSFTw-LjK3UUexw5wEAiBO6x4bFa_4H_Hc2slFPKPP9O7K5xf71UVYnTHIeze4iQ%3D%3D&ratebypass=yes;' -to 2.6587272727273 -map 0:0 -map 0:1 -c copy 'WINDOWS PATH\watch?v=qzdPTjk9aTg_1.mkv'
occivink commented 4 years ago

clipping should work, unfortunately stream support is moderately buggy at the moment, see #32

dardo82 commented 4 years ago

Clipping works for me,in its basic form... ;-) What was your mpv command @Kerobyte?

Kerobyte commented 4 years ago

@dardo82 It was just mpv https://www.youtube.com/watch?v=qzdPTjk9aTg Not sure what to try next.

Edit: Interestingly it works with Lachs0r's build but not Shinchiro's.

occivink commented 4 years ago

Yes, that's probably related to the fact that the youtube-dl handling changed at some point but hasn't been part of a release, so lachs0r's ~1 year old build is likely unaffected

dardo82 commented 4 years ago

I’ve also found something strange: the same command works with a video but doesn’t with another one.

occivink commented 4 years ago

It's not too surprising really, the edl:// format is specific to mpv, so ffmpeg doesn't understand it. According to the link you posted, it's only used in case of mp4 dash, which might not always be served by youtube. I think it would be easy to just split the edl:// paths manually and pass those to ffmpeg, I'm just not sure if this is the best solution. If you have links you would like me test on please post them

dardo82 commented 4 years ago

https://youtu.be/1TdlSi2tWmA