Skip to content

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

Description

@milahu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions