VLC audio to Bluetooh, video to Chromecast?

4

2

VLC can Chromecast but Chromecast doesn't support Bluetooth and I'd like to send audio to Bluetooth speakers. How could I do this? I tried to draw this:

  Wifi       +----------+
 +---------->+Chromecast|
 |Video      +----------+
 |
++----+
| VLC |
++----+
 |
 |
 |Bluetooth  +--------+
 +---------->+Speakers|
  Audio      +--------+

I thought https://superuser.com/a/1029986/41259 would be useful but it doesn't seem to be possible to set a separate renderer for the second file. I can extract the audio file beforehands easily if that helps. (ffmpeg -i foo.mkv -vn -acodec copy out.eac3)

I am on Windows 10, I am familiar with command line and have WSL up and running should some Linux requiring server be the solution.

chx

Posted 2019-04-01T03:16:45.580

Reputation: 3 069

Why can't you pair the speakers with the computer and cast to them directly? Why is Chromecast important? – harrymc – 2019-04-03T07:31:29.860

Chromecast allows me to play video on my HDTV wirelessly. I guess I could connect the Chromecast to the speaker but then I'd need to switch inputs between HDMI and Bluetooth and that's quite inconvenient. This should be solvable via software... – chx – 2019-04-03T07:54:55.420

To force Chromecast to speak to Bluetooth, you would need to add hardware that the Chromecast will think is a TV but will in fact be the Bluetooth speakers. Is this hardware really necessary? Wouldn't it be better to work on an easy method for switching between HDMI and Bluetooth? – harrymc – 2019-04-03T09:47:36.480

I do not understand your problem. I can play a video on my laptop and then the audio goes to Bluetooth. A solution to the problem could be two VLC instances sync'd together but netsync seems to be abandoned long ago. I will try, though.

– chx – 2019-04-03T16:20:55.630

This might be getting clearer for me. Is the problem that you want to cast the video to the TV but the audio to the Bluetooth speakers? (Please add the text @harrymc to your answer so I get notified.) – harrymc – 2019-04-03T18:20:43.830

@harrymc YES! That is exactly what I am asking. – chx – 2019-04-03T18:34:12.043

That's possible. I'll be adding an answer. – harrymc – 2019-04-03T18:39:54.083

Give it a look even here. You can do a vlc streamer and use other vlc as client(s)... It was for subtitles but I think that in principle it can be adapted for your case too...

– Hastur – 2019-04-05T19:37:34.313

@chx I mean a no thinking solution would be to use a "streamer" instance of vlc and 2 vlc clients listening from the streamer: one redirecting to Chromecast and the other one using the Bluetooth. The two clients are in sync (on the same local network so it should be negligible, or at least manageable, the eventual delay). Pausing the stremer you pause both. It has to be a simpler solution inside a single VLC instance. I remember long ago it was possible to direct video and audio in different directions as a flux. I assume with vlc you can use Chromecast or speakers with no problems. – Hastur – 2019-04-06T12:35:53.020

@chx I added in an answer some words more. It may be able to solve some issue still open (namely on the vlc reading old saved settings) and give you something else to try... – Hastur – 2019-04-09T19:04:43.447

Answers

1

Quick and Dirty (Idea)

You state that

  • Client 1: with vlc (or other) you are able to send the signal to your television via Chromecast
  • Client 2: with vlc you are able to use the Bluetooth speakers

the problem is that they will hardly be in sync.

So the quicker solution is to use (as made to have in sync different subtitles/languages)

  • Server 1: another instance of vlc as local streamer.
    You can first connect two clients (eventually other two instance of vlc) to this server (to its streaming IP and PORT) and after you can start to play or pausing the streaming.

This is the solution followed from the OP, after solving some problems peculiar to his OS, software, hardware...


Path for a less resource requiring solution (Ideas)

Only the ideas trying to be useful to a wider audience and cover different hardware sets.

Any streamer program will have many options. Vlc has two lists of options.
You can ask the huge one with -H (-h is not enough, size matters when it is case sensitive :-)).

There are many interesting options in this case, among them for the server --no-sout-display (default enabled), --sout-display default disabled, --sout-video... --no-sout-video for video, --sout-audio --no-sout-audio (default enabled)...

It is a good practice to specify always the important options, to avoid eventual unwilled interferences from the options saved by a previous execution of the program. You understand how it can be "vicious": one time happens, one time no... >>> BTW vlc was (and still is) used to remember the last preferences modified in the last GUI execution and saved on exit. <<<
If you specify an option you will force the execution with that option.

Here some paths to try to save resources:

  • Again assuming you were able to use the speakers with vlc, maybe you may be able to save the Client 2 instance disabling in the streamer (Server 1) the audio redirection to the stream and using the speakers from there (start trying with --no-sout-audio).

  • I had not fully understood the part that brings the signal to your TV, but I have the impression you can try to save the Client 1 instance too. It is hardware dependent.

    • In some box TV, as the ones with Kodi, it's possible to add an app to connect directly the box to a streaming, simply knowing the IP (and port) of the stream. You know them because you give from command-line/GUI. Some of those app are able to scan the local network or a range of local IPs (see below). Even automatically.
    • Your TV can be dlna compliant in many ways (so you can set the vlc streamer to be compliant with the specific TV capabilities).
    • Chromecast hardware devices, I suppose you need only the streamer (Server 1) on a correct IP/port and codex.
    • Chromecast via Chrome (well the streamer (Server 1) and Chrome acting as Client 1 and streamer for the TV, probably un-needed).

Note on the IP (IPv4) reserved for multicast:

The IP address reserved by IANA for multicast locally are in this range

239.0.0.0-239.255.255.255 Organization-Local Scope [David_Meyer][RFC2365] 1997-01-01

Hastur

Posted 2019-04-01T03:16:45.580

Reputation: 15 043

1

This is not my idea but Hastur's answer. However, I have fallen into a few traps so I thought I will share my problems and the solutions I was able to find. Others might have better ideas but this works.

VLC seems to save settings to vlc-qt-interface.ini in AppData\Roaming\vlc. If you switch the renderer, it will switch both instances. Thus, you need two Windows users, I added a chromecast user.

  1. "C:\Program Files\VideoLAN\VLC\vlc.exe" movie.mkv --sout-all --sout="#rtp{dst=239.255.100.100,port=5004,mux=ts}". The IP address is not your wifi or some such, it's a multicast address. It needs to be in the range 224.0.0.0 through 239.255.255.255 or you won't be able to connect more than client to it. It seems you are free to choose whichever address you chose.
  2. "C:\Program Files\VideoLAN\VLC\vlc.exe" rtp://239.255.100.100:5004 --no-video. This will play the audio locally.
  3. runas /user:chromecast "C:\Program Files\VideoLAN\VLC\vlc.exe rtp://239.255.100.100:5004 --sout "#chromecast" --sout-chromecast-ip=192.168.1.152 --demux-filter=demux_chromecast". I believe all of these are required, even if you have only one Chromecast. I have no idea how to get the IP from Chromecast or Chrome for that matter -- I have found it from my router. Adding --no-audio has no effect as it seems the entire audio-video is handed wholesale to Chromecast. Mute your TV.

To create a .bat out of it, this answer has the solution: prefix each command with start /b.

One known issue is after a pause the Chromecasting VLC always warns "this video requires conversion". This is a major drawback.

chx

Posted 2019-04-01T03:16:45.580

Reputation: 3 069

0

The problem is to cast the video to the TV through the Chromecast, but to play the audio separately on the Bluetooth speakers.

Solution 1 : Two apps in sync

It is possible to play the same video using two apps, one for the video and the other for the audio, but this is pretty awkward. While the two can be easily synced at the start, they will go out of sync every time that you pause both, since you can only click one at a time.

VLC is useful here since it lets you jump to a position in the video, which will be essential while syncing the two apps.

This setup is pretty straight-forward. For details you could see the article
Play Video Through Chromecast And Route Audio Through Your PC Or Mac.

Solution 2 : Use an HDMI splitter

You could use an HDMI audio extractor, which costs typically only a few dozens of dollars. The device acts as a splitter, breaking the HDMI into separate video and audio to feed two different sets of equipment.

The setup is as follows:

  • The Chromecast is plugged into the HDMI-in port of the audio extractor
  • The media is streamed via wireless from the PC to the Chromecast
  • The audio extractor sends the audio via RCA style cables to the speakers, or any other connection method that it has in common with the speakers
  • The audio extractor connects to the TV through its HDMI-out port or any other method that it has in common with the TV.

This may not work with all setups and with all types of TVs and audio equipment, particularly certain legacy systems. So check your specs carefully before picking one of these devices up.

Not knowing more about your materials, and never having used such an HDMI audio extractor, I cannot recommend any specific device. You may issue a query on amazon.com and refine it as needed.

harrymc

Posted 2019-04-01T03:16:45.580

Reputation: 306 093

1"This being a work around comes with shortcomings such as how you won’t be able to pause the video without the audio going out of sync. It’s going to take a lot of trial and error to get the audio to line up with the video." -- that's what I wanted to avoid, that's why my original question was "Is it possible to have VLC play the same media twice, sync'd?" but then someone wanted to close it, I rewrote it and that section got lost. Thanks for the answer but neither of these is what I am after :( – chx – 2019-04-03T19:18:41.143