Skip to content
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

AC3 sound sample error #189

Open
emveepee opened this issue May 20, 2022 · 4 comments
Open

AC3 sound sample error #189

emveepee opened this issue May 20, 2022 · 4 comments
Labels

Comments

@emveepee
Copy link

emveepee commented May 20, 2022

Describe the bug
An AC3 sample recordings crashes the app with no recovery

To Reproduce
Use the ts file in this for the source to QueryCommandBuilder

crash.zip

Expected behavior
ffmpeg can transcode the sample to wav mp3 etc. Even if the app can't handle it a try/catch loop should be possible.

Screenshots

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at FFmpeg.AutoGen.ffmpeg.swr_convert(FFmpeg.AutoGen.SwrContext*, Byte**, Int32, Byte**, Int32)
   at SoundFingerprinting.Emy.FFmpeg.Audio.AudioConverter.ConvertAndStore(FFmpeg.AutoGen.AVFrame*)
   at SoundFingerprinting.Emy.FFmpeg.Audio.AudioConverter.Convert(FFmpeg.AutoGen.AVFrame*)
   at SoundFingerprinting.Emy.AudioVideo.Data.FFmpegDataService+<>c__DisplayClass7_1.<CreateAudioConverters>b__1(System.Object, SoundFingerprinting.Emy.FFmpeg.Common.FrameEventArgs)
   at SoundFingerprinting.Emy.FFmpeg.Decoder.OnDecoded(FFmpeg.AutoGen.AVFrame*)
   at SoundFingerprinting.Emy.FFmpeg.Decoder.Decode(FFmpeg.AutoGen.AVPacket*)
   at SoundFingerprinting.Emy.FFmpeg.Demuxer.Demux(Double)
   at SoundFingerprinting.Emy.AudioVideo.Data.FFmpegDataService+<ReadAVTrack>d__4.MoveNext()
   at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at System.Linq.Enumerable.ToList[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at SoundFingerprinting.Emy.AudioVideo.Data.FFmpegDataService.ReadTrack(System.String, SoundFingerprinting.Data.MediaType, Double, SoundFingerprinting.Media.AVTrackReadConfiguration)
   at SoundFingerprinting.Emy.FFmpegAudioService.ReadAVTrackFromFile(System.String, SoundFingerprinting.Media.AVTrackReadConfiguration, Double, Double, SoundFingerprinting.Data.MediaType)
   at SoundFingerprinting.Emy.FFmpegAudioService.GetAudioTrack(System.String, Int32, Double)
   at SoundFingerprinting.Emy.FFmpegAudioService.ReadMonoSamplesFromFile(System.String, Int32, Double, Double)
   at SoundFingerprinting.Command.FingerprintCommand+<>c__DisplayClass13_0.<From>b__0()
   at System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].InnerInvoke()
   at System.Threading.Tasks.Task+<>c.<.cctor>b__272_0(System.Object)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
   at System.Threading.Tasks.Task.ExecuteEntryUnsafe(System.Threading.Thread)
   at System.Threading.Tasks.Task.ExecuteFromThreadPool(System.Threading.Thread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

**Desktop (please complete the following information):**
 - Windows 11 console app

@AddictedCS
Copy link
Owner

Which version of ffmpeg are you using?

@emveepee
Copy link
Author

Which version of ffmpeg are you using?

I tried various versions in the path but right now FFmpeg\bin\x64 is the suggested version https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-4.4.1-full_build-shared.7z

@AddictedCS AddictedCS added the bug label May 24, 2022
@AddictedCS
Copy link
Owner

I've tested it and indeed for the AC3 file it generates a AccessViolationException. I'm not quite sure why that's happening for this particular file. As of now I would suggest converting it to mp3 and feeding the library - I've tested it and it works as expected.

@emveepee
Copy link
Author

Yes I tested that before and that works, but the solution doesn't work when processing a directory of files because I can't trap the error and the application aborts which is my major concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants