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

Requested output format 'mka' is not known. - audalign.target_align with destination_path #58

Open
milahu opened this issue May 17, 2024 · 2 comments

Comments

@milahu
Copy link

milahu commented May 17, 2024

this error appears when i run audalign.target_align on mka files
with destination_path != None

import audalign

# mka files in todo-align-files/*.mka
audalign.target_align(
    "target.mka",
    "todo-align-files",
    destination_path="audalign-result"
)

problem: audalign calls AudioSegment.export with format = "mka"
but mka is the file extension, and the ffmpeg format is matroska

pydub/audio_segment.py

class AudioSegment(object):
    # ...
    def export(self, out_f=None, format='mp3', codec=None, bitrate=None, parameters=None, tags=None, id3v2_version='4',
               cover=None):

related upstream issue jiaaro/pydub#755
same problem with m4a extension, the ffmpeg format is ipod

Requested output format 'm4a' is not a suitable output format

related upstream PR jiaaro/pydub#793
this would allow us to pass out_f="out.mka" and let ffmpeg guess format from extension
problem is, pydub is unmaintained jiaaro/pydub#389 jiaaro/pydub#444

so...
we could use ffprobe to get the format name

$ ffprobe -loglevel error -show_entries format=format_name -of default=nw=1:nk=1 src.mka
matroska,webm
@benfmiller
Copy link
Owner

Thank you for this bug report as well!

It looks like something like https://github.com/PyAV-Org/PyAV could be used to get the mappings supported by ffmpeg? Trying not to bring in another dependency

Or would it be preferable to add a configuration setting to define preferred formats per file extension along with defaults?

@milahu
Copy link
Author

milahu commented Jun 3, 2024

preferred formats per file extension

mkv and mka containers can contain any codec...

by default, it should preserve container and codec of the input
if that is ambiguous (different input files)
then just pick the first, or let the user set a codec

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

2 participants