[FFmpeg-user] How to check if a youtube URL is valid before starting download?
Bo Berglund
bo.berglund at gmail.com
Wed Jul 7 15:43:27 EEST 2021
On Wed, 07 Jul 2021 14:21:15 +0200, Bo Berglund <bo.berglund at gmail.com> wrote:
>But whenever the video is stalled and just continuously displays one single image
>for minutes on end the test above does not detect it.
>So is there a way to check if a video is static and generate an error in that
>case?
>Something like:
>ffmpeg -i input_url -checkstaticvideo <maxstatictime>
>
>Is this possible?
Follow-up:
I found the following documentation for freezedetect:
https://ffmpeg.org/ffmpeg-all.html#freezedetect
However there is no example for using it and when I try it on a stalled Youtube
video like this I get a result I cannot interpret (on Ubuntu 18):
$ ffmpeg -i https://youtu.be/sAt6nY2BWNw -f freezedetect -d 5 -n 0.01
ffmpeg version 4.3.2-0york0~18.04 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version='0york0~18.04'
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-gnutls --enable-ladspa --enable-libaom --enable-libass
--enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio
--enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype
--enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack
--enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg
--enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr
--enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2
--enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx
--enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libzimg
--enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
https://youtu.be/sAt6nY2BWNw: Invalid data found when processing input
Lacking an example I cannot proceed....
What I want is for ffmpeg to check the video and if it is frozen exit with
result 1 and if the video is not frozen exit with result 0.
What should be the correct call syntax?
The test should be done for a time of say 5 seconds and if the video is the same
for that time it should exit with code 1 whereas if it is not stalled exit with
code 0. So it can be utilized in a script.
--
Bo Berglund
Developer in Sweden
More information about the ffmpeg-user
mailing list