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

Stream copy from template #732

Open
wants to merge 4 commits into
base: develop
from

Conversation

@alexhutnik
Copy link

@alexhutnik alexhutnik commented Jan 6, 2021

Addresses issue #730 and #507. When adding a stream via a template, look up the encoder via the template codec's id, consistent with Transcoding.c in the ffmpeg source: https://github.com/FFmpeg/FFmpeg/blob/66deab3a2609aa9462709c82be5d4efbb6af2a08/doc/examples/transcoding.c#L149

@alexhutnik alexhutnik changed the base branch from main to develop Jan 7, 2021
@alexhutnik
Copy link
Author

@alexhutnik alexhutnik commented Jan 7, 2021

Somehow this broke regular remuxing and I didn't catch it before the PR. Not ready to merge.

@alexhutnik
Copy link
Author

@alexhutnik alexhutnik commented Jan 8, 2021

There seems to be something that causes a packet to be owned by the AVCodecContext that demux'd it. When you try to mux it using a different AVCodecContext, it silently fails to write anything. So you can either copy the context as originally done, or you can construct a new one, which requires one to decode / re-encode, even if the packet is never modified. I've added a remux argument to the add_stream method to pick which behavior to go with. I'll leave this PR open for now.

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

Successfully merging this pull request may close these issues.

None yet

1 participant