denseflow icon indicating copy to clipboard operation
denseflow copied to clipboard

cannot open video_path stream

Open dingli-dean opened this issue 4 years ago • 30 comments

cannot open video_path stream:/home/liding/project/temporal_action_detection/mmaction2/data/thumos14/videos/val/video_validation_0000033.mp4 cannot open video_path stream:/home/liding/project/temporal_action_detection/mmaction2/data/thumos14/videos/val/video_validation_0000592.mp4 cannot open video_path stream:/home/liding/project/temporal_action_detection/mmaction2/data/thumos14/videos/val/video_validation_0000230.mp4 cannot open video_path stream:/home/liding/project/temporal_action_detection/mmaction2/data/thumos14/videos/val/video_validation_0000395.mp4 cannot open video_path stream:/home/liding/project/temporal_action_detection/mmaction2/data/thumos14/videos/val/video_validation_0000238.mp4 Thanks for your great work. When running denseflow, I came across a bug like this, which results in error of openning video stream. Could you help me out? Thanks again.

dingli-dean avatar Feb 07 '21 12:02 dingli-dean

Does the file exist? What's the result of

ls -al /home/liding/project/temporal_action_detection/mmaction2/data/thumos14/videos/val/video_validation_0000033.mp4

and

ffprobe -i /home/liding/project/temporal_action_detection/mmaction2/data/thumos14/videos/val/video_validation_0000033.mp4?

innerlee avatar Feb 07 '21 16:02 innerlee

I meet the same problem when using docker. ls -al xxx shows:

-rwxrwxrwx 1 root root 389991 Feb 10 16:31 ../../../../data/kinetics400/videos_train/balloon_blowing/maymQ_gxL7w_000102_000112.mp4

and ffprobe -i xxx shows:

ffprobe version 3.4.8-0ubuntu0.2 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../../../../data/kinetics400/videos_train/balloon_blowing/maymQ_gxL7w_000102_000112.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.41.100
  Duration: 00:00:06.96, start: 0.000000, bitrate: 448 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 454x256, 315 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

Hanqer avatar Feb 11 '21 04:02 Hanqer

The video looks normal from the output of ffprobe. Could you pls attach this video for debugging purpose?

innerlee avatar Feb 11 '21 12:02 innerlee

hello, same problem when reading video. No matter build from your setup repo or from https://hub.docker.com/r/congee524/mmaction2

pandababyer avatar Apr 14 '21 06:04 pandababyer

The video looks normal from the output of ffprobe. Could you pls attach this video for debugging purpose?

innerlee avatar Apr 14 '21 09:04 innerlee

I guess the most suspicious reason is the data itself. So pls attach the problematic video, otherwise it is impossible to debug :)

innerlee avatar Apr 14 '21 11:04 innerlee

@innerlee it is a very normal video, like demo.mp4 in mmaction2/demo/demo.mp4 I reproduce the problem in the docker image provided by https://hub.docker.com/r/congee524/mmaction2. It is very strange like the pic below so I wonder is it the problem with opencv. Thx image

pandababyer avatar Apr 14 '21 11:04 pandababyer

Let me check

innerlee avatar Apr 14 '21 12:04 innerlee

I am having the same issue. The video seems normal from ffprobe. And can be used for other tasks such as extracting frames and audios.

protossw512 avatar Apr 23 '21 00:04 protossw512

I solved this issue by recompiling and installing opencv

protossw512 avatar Apr 23 '21 01:04 protossw512

@protossw512 hi, what do you mean by recompiling and installing opencv ? I tried with zzopencv.sh but still have the issue, can you tell me in more detail, thx!

pandababyer avatar Apr 23 '21 06:04 pandababyer

Please post the full compilation log of denseflow. It might used the wrong opencv lib

innerlee avatar Apr 23 '21 06:04 innerlee

@pandababyer You probably want to check which opencv you are using if you have multiple installations on your system.

protossw512 avatar Apr 23 '21 06:04 protossw512

@innerlee this is the full compilation log of denseflow image

pandababyer avatar Apr 23 '21 07:04 pandababyer

The log looks correct

innerlee avatar Apr 23 '21 08:04 innerlee

Problem solved. Recompiling and installing opencv with ffmpeg supported, the original setup shell may install opencv without ffmpeg because there are some dependencies uninstalled ,thx :)

pandababyer avatar Apr 23 '21 15:04 pandababyer

Great to hear that. Compilation are always troublesome. If I got some time later on, I will make the installation compilation free :D

innerlee avatar Apr 24 '21 01:04 innerlee

hello @innerlee , one more question: when I use the denseflow to extract rgb and flow frames, the rgb number is one more than x_flow and y_flow frames. It is very strange that using the extract_optical_flow shell from https://github.com/yjxiong/temporal-segment-networks.git get the result that rgb frame equal to flow frame number. Looking forward to your reply, thanks!

pandababyer avatar Apr 25 '21 07:04 pandababyer

n rgb frames have (n-1) flows. The decision is because we support any steps (even negative) between to frames. Say if you set step=-2, then you get (n-2) flows.

innerlee avatar Apr 25 '21 07:04 innerlee

Thanks for your quick reply and this is the same as I understand ! What I am not understand is why the original repo get the numbers equal :( Besides, the word in mmaction2 readme document below also let me misunderstanding that the rgb equal to flow image

pandababyer avatar Apr 25 '21 07:04 pandababyer

mismatch of frame counts

This is because using difference tools, such as ffmpeg/opencv, you might get different nubmer of total frame counts.

innerlee avatar Apr 25 '21 07:04 innerlee

@pandababyer How did you recompile & install it with FFmpeg supported? zzopencv.sh indeed has -DWITH_FFMPEG=ON \ and I supposed that the other dependencies which you say might not be installed are covered here?

Moreover, I can see from cv2.getBuildInformation() that FFmpeg is activated.

But it's not working for me so could you please show me what else did you do? Thanks!

rlleshi avatar May 06 '21 12:05 rlleshi

I made a dockerfile here https://github.com/open-mmlab/denseflow/tree/master/docker

innerlee avatar May 07 '21 01:05 innerlee

@rlleshi hello, -DWITH_FFMPEG=ON is an input option. please check your install log if the ffmpeg support is really on like this : image In my previous installation, it always show ffmpeg is off. There are some dependencies like libfreetype6-dev , libfontconfig1-dev , freetype-dev and so on I install by apt-get but I am not sure which is really matters :(

pandababyer avatar May 07 '21 02:05 pandababyer

I have same problem, and I find the reason is that the opencv verion provided in zzopencv.sh is too low(4.3.0), so downloading opencv 4.5.2 and recompiling opencv 4.5.2 and denseflow can solve this problem.

bimver avatar May 15 '21 01:05 bimver

I have same problem, and I find the reason is that the opencv verion provided in zzopencv.sh is too low(4.3.0), so downloading opencv 4.5.2 and recompiling opencv 4.5.2 and denseflow can solve this problem.

Hi bimver, I have tried to recompile opencv 4.5.2, but it doesn't work.

guuzaa avatar May 26 '21 03:05 guuzaa

Hi everyone, I have compiled opencv 4.5.2/4.3 many times, but I always encounter the below problem. So, how can I solve it? If you have any ideas, please tell me. Thanks:) bug

guuzaa avatar May 27 '21 02:05 guuzaa

install libtiff?

innerlee avatar May 27 '21 04:05 innerlee

install libtiff?

Very thanks @innerlee , I will check it :)

guuzaa avatar Jun 01 '21 11:06 guuzaa