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

How to use "copy" for some audio, and transcode some others? #857

Open
tbarbette opened this issue Oct 16, 2024 · 0 comments
Open

How to use "copy" for some audio, and transcode some others? #857

tbarbette opened this issue Oct 16, 2024 · 0 comments

Comments

@tbarbette
Copy link

tbarbette commented Oct 16, 2024

Hi all,

I'm trying to re-encode only some of the audio tracks. My system support DTS and AC3, so I just need to re-encode the ones that are above that.

allstreams = ffmpeg.input(sys.argv[1])
# Select some of the streams through probe(), the following is a resulting example
stream_to_keep=['0:v', '0:a:0', '0:a:2']
ff = ffmpeg.output(*[allstreams[o] for o in stream_to_keep],filename=of+'-reenc.mkv', acodec="ac3")

The above will reencode all audio stream to ac3. But one of them is dts and can be copied without transcoding.

Any solution?

@tbarbette tbarbette changed the title How to use "copy" for some audio, and encode others? How to use "copy" for some audio, and transcode some others? Oct 16, 2024
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

No branches or pull requests

1 participant