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

Fix "Received a packet for an attachment stream" error when encoding certain files. #841

Merged
merged 3 commits into from
May 17, 2024

Conversation

0xBA5E64
Copy link
Contributor

I ran into an issue encoding certain mkv-files with multiple audio, subtitle and attachments, and managed to track down the issue to the way Av1an handles encoding audio; There's a lot of mapping weirdness done in ffmpeg.rs's encode_audio function:

encode_audio.args(["-y", "-hide_banner", "-loglevel", "error", "-i"]);
encode_audio.arg(input);
encode_audio.args([
"-map_metadata",
"0",
"-vn",
"-dn",
"-map",
"0",
"-map",
"-0:a",
"-c",
"copy",
"-map",
"0:a",
]);
encode_audio.args(audio_params);
encode_audio.arg(&audio_file);

-that ends up giving me the following error when encoding, right after Scene detection:

[matroska @ 0x560b67fa86c0] Received a packet for an attachment stream.
[aost#0:6/copy @ 0x560b67ba16c0] Error submitting a packet to the muxer: Invalid argument
[out#0/matroska @ 0x560b67b935c0] Error muxing a packet

As such, I've trimmed out many of the repeated mapping-statements to streamline the parameters. I don't know if there was a particular reason this was done the way it was before, but as far as I can tell, this works just the same way without any of the odd errors I've been encountering.

Copy link
Collaborator

@shssoichiro shssoichiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me, thanks

@shssoichiro shssoichiro merged commit 4ebdcd0 into master-of-zen:master May 17, 2024
5 checks passed
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 this pull request may close these issues.

2 participants