soCzech/TransNetV2

ffmpeg._run.Error

Closed this issue · 6 comments

Traceback (most recent call last):
  File "/home/tom/projects/Studium/Studienarbeit/cutting/TransNetV2/inference/transnetv2.py", line 193, in <module>
    main()
  File "/home/tom/projects/Studium/Studienarbeit/cutting/TransNetV2/inference/transnetv2.py", line 173, in main
    model.predict_video(file)
  File "/home/tom/projects/Studium/Studienarbeit/cutting/TransNetV2/inference/transnetv2.py", line 83, in predict_video
    video_stream, err = ffmpeg.input(video_fn).output(
  File "/home/tom/projects/Studium/Studienarbeit/cutting/env/lib/python3.9/site-packages/ffmpeg/_run.py", line 325, in run
    raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

I get a ffmpeg error when I run the following command:

python transnetv2.py /mnt/e/Studium/Studienarbeit/Videos/2021/reg/17/c597512d-b37c-11eb-ba8a-ecb6fe06b3b0/highlightsVideo/video/video.mp4 [--visualize]

Thats my ffmpeg:

ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --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-avisynth --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-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --

enable-libspeex --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-libdc1394 --enable-libdrm --enable-

libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared


Is there any problem with my ffmpeg build?

也许有帮助:
提醒:安装完ffmpeg-python(包)之外,还需要额外单独安装ffmpeg

apt-get update
apt-get install -y --no-install-recommends ffmpeg

Is the problem solved?

This problem has nothing to do with Transnet. The issue is either incorrect installation of ffmpeg or broken video file. See output of the ffmpeg to diagnose the error.

Hey! Make sure that you write the correct name of the video that you are inferencing! For example, in the following case is test_video.mp4. It turns out that the output error is the same as the one mentioned above.

docker run -it --rm --gpus 1 -v /home/ubuntu/videos:/tmp transnet transnetv2_predict /tmp/test_video.mp4 --visualize

The command should not contain the"[]" when you need --visualize

Can you please tell me which version of ffmpeg I need to download?