[FFmpeg-devel] [PATCH 10/35] fftools: provide media type info for devices

Diederick C. Niehorster dcnieho at gmail.com
Wed Jun 9 21:08:59 EEST 2021


On Wed, Jun 9, 2021 at 1:15 PM Nicolas George <george at nsup.org> wrote:
>
> What matters is not what you see in the console but what data is really
> written on the stream. Programs that read from the ffmpeg process and
> use the output to build a command line, all in a binary-clean way,
> should succeed.
>
> You can test with Perl (you can probably achieve the same with any
> language, but I know Perl, and I know it will not automagically mess
> things up):
>
> my $out = `ffmpeg -devices`;
> my $dev = $out =~ /(Microphone.*)/;
> print "Using \"$dev\"\n";
> system "ffmpeg", "-f", "dshow", "-i", $dev;
>
> If the “Using "..."” message is mangled but the command line succeeds,
> then the issue is not ffmpeg's problem.

I don't know perl well, but after modifying the program a bit i got it
to capture the device name and call ffmpeg with it:
my $out = `ffmpeg -sources dshow`;
($dev) = ( $out =~ /(Microphone.*) \[/);
print "Using \"$dev\"\n";
system "ffmpeg", "-f", "dshow", "-i", "audio=\"$dev\"";

The regex looks the way it does because the full output line is:
"Microphone Array (Intel® Smart Sound Technology (Intel® SST))
[@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{A6F097A2-0BFA-4F4C-BF22-D4531781DA10}]
(audio)"

Running that perl script, i get the following output (skipping ffmpeg header):
Using "Microphone Array (Intel® Smart Sound Technology (Intel® SST))"
[dshow @ 000001B93364A7C0] Could not find audio only device with name
[Microphone Array (Intel® Smart Sound Technology (Intel® SST))]
among source devices of type audio.
[dshow @ 000001B93364A7C0] Searching for audio device within video
devices for Microphone Array (Intel® Smart Sound Technology (Intel®
SST))
[dshow @ 000001B93364A7C0] Could not find audio only device with name
[Microphone Array (Intel® Smart Sound Technology (Intel® SST))]
among source devices of type video.
audio=Microphone Array (Intel® Smart Sound Technology (Intel® SST)): I/O error

So something isn't going quite right there. To be sure, running
ffmpeg -f dshow -i audio="Microphone Array (Intel® Smart Sound
Technology (Intel® SST))"
directly from cmd does work.

Did i make a perl error, or is there an ffmpeg problem?

Thanks,
Dee


More information about the ffmpeg-devel mailing list