In case of future deprecation, a backup of audio routing script shared for public servicing.

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

In case of future deprecation, a backup of audio routing script shared for public servicing.

Sound Yuan
Hi everyone,

I'm an amateurish sound artist and my personal English alias is Thomas. New
and nice to be with you.

Let us get to know my purpose here with one line of Windows script created
on my own:

ffmpeg -f dshow -rtbufsize 4 -i audio="Line 1 (Virtual Audio Cable)" -f
> dshow -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -f dshow
> -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -filter_complex
> "[0:a][1:a][2:a]amerge=inputs=3[a]" -map "[a]" -ar 48000 -vn -f wav - |
> ffmpeg -i - -filter_complex
> "channelmap=map=FL-BL|FR-BR|FC-FC|LFE-LFE|BL-FL|BR-FR:channel_layout=5.1"
> -vn -f wav -vol 1024 - | "C:\vlc-3.0.6\vlc.exe" - --prefetch-buffer-size=400


It may seem hard to understand, but it's on a budget PC so no additional
DACs considered for audio routing. What I intended to do was playing two
separated stereo audio outputs on the same 5.1 speaker configuration; Front
jack to a budget Philips stereo system 'MP3-Link', while rear jack to my
earphone.

I once utilized Virtual Audio Cable and Audio Router to accomplish the
task, until found out VAC's built-in KS and MME audio redirection tools
could not work on my new Acer PC with a different model of Realtek codec -
It would just insist on outputting to front channels but not the rear's. So
after some research I found out FFMpeg capable of doing this through a
careful command-line design. The pro point over SoX (Sound eXchange) is
only because FFMpeg is more popular and pervasive in terms of end-user use
cases, otherwise a dedicated tool for sound manipulation is preferred.

Of course this method has some cons. First, there will be noticeable
delays. Second, sound choppy at times on Windows 10, a scenario I never
expected based on previous experiences with Windows 7. Third, we won't know
if this is going to work in the future as the system updates. So in the
very end of this submission, I'd like to know if there are already
equivalent applications similar to my script case, or the answer might be a
luxury VST plugin worthy of hundreds of dollars or some popular but
potentially unsafe programs? Would anyone like to help turn my initiative
into a real portable app coding idea?

If anyone find my story amusing (or confusing), do not hesitate to reply
for possible understandings. Thank you for your patience.

Best regards,
Thomas from Sound Yuan Studios
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: In case of future deprecation, a backup of audio routing script shared for public servicing.

kumowoon1025
> On Feb 11, 2019, at 6:42 PM, Sound Yuan <[hidden email]> wrote:
>
> ffmpeg -f dshow -rtbufsize 4 -i audio="Line 1 (Virtual Audio Cable)" -f dshow -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -f dshow -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -filter_complex "[0:a][1:a][2:a]amerge=inputs=3[a]" -map "[a]" -ar 48000 -vn -f wav - | ffmpeg -i - -filter_complex "channelmap=map=FL-BL|FR-BR|FC-FC|LFE-LFE|BL-FL|BR-FR:channel_layout=5.1” -vn -f wav -vol 1024 - | "C:\vlc-3.0.6\vlc.exe" - --prefetch-buffer-size=400

Since you don’t intend to up mix 2 channels to 5.1, I think you could just use amerge to mix the two inputs to one quad stream. This mapping seems like it would result in a very strange channel arrangement, I wonder if you have not noticed any distortion?

Also, I am not familiar with directshow, what does rtbufsize 4 mean in this context? If it’s 4 bytes, that seems small. Checking that option and not reading the same input twice might improve performance.

ffmpeg -f dshow -i audio=“Line 1 (Virtual Audio Cable)” -f dshow -i audio=“Line 2 (Virtual Audio Cable)” -lavfi “join=inputs=2:channel_layout=quad” ...
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: In case of future deprecation, a backup of audio routing script shared for public servicing.

Sound Yuan
Hi,

Thanks for the suggestion. Forgot to tell that Line 1 is the real output
whereas Line 2 is a silenced source for nullifying front channels. I use
two cables separately for rear and front jacks, with earphones attached to
front one's extension and stereos to the rear's; Would try the quad
configuration when home after-hours.

Best regards,

On Tue, Feb 12, 2019, 11:36 AM Ted Park <[hidden email] wrote:

> > On Feb 11, 2019, at 6:42 PM, Sound Yuan <[hidden email]>
> wrote:
> >
> > ffmpeg -f dshow -rtbufsize 4 -i audio="Line 1 (Virtual Audio Cable)" -f
> dshow -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -f dshow
> -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -filter_complex
> "[0:a][1:a][2:a]amerge=inputs=3[a]" -map "[a]" -ar 48000 -vn -f wav - |
> ffmpeg -i - -filter_complex
> "channelmap=map=FL-BL|FR-BR|FC-FC|LFE-LFE|BL-FL|BR-FR:channel_layout=5.1”
> -vn -f wav -vol 1024 - | "C:\vlc-3.0.6\vlc.exe" - --prefetch-buffer-size=400
>
> Since you don’t intend to up mix 2 channels to 5.1, I think you could just
> use amerge to mix the two inputs to one quad stream. This mapping seems
> like it would result in a very strange channel arrangement, I wonder if you
> have not noticed any distortion?
>
> Also, I am not familiar with directshow, what does rtbufsize 4 mean in
> this context? If it’s 4 bytes, that seems small. Checking that option and
> not reading the same input twice might improve performance.
>
> ffmpeg -f dshow -i audio=“Line 1 (Virtual Audio Cable)” -f dshow -i
> audio=“Line 2 (Virtual Audio Cable)” -lavfi
> “join=inputs=2:channel_layout=quad” ...
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: In case of future deprecation, a backup of audio routing script shared for public servicing.

Moritz Barsnick
On Tue, Feb 12, 2019 at 12:26:55 +0800, Sound Yuan wrote:
> Thanks for the suggestion. Forgot to tell that Line 1 is the real output
> whereas Line 2 is a silenced source for nullifying front channels. I use
> two cables separately for rear and front jacks, with earphones attached to
> front one's extension and stereos to the rear's; Would try the quad
> configuration when home after-hours.
[...]
> > > On Feb 11, 2019, at 6:42 PM, Sound Yuan <[hidden email]> wrote:
> > >
> > > ffmpeg -f dshow -rtbufsize 4 -i audio="Line 1 (Virtual Audio Cable)" -f
> > dshow -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -f dshow
> > -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -filter_complex
> > "[0:a][1:a][2:a]amerge=inputs=3[a]" -map "[a]" -ar 48000 -vn -f wav - |
> > ffmpeg -i - -filter_complex
> > "channelmap=map=FL-BL|FR-BR|FC-FC|LFE-LFE|BL-FL|BR-FR:channel_layout=5.1”
> > -vn -f wav -vol 1024 - | "C:\vlc-3.0.6\vlc.exe" - --prefetch-buffer-size=400

I'm quite sure you can also chain the filters from the first and the
second ffmpeg command. This could in turn reduce some of the latency.

>
$ [...] -filter_complex "[0:a][1:a][2:a]amerge=inputs=3,channelmap=map=FL-BL|FR-BR|FC-FC|LFE-LFE|BL-FL|BR-FR:channel_layout=5.1" [...]

(without judging about the use of the filters for your use-case).

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: In case of future deprecation, a backup of audio routing script shared for public servicing.

Sound Yuan
Hi,

It's the pan filter's magic now. Thanks to everyone involved.

ffmpeg -f dshow -i audio="Line 1 (Virtual Audio Cable)" -filter_complex
"pan=5.1|BL=c0|BR=c1" -vn -f wav -vol 1024 - | "C:\vlc-3.0.6\vlc.exe" -
--prefetch-buffer-size=400

Best regards,

On Tue, Feb 12, 2019 at 9:44 PM Moritz Barsnick <[hidden email]> wrote:

> On Tue, Feb 12, 2019 at 12:26:55 +0800, Sound Yuan wrote:
> > Thanks for the suggestion. Forgot to tell that Line 1 is the real output
> > whereas Line 2 is a silenced source for nullifying front channels. I use
> > two cables separately for rear and front jacks, with earphones attached
> to
> > front one's extension and stereos to the rear's; Would try the quad
> > configuration when home after-hours.
> [...]
> > > > On Feb 11, 2019, at 6:42 PM, Sound Yuan <[hidden email]>
> wrote:
> > > >
> > > > ffmpeg -f dshow -rtbufsize 4 -i audio="Line 1 (Virtual Audio Cable)"
> -f
> > > dshow -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -f dshow
> > > -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -filter_complex
> > > "[0:a][1:a][2:a]amerge=inputs=3[a]" -map "[a]" -ar 48000 -vn -f wav - |
> > > ffmpeg -i - -filter_complex
> > >
> "channelmap=map=FL-BL|FR-BR|FC-FC|LFE-LFE|BL-FL|BR-FR:channel_layout=5.1”
> > > -vn -f wav -vol 1024 - | "C:\vlc-3.0.6\vlc.exe" -
> --prefetch-buffer-size=400
>
> I'm quite sure you can also chain the filters from the first and the
> second ffmpeg command. This could in turn reduce some of the latency.
>
> >
> $ [...] -filter_complex
> "[0:a][1:a][2:a]amerge=inputs=3,channelmap=map=FL-BL|FR-BR|FC-FC|LFE-LFE|BL-FL|BR-FR:channel_layout=5.1"
> [...]
>
> (without judging about the use of the filters for your use-case).
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: In case of future deprecation, a backup of audio routing script shared for public servicing.

Sound Yuan
Hi again,

For anyone interested, I used ffplay to minimize the wait-start time and
maybe the resource cost after the post. However tonight it won't work
anymore on my Win10: It just insists converting my 5.1 ffplay sound pipe
into stereo, so I changed back to second-best VLC player option and it
plays fine now. Now I can study online videos(!) with non-interfering
background music.

Best regards,

On Wed, Feb 13, 2019 at 8:47 AM Sound Yuan <[hidden email]>
wrote:

> Hi,
>
> It's the pan filter's magic now. Thanks to everyone involved.
>
> ffmpeg -f dshow -i audio="Line 1 (Virtual Audio Cable)" -filter_complex
> "pan=5.1|BL=c0|BR=c1" -vn -f wav -vol 1024 - | "C:\vlc-3.0.6\vlc.exe" -
> --prefetch-buffer-size=400
>
> Best regards,
>
> On Tue, Feb 12, 2019 at 9:44 PM Moritz Barsnick <[hidden email]> wrote:
>
>> On Tue, Feb 12, 2019 at 12:26:55 +0800, Sound Yuan wrote:
>> > Thanks for the suggestion. Forgot to tell that Line 1 is the real output
>> > whereas Line 2 is a silenced source for nullifying front channels. I use
>> > two cables separately for rear and front jacks, with earphones attached
>> to
>> > front one's extension and stereos to the rear's; Would try the quad
>> > configuration when home after-hours.
>> [...]
>> > > > On Feb 11, 2019, at 6:42 PM, Sound Yuan <
>> [hidden email]> wrote:
>> > > >
>> > > > ffmpeg -f dshow -rtbufsize 4 -i audio="Line 1 (Virtual Audio
>> Cable)" -f
>> > > dshow -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -f dshow
>> > > -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -filter_complex
>> > > "[0:a][1:a][2:a]amerge=inputs=3[a]" -map "[a]" -ar 48000 -vn -f wav -
>> |
>> > > ffmpeg -i - -filter_complex
>> > >
>> "channelmap=map=FL-BL|FR-BR|FC-FC|LFE-LFE|BL-FL|BR-FR:channel_layout=5.1”
>> > > -vn -f wav -vol 1024 - | "C:\vlc-3.0.6\vlc.exe" -
>> --prefetch-buffer-size=400
>>
>> I'm quite sure you can also chain the filters from the first and the
>> second ffmpeg command. This could in turn reduce some of the latency.
>>
>> >
>> $ [...] -filter_complex
>> "[0:a][1:a][2:a]amerge=inputs=3,channelmap=map=FL-BL|FR-BR|FC-FC|LFE-LFE|BL-FL|BR-FR:channel_layout=5.1"
>> [...]
>>
>> (without judging about the use of the filters for your use-case).
>>
>> Moritz
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
>
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: In case of future deprecation, a backup of audio routing script shared for public servicing.

Sound Yuan
Dear all,

Since re-installation of my PC to Win10 1809 Home updated with VAC 4.60,
ffmpeg 4.0.1 can no longer capture Line 1 (Virtual Audio Cable) with ideal
output as mentioned in my previous posts.The volume meter in Control Panel
or Settings didn't give a go and it seemed there's nothing about any level
changes as shown in Line 1's recording device instance. But VAC's Audio
Router MME runs fine with forcibly setting cable format to not ranged and
performs in/out channel redirection well. Has anyone encountered issue like
this so far (no sound with DirectSound captures)?

Best regards,
Chang


On Sat, Mar 16, 2019 at 10:57 PM Sound Yuan <[hidden email]>
wrote:

> Hi again,
>
> For anyone interested, I used ffplay to minimize the wait-start time and
> maybe the resource cost after the post. However tonight it won't work
> anymore on my Win10: It just insists converting my 5.1 ffplay sound pipe
> into stereo, so I changed back to second-best VLC player option and it
> plays fine now. Now I can study online videos(!) with non-interfering
> background music.
>
> Best regards,
>
> On Wed, Feb 13, 2019 at 8:47 AM Sound Yuan <[hidden email]>
> wrote:
>
>> Hi,
>>
>> It's the pan filter's magic now. Thanks to everyone involved.
>>
>> ffmpeg -f dshow -i audio="Line 1 (Virtual Audio Cable)" -filter_complex
>> "pan=5.1|BL=c0|BR=c1" -vn -f wav -vol 1024 - | "C:\vlc-3.0.6\vlc.exe" -
>> --prefetch-buffer-size=400
>>
>> Best regards,
>>
>> On Tue, Feb 12, 2019 at 9:44 PM Moritz Barsnick <[hidden email]> wrote:
>>
>>> On Tue, Feb 12, 2019 at 12:26:55 +0800, Sound Yuan wrote:
>>> > Thanks for the suggestion. Forgot to tell that Line 1 is the real
>>> output
>>> > whereas Line 2 is a silenced source for nullifying front channels. I
>>> use
>>> > two cables separately for rear and front jacks, with earphones
>>> attached to
>>> > front one's extension and stereos to the rear's; Would try the quad
>>> > configuration when home after-hours.
>>> [...]
>>> > > > On Feb 11, 2019, at 6:42 PM, Sound Yuan <
>>> [hidden email]> wrote:
>>> > > >
>>> > > > ffmpeg -f dshow -rtbufsize 4 -i audio="Line 1 (Virtual Audio
>>> Cable)" -f
>>> > > dshow -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -f dshow
>>> > > -rtbufsize 4 -i audio="Line 2 (Virtual Audio Cable)" -filter_complex
>>> > > "[0:a][1:a][2:a]amerge=inputs=3[a]" -map "[a]" -ar 48000 -vn -f wav
>>> - |
>>> > > ffmpeg -i - -filter_complex
>>> > >
>>> "channelmap=map=FL-BL|FR-BR|FC-FC|LFE-LFE|BL-FL|BR-FR:channel_layout=5.1”
>>> > > -vn -f wav -vol 1024 - | "C:\vlc-3.0.6\vlc.exe" -
>>> --prefetch-buffer-size=400
>>>
>>> I'm quite sure you can also chain the filters from the first and the
>>> second ffmpeg command. This could in turn reduce some of the latency.
>>>
>>> >
>>> $ [...] -filter_complex
>>> "[0:a][1:a][2:a]amerge=inputs=3,channelmap=map=FL-BL|FR-BR|FC-FC|LFE-LFE|BL-FL|BR-FR:channel_layout=5.1"
>>> [...]
>>>
>>> (without judging about the use of the filters for your use-case).
>>>
>>> Moritz
>>> _______________________________________________
>>> ffmpeg-user mailing list
>>> [hidden email]
>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>>
>>> To unsubscribe, visit link above, or email
>>> [hidden email] with subject "unsubscribe".
>>
>>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".