open-mmlab / denseflow

Extracting optical flow and frames
https://open-mmlab.github.io/
MIT License
298 stars 60 forks source link

cannot open video_path stream #34

Open dingli-dean opened 3 years ago

dingli-dean commented 3 years ago

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.

innerlee commented 3 years ago

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?

Hanqer commented 3 years ago

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
innerlee commented 3 years ago

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

pandababyer commented 3 years ago

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

innerlee commented 3 years ago

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

innerlee commented 3 years ago

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

pandababyer commented 3 years ago

@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

innerlee commented 3 years ago

Let me check

protossw512 commented 3 years ago

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 commented 3 years ago

I solved this issue by recompiling and installing opencv

pandababyer commented 3 years ago

@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!

innerlee commented 3 years ago

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

protossw512 commented 3 years ago

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

pandababyer commented 3 years ago

@innerlee this is the full compilation log of denseflow image

innerlee commented 3 years ago

The log looks correct

pandababyer commented 3 years ago

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 :)

innerlee commented 3 years ago

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

pandababyer commented 3 years ago

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!

innerlee commented 3 years ago

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.

pandababyer commented 3 years ago

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

innerlee commented 3 years ago

mismatch of frame counts

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

rlleshi commented 3 years ago

@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!

innerlee commented 3 years ago

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

pandababyer commented 3 years ago

@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 :(

bimver commented 3 years ago

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.

guuzaa commented 3 years ago

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 commented 3 years ago

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

innerlee commented 3 years ago

install libtiff?

guuzaa commented 3 years ago

install libtiff?

Very thanks @innerlee , I will check it :)

AlbertHuyb commented 2 months ago

freetype-dev

These libraries could be helpful: libavformat-dev libavcodec-dev libswscale-dev

https://stackoverflow.com/questions/69029560/when-i-build-opencv-it-does-not-recognise-my-installed-ffmpeg