PyAV icon indicating copy to clipboard operation
PyAV copied to clipboard

Allow user to force audio codec to be used instead of relying the default one

Open Kazhuu opened this issue 5 years ago • 8 comments
trafficstars

Overview

Regarding this issue of mine earlier. Would it be possible to expose field AvFormatContext::audio_codec_id for user to force specific audio codec?

Existing FFmpeg API

Documentation of the field here.

Expected PyAV API

Maybe add this to av.open() to be optional argument.

Example:

av.open('alsa-device', format='alsa', audio_codec='pcm_s32le')

I could also take this one and make contribution to this awesome library if this is considered something needed in general. Any thoughts?

Kazhuu avatar Aug 28 '20 18:08 Kazhuu

Any news on the implementation of this?

paulhobbel avatar Apr 16 '21 12:04 paulhobbel

Sorry but I have been busy with so many other things and haven't have time/interest for this one at the moment. Maybe someone else can give this a go instead. I tried to start implementing this but then soon realized that there are so many available codecs that left me wondering should all them be implemented or just selected few.

Kazhuu avatar Apr 16 '21 15:04 Kazhuu

I'm currently trying out your solution but am failing to build PyAV on my raspberry pi. Do you have any tips on how I can build PyAV?

paulhobbel avatar Apr 19 '21 11:04 paulhobbel

I don't remember the steps out of my head but I think I was needing this package for one of my projects. I cloned it to my project and installed the package from there to my python virtual environment using pipenv install -e ext/PyAV. Then I just modified the sources in place. Of course you need to install Cython and other required packages to build the package. From readme the requirements are installed with pip install --upgrade -r tests/requirements.txt. Hope these helps.

Kazhuu avatar Apr 20 '21 02:04 Kazhuu

@paulhobbel I made a PR of this here if you are still interested of this.

Kazhuu avatar Sep 26 '21 16:09 Kazhuu

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Mar 27 '22 10:03 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jul 26 '22 03:07 github-actions[bot]

I've a holiday coming weeks I could take a look at this.

Kazhuu avatar Jul 26 '22 06:07 Kazhuu

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Nov 25 '22 02:11 github-actions[bot]

ping

Kazhuu avatar Nov 25 '22 07:11 Kazhuu

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Mar 27 '23 02:03 github-actions[bot]

Is this still valid?

Kazhuu avatar Apr 11 '23 03:04 Kazhuu