-
Notifications
You must be signed in to change notification settings - Fork 52
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
Scan stops after 15 / 45 frames for Gopro 7 videos (both AVC and HEVC in .mp4) #62
Comments
I'm not sure why the video is like that, but by remuxing it with
And running DVR-Scan on Thank you! |
Sorry I totally overlooked that you already mentioned this worked - I was able to narrow this down to how OpenCV's VideoCapture processes the video though. It seems to work fine with PyAV. This should be improved once DVR-Scan has better integration with PySceneDetect. Specifically take a look at: In the meantime I'll try to have a further look with ffprobe to see if anything else jumps out. I don't have a Gopro myself so cannot test on my end, but if you have any other samples or any other info that would be helpful. Does it happen with all videos? Just ones under a certain length? What other options can you configure in the camera besides h264/h265? (Is there a keyframe interval?) I did notice decoding the video with PyAV works, although there is a long run at ~frame 60 without any video frames in the encoded video. Not sure why that is just yet, still investigating. Thanks! |
Hey, thanks for having a look. There aren't many options regarding encoding in camera, only a AVC/HEVC toggle. I can also change between PAL/NTSC but I don't think framerate matters. |
One interesting thing I just noticed, the 45 frames it shows to succesfully read are actually processed and if there's motion it creates an output video. Hmm, well I recorded some tests with random settings and found some weird results: ffprobe still shows same unsupported codec warning for the extra streams even for the short videos that sucesfully get scanned. |
Hmm I see, thanks for the feedback and the sample. I'll see if I can come up with a workaround using OpenCV alone, because if not then it might be worth filing a bug with them as well. I'm sure it would be worth trying to replicate the issue in C++ and seeing if it's possible to get additional logging statements to be printed from ffmpeg in debug mode (unfortunately I don't have the capacity right now or I would try this myself). I will leave this open until this has been fixed in DVR-Scan, and hopefully in the meantime I can see why OpenCV stops processing the video as a workaround. Thanks for the report. |
@dany123 Sorry I seem to have misplaced the original file you sent, and the link has expired. Would you be able to upload it again? You can now attach files directly to Github issues in comments, so if possible, if you could attach it directly to this issue, that would be great. Thank you! |
It seems there's a 10MB limit for attaching files and the video is 15MB, I'll reupload to wetransfer: https://we.tl/t-uuD5Dg3oTK |
Interesting, so it seems that the 45th frame fails to be read by OpenCV. DVR-Scan interprets this as the end of the video and thus quits. I think this is also a bug in PySceneDetect as well which could explain some issues there too, so thank you for the sample. I'll have to update the scanning logic to allow some dropped frames, after which emitting a warning indicating the issue (and that the video should be remux'd). I still have to run both copies through ffmpeg, since now I'm curious if it correctly decodes that frame after running it through If the latter then it implies some kind of corruption/missing data rather than something that can be fixed. Edit: Seems to be no difference when I extract all of the frames using ffmpeg before/after remuxing, so it seems this only fails with OpenCV currently. Thus I'll be recommending the workaround you suggested to just use |
Found when implementing fix for #62.
Now, we allow up to 5 frames to fail decoding in a row (just a value I thought would be reasonable for most purposes). This allows the video you posted to be processed as-is. Since this can potentially lead to some issues if this happens too frequently, if any more than 1 frame fails to decode throughout the video, the following message will now be displayed including the number of frames that failed to decode:
Fix will be included in v1.4, thanks for the report. |
One last question for you @dany123 - would it be alright to include this file in both DVR-Scan and PySceneDetect's test cases? I would like to use this as an example and distribute it with the project if possible. Thank you! |
Sure, I have no problem with that. Thank you for the fix! |
Thanks @dany123 for providing the video.
Having this issue with GoPro4 videos. Videos are 12 minutes long but only the first 11 frames are processed: `[DVR-Scan] DVR-Scan v1.5.1
|
INFO: controller._init_dvr_scan(): DVR-Scan v1.5.1
|
@frankpatrick try processing the video using ffmpeg or mkvmerge first to re-mux the container. |
I just found out yesterday about this awesome tool and manged to scan some hours of video from my camera, but I've noticed that any clip from my gopro fails "succesfully" after either 15 or 45 frames (I think it depends on original video framerate) and I'm trying to figure out why.
If I use handbrake to convert the video (or even ffmpeg to trim with -c copy) the scan works as expected. Also tried with both H264 and H265 (in camera) and short/long videos and it also fails in ~1 second.
I recorded a 10s sample if anyone wants to check it out: https://we.tl/t-p95xvJWT5u
Any idea how to debug this?
Mediainfo:
The text was updated successfully, but these errors were encountered: