Opened 14 months ago

#11670 new enhancement

Allow partial matching for audio input device names in DirectShow

Reported by: guest Owned by:
Priority: wish Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Currently, FFmpeg requires an exact match of the audio input device name when specifying an input device (e.g., with -f dshow -i audio="Device Name" on Windows). This can be inconvenient when device names are long or change slightly between systems.

Proposed Enhancement:
Introduce support for partial matching of device names, so users can provide a substring instead of the full, exact name.

For example:

ffmpeg -f dshow -i audio="microphone" ...

Implementation Suggestion:
In the code that matches input device names, the comparison currently uses strcmp in dshow.c

        if (pfilter) {
            if (strcmp(device_name, friendly_name) && strcmp(device_name, unique_name))
                goto fail;

This could be replaced with a substring match using strstr:

if (pfilter) {
    if (!strstr(friendly_name, device_name) && !strstr(unique_name, device_name))
        goto fail;
}

It might be worth considering implementing some form of case-insensitive comparison.

Thank you.

Change History (0)

Note: See TracTickets for help on using tickets.