Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.09k stars 1.51k forks source link

OSError: MoviePy error: failed to read the duration of file https://(...) #2073

Closed ted-mundy closed 7 months ago

ted-mundy commented 7 months ago

Expected Behavior

The videoclip should work fine, as is the case on my local Macbook Air M1 2020, however on my server (Docker container running Debian, it returns the following error:

Actual Behavior

OSError: MoviePy error: failed to read the duration of filehttps://rr1---sn-cu-ac5e.googlevideo.com/videoplayback?expire=1701305768&ei=SIlnZdv5GoTIxwKilIyABA&ip=IPADDRESS&id=o-AKQNw9PL6e9QDBY5oUW4jEbHAYYBqnsgwXzldj4KzQ6L&itag=22&source=youtube&requiressl=yes&mh=7c&mm=31%2C29&mn=sn-cu-ac5e%2Csn-cu-auod&ms=au%2Crdu&mv=m&mvi=1&pcm2cms=yes&pl=25&initcwndbps=1643750&spc=UWF9fzHaGt2Qm3-H0b4XfLp6SZs_nC8&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=212.091&lmt=1700178006158324&mt=1701283746&fvip=2&fexp=24007246&c=ANDROID&txp=4532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=ANLwegAwRQIhANPPWnPEoYBmO163uYHZ1flQO2yIdeO8Oyk13r6WYHC0AiAEAUPEfKrZ60XVfKXwdjkSUSyLh4I_JIuCY10kMFfhqw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=AM8Gb2swRQIgL2KGa-D4-YfdsZAUkHqMASuvw_X_Ya64ObqLsCG9K5gCIQDNvZgdg7ij5oC22yjb0a1mhoY4Nxnlbiv9sq2TJ24wAg%3D%3D.
worker-1  | Here are the file infos returned by ffmpeg:
worker-1  | ffmpeg version 6.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2023 the FFmpeg developers
worker-1  |   built with gcc 8 (Debian 8.3.0-6)
worker-1  |   configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
worker-1  |   libavutil      58. 29.100 / 58. 29.100
worker-1  |   libavcodec     60. 31.102 / 60. 31.102
worker-1  |   libavformat    60. 16.100 / 60. 16.100
worker-1  |   libavdevice    60.  3.100 / 60.  3.100
worker-1  |   libavfilter     9. 12.100 /  9. 12.100
worker-1  |   libswscale      7.  5.100 /  7.  5.100
worker-1  |   libswresample   4. 12.100 /  4. 12.100
worker-1  |   libpostproc    57.  3.100 / 57.  3.100
(this is it - no other logs are shown)

Steps to Reproduce the Problem

from moviepy import *

RICKROLL_URL = r"https://rr1---sn-cu-ac5e.googlevideo.com/videoplayback?expire=1701305768&ei=SIlnZdv5GoTIxwKilIyABA&ip=IPADDRESS&id=o-AKQNw9PL6e9QDBY5oUW4jEbHAYYBqnsgwXzldj4KzQ6L&itag=22&source=youtube&requiressl=yes&mh=7c&mm=31%2C29&mn=sn-cu-ac5e%2Csn-cu-auod&ms=au%2Crdu&mv=m&mvi=1&pcm2cms=yes&pl=25&initcwndbps=1643750&spc=UWF9fzHaGt2Qm3-H0b4XfLp6SZs_nC8&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=212.091&lmt=1700178006158324&mt=1701283746&fvip=2&fexp=24007246&c=ANDROID&txp=4532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=ANLwegAwRQIhANPPWnPEoYBmO163uYHZ1flQO2yIdeO8Oyk13r6WYHC0AiAEAUPEfKrZ60XVfKXwdjkSUSyLh4I_JIuCY10kMFfhqw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=AM8Gb2swRQIgL2KGa-D4-YfdsZAUkHqMASuvw_X_Ya64ObqLsCG9K5gCIQDNvZgdg7ij5oC22yjb0a1mhoY4Nxnlbiv9sq2TJ24wAg%3D%3D"

clip = VideoFileClip(RICKROLL_URL)

Specifications

Any help would be massively appreciated, thanks guys. Please don't hesitate to ask for more info

ted-mundy commented 7 months ago

closing - i needed to escape the input