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

[Bug]: ffmpeg decoder not parsing and decoding all audio samples #2945

Closed
pfeatherstone opened this issue Apr 11, 2024 · 2 comments · Fixed by #2946
Closed

[Bug]: ffmpeg decoder not parsing and decoding all audio samples #2945

pfeatherstone opened this issue Apr 11, 2024 · 2 comments · Fixed by #2946

Comments

@pfeatherstone
Copy link
Contributor

What Operating System(s) are you seeing this problem on?

Linux (x86-64)

dlib version

master

Python version

No response

Compiler

gcc 12.3

Expected Behavior

I am comparing how many audio samples are decoded on a particular audio file with a particular codec, i.e. dlib/test/ffmpeg_data/116-288045-0000.flac using both the decoder object and the demuxer object. I can use the decoder in this instance since FLAC is a codec without a container.
I expect both to decode the same number of audio samples. They don't.

Current Behavior

They don't decode the same number of audio samples.

Steps to Reproduce

./buildExamples/Debug/ffmpeg_video_demuxing2_ex -i dlib/test/ffmpeg_data/116-288045-0000.flac
./buildExamples/Debug/ffmpeg_video_decoding2_ex -i dlib/test/ffmpeg_data/116-288045-0000.flac --codec flac

You get the following output:

Read 170400 audio samples

and

Read 139264 audio samples

Anything else?

I get this with FFmpeg version 6.1.1 and 4.4.2. So I imagine the bug is in the ffmpeg wrappers in dlib.

@pfeatherstone
Copy link
Contributor Author

I've tried the decode_audio.c example in the FFmpeg repository and I get a similar result. Maybe there is something funny with the AVCodecParserContext object and/or FLAC. Will investigate.

@pfeatherstone
Copy link
Contributor Author

Think i found the error. The example code in decode_audio.c in the FFmpeg repository is incorrect. They really need to update their own examples and check them. They get lazy with their own API... I'll submit a PR.

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

Successfully merging a pull request may close this issue.

1 participant