Pretty cool! I'm curious as to why this is offered as a cloud machine and not something that runs locally. Wouldn't the encoding performance on a free or cheap cloud instance be poor? I create a lot of video compilations using twitch and youtube videos as source. My internet is 5Mbps down, 3Mbps up, so it can take hours to download long video streams and extract just the parts I want. Because of my network limitation…
> Because of my network limitation If I'm understanding correctly your snippet you're downloading the whole video anyway, no?
Show HN: Download videos, but only the parts you want
21–30 of 39 posts
Re: Show HN: Download videos, but only the parts you want
#22Re: Show HN: Download videos, but only the parts you want
#23Pretty cool! I'm curious as to why this is offered as a cloud machine and not something that runs locally. Wouldn't the encoding performance on a free or cheap cloud instance be poor? I create a lot of video compilations using twitch and youtube videos as source. My internet is 5Mbps down, 3Mbps up, so it can take hours to download long video streams and extract just the parts I want. Because of my network limitation…
> Because of my network limitation If I'm understanding correctly your snippet you're downloading the whole video anyway, no?
Re: Show HN: Download videos, but only the parts you want
#24Pretty cool! I'm curious as to why this is offered as a cloud machine and not something that runs locally. Wouldn't the encoding performance on a free or cheap cloud instance be poor? I create a lot of video compilations using twitch and youtube videos as source. My internet is 5Mbps down, 3Mbps up, so it can take hours to download long video streams and extract just the parts I want. Because of my network limitation…
if script is called "yt" usage is
echo https://www.youtube.com/watch?v=Qf2tplcb6eE |yt
echo https://www.youtube.com/watch?v=Qf2tplcb6eE |yt 22
echo https://www.youtube.com/watch?v=Qf2tplcb6eE |yt 22 00:15:34 00:16:09
x3(){ # youtube url variations, adjust as needed
sed '
/youtube.googleapis.com/{s//www.youtube.com/;s>/v/>/watch?v=>;};
s/youtu\.be./www.youtube.com\/watch?v=/;
s/embed./watch?v=/;s/&.*//;
';};
case $# in :)
;;0)
x3|(read x;curl -LHUser-Agent: -sv4 "$x"|grep -o "https://r[^\"]*"|sed 's/\\u0026/\&/g;s/%3D/=/g;s/%2C/,/g;s/%2F/\//g') >.yt;
grep -o "itag=[^&%]*" .yt||exec echo video removed;
exit
;;1)
x1=$(x3|sed 's/.*watch?v=//;s/[&%].*//')
x2=$(sed -n "/itag=$1/p" .yt)
esac;
test "${x1}"||exit;
case $# in :)
;;1) exec curl -LHUser-Agent: -sv4Ro "${x1}".mp4 "${x2}"
;;3) exec ffmpeg -ss $2 -to $3 -i "${x2}" -vf "crop=(iw*0.75):(ih*0.80):(iw*0.20):(ih*0.08)" "${x1}".mp4
esacRe: Show HN: Download videos, but only the parts you want
#25Pretty cool! I'm curious as to why this is offered as a cloud machine and not something that runs locally. Wouldn't the encoding performance on a free or cheap cloud instance be poor? I create a lot of video compilations using twitch and youtube videos as source. My internet is 5Mbps down, 3Mbps up, so it can take hours to download long video streams and extract just the parts I want. Because of my network limitation…
Re: Show HN: Download videos, but only the parts you want
#26Re: Show HN: Download videos, but only the parts you want
#27Earlier quoted context omitted.
> Because of my network limitation If I'm understanding correctly your snippet you're downloading the whole video anyway, no?
It looks kinda like that, but no. ‘youtube-dl -f best -g …’ returns a url, and ffmpeg seeks in the video stream and doesn’t download the whole thing.
Re: Show HN: Download videos, but only the parts you want
#28Re: Show HN: Download videos, but only the parts you want
#29Earlier quoted context omitted.
> Because of my network limitation If I'm understanding correctly your snippet you're downloading the whole video anyway, no?
I also see that, that syntax should not just download a slice: -f is for the format and -g should be simulation (-g for --get-url : 'Simulate, quiet but print title'). Probably an "undocumented" behaviour of '-g'?
Also, the costruct seems to accept input, at least sometimes, from e.g. '-f 137' (mp4 1080), so "very Hi-Res", and '-f 140' (m4a 128kbit), which can be then recombined. So, downloads higher than "720 rasterbars" are in general possible - and they are probably frequent real cases, when one needs to obtain a few frames of very high quality video.
The thing is, it seems to download the initial part anyway. The command takes a lot of time to download, and using e.g. 'iftop' one can see that the command starts downloading immediately, e.g. maybe ~5MB with a '-ss 00:00:10', and ~10MB with a '-ss 00:00:20': the use of '-tt range_end' or '-t duration' will stop downloading at the correct point, but the construct does not really "seek" to the starting point of the video.
Maybe adding some parameter to the URL?
Re: Show HN: Download videos, but only the parts you want
#30Pretty cool! I'm curious as to why this is offered as a cloud machine and not something that runs locally. Wouldn't the encoding performance on a free or cheap cloud instance be poor? I create a lot of video compilations using twitch and youtube videos as source. My internet is 5Mbps down, 3Mbps up, so it can take hours to download long video streams and extract just the parts I want. Because of my network limitation…
I made it open source so that anyone who wants to run it locally can do so, but maybe there’s a better way to do an easy to install local version?