Author Topic: 2.7.5 64-bit having strange crash  (Read 906 times)

TCmullet

  • Full Member
  • ***
  • Posts: 140
2.7.5 64-bit having strange crash
« on: September 03, 2019, 06:56:32 PM »
and also 2.7.3 did it too (which is what made me come to discover and try the newest version 2.7.5).  Here's the relevant part of the error message which it gave before saving to crash file:

....at line 314, file F:/jenkins/workspace/VS2015_2.7.4_support/buildCore/ffmpeg/source/libavutil/imgutils.c

This also happened on 2.7.0 32-bit, but with a different content message.

Multiple video files are having this, but they are from a newly acquired source, so they may be a bit funky as a group.  I can save the whole file to a new file, but it's when scrubbing the timeline that this error happens at certain spots.  I have a little vague idea as to what's going on at the spots, but not fully clear.

TCmullet

  • Full Member
  • ***
  • Posts: 140
Re: 2.7.5 64-bit having strange crash
« Reply #1 on: September 03, 2019, 07:36:21 PM »
Though each file that has these problems is 2+ GB long, I managed, thanks to the newly discovered (by me) "go to time" feature, that I could cut it down to 10MB.  That's still too long to attach, but I can temporarily host it at my own webserver.

http://www.tomsgoodfiles.com/2019-08-24.TCMullet's.strange-crash-spot.mp4

I have SMPlayer, and it plays the whole file just fine.
« Last Edit: September 03, 2019, 07:49:58 PM by TCmullet »

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3406
Re: 2.7.5 64-bit having strange crash
« Reply #2 on: September 03, 2019, 08:13:40 PM »
Do these crashes stop if you switch from DXVA2 video output to a different one? I would expect this particular crash to occure when a demuxer provides wrong (too small) width for video.

Thank you for the sample, I'll look at it ASAP.

TCmullet

  • Full Member
  • ***
  • Posts: 140
Re: 2.7.5 64-bit having strange crash
« Reply #3 on: September 03, 2019, 08:39:50 PM »
I've never known about or turned on that DXVA2 option you spoke of.  (Just now found it, and it was off.  Maybe for normal usage, I should try turning it on.  Lots to learn, buried away in the bowels of Avidemux.)

This crash happens whenever there is a commercial break from the main program.  I included just one commercial break in my tiny sample.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3406
Re: 2.7.5 64-bit having strange crash
« Reply #4 on: September 03, 2019, 08:47:16 PM »
Do these crashes stop if you switch from DXVA2 video output to a different one?

No, they won't. It will be just a different assert failure. The debug output of ffplay shows what happens:

Code: [Select]
Reinit context to 1088x624, pix_fmt: yuv420p
Video frame changed from size:1280x720 format:yuv420p serial:1 to size:1088x612 format:yuv420p serial:1

The resolution of the video stream changes on-the-fly. Avidemux doesn't support this at all, but if such streams become somewhat popular, it will be necessary to implement some protections.

TCmullet

  • Full Member
  • ***
  • Posts: 140
Re: 2.7.5 64-bit having strange crash
« Reply #5 on: September 03, 2019, 09:19:45 PM »
Yuk (to the fact of the resolution changing on the fly)!  But I can tell you that it HAS become popular.  I don't need to save the bad-res parts (though Avidemux DOES save it), but I DO need to be able to cut it out.  PLEASE consider a way to fix this in the very near future!  PLEASE???   (I will p.m. you some further background.)

TCmullet

  • Full Member
  • ***
  • Posts: 140
Re: 2.7.5 64-bit having strange crash
« Reply #6 on: September 03, 2019, 10:06:19 PM »
OHHH, to make matters worse, the bad resolution footage is a DIFFERENT FRAMERATE!!!   DOUBLE YUKKK!

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3406
Re: 2.7.5 64-bit having strange crash
« Reply #7 on: September 03, 2019, 10:12:57 PM »
FPS switch is not very problematic, but the resulution switch is.

No easy solution for that. Avidemux would need to decode every SPS (sequence parameter set) unit in the stream to detect it, which is computationally very expensive (only decoding actual macroblocks of compressed video data is more expensive, but task can be offloaded to a HW accel). This would cost a lot of time. And when Avidemux detects a resolution switch, the only thing it could do now would be to refuse to load such a video.

TCmullet

  • Full Member
  • ***
  • Posts: 140
Re: 2.7.5 64-bit having strange crash
« Reply #8 on: September 03, 2019, 10:55:15 PM »
I single stepped forward toward the res-change point.  As expected, it went fine and showed each new frame beyond the last I frame as a P frame.  Then once I stepped on the first bad frame, it aborted with no recovery.  If I could only sit on the first bad frame (which presumably is an I frame), in-mark it, and then sit on the first good frame after the foreign ones, then I could out-mark it and delete.  But it crashes before I can tediously do that.

I believe if I went to the last good frame (which would be a P), go back to the prior I frame, counting the several frames between as "victims of war", then do something similar AFTER the bad segment, I suspect I could cut it out.   But that would be terribly time consuming as finding such start and end points requires going through multiple crashes with paper notes being written as we go, on each edit!

(I assume when you said "would cost a lot of time", you were referring to "computation time", not programming time.  (We do greatly appreciate all your programming time!)   Would this be more suited to a separate utility?  One who's goal would be to drop all GOPs that are not of the res of the video as a whole?  (And while we might be at it, have an extra switch to elect to drop any footage that is VFR!)

TCmullet

  • Full Member
  • ***
  • Posts: 140
Re: 2.7.5 64-bit having strange crash
« Reply #9 on: September 05, 2019, 12:58:01 AM »
Eumagga,

I have some good news; not perfect, but good.

1.  The videos coming into this are not ALWAYS bad (containing commercials with resolutions different from the main footage).  Some are not different, and some don't even have any commericials.

2.  (This is the big news.)  I found a software that can edit these out!  It turns out I already owned it; Replay Media Splitter from Applian.  It's part of the full suite I bought.  It is rather cumbersome to work with and I think has many bugs which I've been fortunate enough to trigger (ha, ha).  And it's slow, taking me maybe 3-5 times longer to remove commercials from a 2-hour (on average) program than if I was in Avidemux.  But it DOES seemlessly play, scrub and edit all footage NO MATTER what the resolution is!  I can mark my in-point right on the 1st frame of the offending commercial (probably as the last prior frame is probably a P frame, not a B frame), then mark the out-point at the first key frame after the program resumes.  It works like a champ!  (In spite of many problems, a slow learning/efficiency curve, and rather inadequate documentation.)  But it works!  Scrubbing is terribly slow, so I use SMPlayer to quickly find the points where the commercials are.

I do highly recommend the suite as a whole.  Though it has 8 programs and I've been using only 3 of them (not including my new 4th one, Replay Media Splitter), it's been well worth it to have the whole suite.   But their "splitter" (cutter) doesn't hold a candle to Avidemux, EXCEPT that it can handle those variable resolutions.

Is there a utility somewhere that can easily sweep through a video file and report to me what (and where) different resolutions appear?  This would greatly help me in assessing whether a file has the problem.  As it is now, I have to load it in Avidemux and scrub til it either blows up (with the stated error message) or goes to the end without the crash.  The time it takes to constantly go through blow-ups (which are NOT instant) is tedious, esp. as the percentage of files I deal with DO have the problem and I have a lot of files.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3406
Re: 2.7.5 64-bit having strange crash
« Reply #10 on: September 05, 2019, 03:39:25 PM »
I use

Code: [Select]
ffplay -debug pict /path/to/video/file 2>&1 | grep "Reinit context to"
and keep the right arrow key pressed for a while to fast-forward video to inspect a stream.

Well, this is not on Windows  :)

TCmullet

  • Full Member
  • ***
  • Posts: 140
Re: 2.7.5 64-bit having strange crash
« Reply #11 on: September 05, 2019, 05:18:06 PM »
I've resisted doing things at a command prompt because ffmpeg has so many parameters.  I'm hooked on GUIs (though from '79-'97 I was strictly a "command prompt" guy).

Are you saying my Windows command prompt will not allow me to do the ffmpeg command line that you gave?

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3406
Re: 2.7.5 64-bit having strange crash
« Reply #12 on: September 05, 2019, 05:31:31 PM »
I'm not saying it because I simply don't know.

Besides ffplay, the command needs grep to filter messages.

dosdan

  • Full Member
  • ***
  • Posts: 157
Re: 2.7.5 64-bit having strange crash
« Reply #13 on: September 05, 2019, 11:14:36 PM »
I've resisted doing things at a command prompt because ffmpeg has so many parameters.  I'm hooked on GUIs (though from '79-'97 I was strictly a "command prompt" guy).

Are you saying my Windows command prompt will not allow me to do the ffmpeg command line that you gave?

Windows does not have GREP, but it does have FIND.  I don't have a media file with this defect, so I took a general media file, looked at ffplay's output and then filtered for a certain substring (as an example):

ffplay -debug pict "JJ Cale After Midnight_both.mkv" 2>&1 | find /i "already done"
[AVFilterGraph @ 0000012c656a4c80] query_formats: 2 queried, 0 merged, 3 already done, 0 delayed
[AVFilterGraph @ 0000012c656a4500] query_formats: 2 queried, 0 merged, 3 already done, 0 delayed
[AVFilterGraph @ 0000012c656a4900] query_formats: 2 queried, 1 merged, 0 already done, 0 delayed


The "/i" switch ignores case. It's not needed here, but I used it just so you'd know about it.  If you don't have ffplay.exe, here's a w64 version I compiled 3 weeks ago: https://dl.dropbox.com/s/vl46yuxl06c1f6s/ffplay.exe

Dan.
« Last Edit: September 05, 2019, 11:43:53 PM by dosdan »

TCmullet

  • Full Member
  • ***
  • Posts: 140
Re: 2.7.5 64-bit having strange crash
« Reply #14 on: September 05, 2019, 11:52:26 PM »
Thanks, Dan.  I'm sure ffmpeg.exe is somewhere on my system(s).  I see that what you've put is a "find" utility.  But how am I supposed to know what to look for?  And were those 3 lines of yours just the first 3 lines of thousands that came out?