-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GoPro MP4 videos are only analyzed for the first 18 frames #118
Comments
Video info from VLC Media Player, in case it helps: Codec: H264 - MPEG-4 AVC (part 10) (avc1) |
It might be an issue with the container - can you try re-muxing the videos with ffmpeg or mkvmerge and trying again? In the long term I want to add other backends like PyAV for video input, but this is still in progress. In the meantime the only way video input is supported is using OpenCV which sometimes leads to issues like this. You can re-mux the video with:
Failing that, you may need to re-encode them using ffmpeg before processing:
This one is strange since typically I would expect to see a warning: https://github.com/Breakthrough/DVR-Scan/blob/master/dvr_scan/scanner.py#L750 |
@Breakthrough i just tried your advice and indeed it works, thank you! After re-muxing the video with ffmpeg, dvr-scan is able to progress through all the frames in the new video file. I will use this as a workaround for now. Would you like me to keep this issue open until you attempt a fix in dvr-scan? |
@GabrielSandor to keep this issue open until you attempt a fix in dvr-scan, it would be great if you attach the sample GOpro files here. Developers might take that as a reference while fixing the issue in future |
Hello @abdullahfarwees. Due to privacy concerns, i'd rather not upload the particular GoPro files that cause the issue in dvr-scan. |
@GabrielSandor I don't think there's an easy workaround for this issue in DVR-Scan aside from using a different backend for video input as outlined above. That would be a fairly significant undertaking, so any additional detail you can provide would be very helpful. If you are unable to share the video, would you be willing to run the same video through a related program I maintain that has added support for this? The project is PySceneDetect (www.scenedetect.com) and can be downloaded/installed in the same way as DVR-Scan. Specifically, if you could run the following commands to include debug logs and provide them, that would let me know if using PyAV would work to fix the issue. First, using OpenCV, the output should also stop after 18 frames as in your original example:
Next using PyAV for video decoding:
Thanks! |
Sorry @Breakthrough, it's been a while since I recorded the video and I'm afraid I can no longer find it, and in the meantime my GoPro has broken. I plan to buy a new one at some point, and if the problem re-appears I'll get back to you. |
I ran dvr-scan with the default settings on some of my GoPro MP4 video files exported to my PC, and for some reason the analysis stops after 18 frames, even if the videos are more than 10 minutes long at 30 FPS and they do have some motion in them.
Command:
dvr-scan -i 2.mp4 --verbosity debug
Output:
INFO: controller._init_dvr_scan(): DVR-Scan v1.5.1
DEBUG: controller._init_dvr_scan(): User config file not found.
DEBUG: controller._init_dvr_scan(): Parsing program options.
INFO: scanner.init(): Initializing scan context...
INFO: video_joiner._load_input_videos(): Opened video 2.mp4 (1280 x 720 at 29.970 FPS).
DEBUG: scanner.scan_motion(): Using detector MOG2 with params: kernel_size = 5
INFO: scanner.scan_motion(): Scanning input video for motion events...
Detected: 0 | Progress: 0%|▏ | 18/18720 [00:00<03:04, 101.13 frames/s]
INFO: scanner._post_scan_motion(): Processed 18 frames read in 0.2 secs (avg 99.4 FPS).
INFO: scanner._post_scan_motion(): No motion events detected in input.
I would expect all frames in the videos to be analyzed.
Computing Environment:
The text was updated successfully, but these errors were encountered: