MerlinCooper / iRacingReplayDirector

Application to automatically create highlight videos from iRacing Replay files
GNU General Public License v3.0
39 stars 5 forks source link

Index was outside the bounds of the array exception in MediaFoundation.Net #101

Closed pugwonk closed 1 year ago

pugwonk commented 1 year ago

I've got a crash when running "Verify Video Capture". I downloaded the source but that didn't help me much as the crash is in MediaFoundation.Net. I did try to get the source for that too but I got terribly confused about the relationship between SuperMFLib and MediaFoundation.Net and couldn't get them to compile.

I am happy to run this in debug if someone can give me a hand with the dependencies!

Stack trace is below:

Frame Rate: 60, Frame Size: 2560x1440, Video: H264 @ 52Mbs, Audio: AAC, 48Khz @ 12Kbs, 
Begining video re-encoding.
Index was outside the bounds of the array.
   at MediaFoundation.Net.SourceReader.<Samples>d__4.MoveNext()
   at MediaFoundation.Net.SourceReader.Samples(ProcessSample samplesFn, Int32 streamIndex, Int32 controlFlags)
   at MediaFoundation.Net.SourceReader.Samples(ProcessSample samplesFn)
   at iRacingReplayDirector.TestVideoCapture.<>c.<TranscodeVideoTest>b__10_0(IEnumerable`1 readers, ProcessSample saveToSink)
   at iRacingReplayDirector.Phases.Transcoding.Transcoder.ProcessVideo(Action`2 process)
   at iRacingReplayDirector.TestVideoCapture.TranscodeVideoTest(String filename)
   at iRacingReplayDirector.TestVideoCapture.RunTest(String workingFolder, SynchronizationContext context)
MerlinCooper commented 1 year ago

Could you provide a. Screenshot of the about dialog and the log file generated? The replay file used when running ‚verify video captured´ would be good as well.

the structure / dependencies are indeed complicated. I thin at the time the application was generated some features like video encoding where not supported so well and that‘s why the originator used a combination of class-libraries.

pugwonk commented 1 year ago

Here you are! The replay file is nearly 1gb so I've put it here.

image

image

pugwonk commented 1 year ago

For what it's worth, I just tried this on another replay file and got the same error.

MerlinCooper commented 1 year ago

Can't really reproduce the issue - did with the provided replay file two short videos. One using the "Fast-Video-Recording" and the other with "Encode Video After Capture".

Here are the generated mp4 files and replay-scripts: https://1drv.ms/f/s!Ato3RDRX7tvH4lWwENCwaDessJsE?e=nw1Njc

Would you mind sharing your settings? You can find the files named "iracing-replay-director.settings" and "iracing-application-version-manager.settings" in your documents folder. Or you just try my settings. Added your name to the list of preferred drivers for testing.

Settings_in_Documents_folder.zip

Another potential root cause could be the file format/settings you are using in your recording software. Not all formats are supported - that's a limitation during transcoding. These are the settings I am using in OBS. grafik

pugwonk commented 1 year ago

Bingo - you hit the nail on the head. I am using the NVidia capture tool, but I had it set to record the mic and system audio into two separate tracks. For anyone else who experiences this error, make sure you have this setting selected in the GeForce options!

image

MerlinCooper commented 1 year ago

Closing the issue - was related to settings of recording software