

That means that 1 out of every 4 people on earth is a YouTube user. Part(url, time.strftime('%H:%M:%S', time.gmtime(int(i*interval))), "00:00:01", title+"-"+str(id), quality, i)ĭef part(url, starttime, duration, name, quality, i):į = os.popen("ffmpeg $(youtube-dl -f "+quality+" -g '"+url+"' | sed 's/.*/-ss "+starttime+" -i &/') -t "+duration+" -c:v libx264 "+name+".mp4")į = os.popen("ffmpeg -i "+name+".mp4 -ss 00:00:00 -vframes 1 "+name+"_"+str(i)+".YouTube has become such an online juggernaut that it presently counts more than 2.1 billion users worldwide, which is approximately 26% of the entire world population today!

So this is the final solution i found: def screenshotvideo(url, interval, id, fullduration, title, quality): The answer is close to szatmary answer but i need to download video in mp4 format, so all i neet to do is to edit the first command ffmpeg $(youtube-dl -f "+quality+" -g '"+url+"' | sed 's/.*/-ss "+starttime+" -i &/') -t "+duration+" -c:v libx264 "+name+".mp4Īfter that i got other error for the images file name that i want to saved each time from the video. Could not find tag for codec vp8 in stream #0, codec not currently supported in container.Ĭould not write header for output file #0 (incorrect codec parameters ?): Invalid argument

So i got the folowing error in the first ffmpeg command Iterat=int(durationseconds/int(interval)) Parsed_t = isodate.parse_duration(fullduration) Screenshotvideo def screenshotvideo(url, interval, id, fullduration, title, quality): I created a script to download a youtube video and extract an images from it for each period
