LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-14-2020, 11:47 AM   #1
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 7, SH4, Debian
Posts: 268

Rep: Reputation: 8
Can not play https (not http) audio stream


I want to stream internet audio over Bluetooth from CLI of Raspberry Pi to soundbar. For this purpose I use such command:

Code:
mpg123 -b 1024 -a bluealsa:DEV=01:28:6F:AD:B5:4D,PROFILE=a2dp http://stream.rcs.revma.com/ypqt40u0x1zuv
It works properly. But when I try to use https, i got an errors:

Code:
root@NanoPi-NEO:/home/pi/Pobrane# mpg123 -b 1024 -a bluealsa:DEV=01:28:6F:AD:B5:4D,PROFILE=a2dp  https://stream.nowyswiat.online/mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.22.4; written and copyright by Michael Hipp and others
        free software (LGPL) without any warranty but with best wishes

[readers.c:1182] error: Cannot open file https://stream.nowyswiat.online/mp3: No such file or directory

[mpg123.c:634] error: Cannot open https://stream.nowyswiat.online/mp3: File access error. (code 22)
or

Code:
root@NanoPi-NEO:/home/pi/Pobrane# mpg123 -b 1024 -a bluealsa:DEV=01:28:6F:AD:B5:4D,PROFILE=a2dp -@ https://stream.nowyswiat.online/mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.22.4; written and copyright by Michael Hipp and others
        free software (LGPL) without any warranty but with best wishes
https://stream.nowyswiat.online/mp3: No such file or directory
So, how can I proper stream https stream?

My RPi does not have video chip (nano version), so only CLI is avaliable.
 
Old 08-14-2020, 09:03 PM   #2
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 2,989

Rep: Reputation: 821Reputation: 821Reputation: 821Reputation: 821Reputation: 821Reputation: 821Reputation: 821
I could play that with:
Code:
ffplay https://stream.nowyswiat.online/mp3

mpv https://stream.nowyswiat.online/mp3
Code:
ffprobe https://stream.nowyswiat.online/mp3

Input #0, mp3, from 'https://stream.nowyswiat.online/mp3':
  Metadata:
    icy-name        : Radio Nowy Swiat
  Duration: N/A, start: 0.000000, bitrate: 128 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
Code:
curl -LI https://stream.nowyswiat.online/mp3
HTTP/2 302 
...
location: https://stream.rcs.revma.com/ypqt40u0x1zuv
...
And that scapes out to:
Code:
https://n14.rcs.revma.com/ypqt40u0x1zuv?rj-ttl=5&rj-tok=AAABc-_SYSAAskPRTNW2BPU64Q
Code:
youtube-dl -F https://n14.rcs.revma.com/ypqt40u0x1zuv?rj-ttl=5&rj-tok=AAABc-_SYSAAskPRTNW2BPU64Q
...
format code  extension      resolution note
mpeg         unknown_video  audio only
And I could download it with:
Code:
youtube-dl -f mpeg https://stream.rcs.revma.com/ypqt40u0x1zuv -o test.mp3

curl -L https://stream.rcs.revma.com/ypqt40u0x1zuv -o test2.mp3
Code:
file test.mp3
test.mp3: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo
Code:
mpg123 test.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.25.13; written and copyright by Michael Hipp and others
        free software (LGPL) without any warranty but with best wishes

Directory: ***

Terminal control enabled, press 'h' for listing of keys and functions.

Playing MPEG stream 1 of 1: test.mp3 ...

MPEG 1.0 L III cbr128 44100 j-s

[0:14] Decoding of test.mp3 finished.

Last edited by teckk; 08-14-2020 at 09:05 PM.
 
Old 08-14-2020, 11:56 PM   #3
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 7, SH4, Debian
Posts: 268

Original Poster
Rep: Reputation: 8
Yes, its correct if You want to play/stream to on-board audio chip. Nano Pi has one. But my goal is to play on Bluetooth soundbar. So it is necessary to redirect output to another device that is Bluetooth, like in the command "mpg123". Is it possible in case mpv or ffmpeg? I dont see such option (or maybe I miss something). Have You any idea?
 
Old 08-15-2020, 06:14 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,302
Blog Entries: 9

Rep: Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377
Quote:
Originally Posted by mackowiakp View Post
Yes, its correct if You want to play/stream to on-board audio chip. Nano Pi has one. But my goal is to play on Bluetooth soundbar. So it is necessary to redirect output to another device that is Bluetooth, like in the command "mpg123". Is it possible in case mpv or ffmpeg? I dont see such option (or maybe I miss something). Have You any idea?
Are you saying mpg123 can play HTTPS, but cannot if you use bluetooth for output?
And mpg123 can play HTTP, also with bluetooth output?
 
Old 08-15-2020, 06:38 AM   #5
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 7, SH4, Debian
Posts: 268

Original Poster
Rep: Reputation: 8
Quote:
Are you saying mpg123 can play HTTPS, but cannot if you use bluetooth for output?
No. mpg123 can play http over Bluetooth. It works for me very fine. But I can not play htpps using mpg123. Does not matter via on-board audio chip or Bluetooth. ffmpeg and mpv can play but I dont know how to redirect output to Bluetooth.

Quote:
And mpg123 can play HTTP, also with bluetooth output?
Yes, after compile and install from sources bluealsa daemon. Look at thread https://www.linuxquestions.org/quest...pi-4175680304/
I described the way how to play via Bluetooth using bluealsa.
 
Old 08-15-2020, 06:51 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,302
Blog Entries: 9

Rep: Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377
Quote:
Originally Posted by mackowiakp View Post
But I can not play htpps using mpg123.
Seems that is the core of your problem and it has nothing to do with bluetooth.

"HTTP" is mentioned often, but the term "HTTPS" is conspicuously missing from mpg123's man page. There might be ways around that limitation, see "HTTP SUPPORT".
 
Old 08-15-2020, 07:23 AM   #7
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 7, SH4, Debian
Posts: 268

Original Poster
Rep: Reputation: 8
I mean that:

1 - mpg123 can play only http and it is possible to specify deviye to play on (-D option)
2 - ffmpeg and mpv can play https but I don know how to redirect output do another device. Does not matter Bluetooth or for example second sound card (like USB dongle)

The redirection or specifying device in command line in case of ffmpeg or mpv is my issue. And probably too little knowledge :-(
 
Old 08-15-2020, 09:11 PM   #8
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 2,989

Rep: Reputation: 821Reputation: 821Reputation: 821Reputation: 821Reputation: 821Reputation: 821Reputation: 821
I can play that with mpg123 like this.
Code:
mkfifo pipe

curl -L https://stream.rcs.revma.com/ypqt40u0x1zuv -o pipe & mpg123 pipe
So I assume something like:
Code:
curl -L https://stream.rcs.revma.com/ypqt40u0x1zuv -o pipe & mpg123 -b 1024 -a bluealsa:DEV=01:28:6F:AD:B5:4D,PROFILE=a2dp pipe
I gave you examples in post 2.
 
2 members found this post helpful.
Old 08-16-2020, 02:20 AM   #9
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 7, SH4, Debian
Posts: 268

Original Poster
Rep: Reputation: 8
Hmm. Both commands outputs to file named "pipe" not to on-board audio chip or Bluetooth.

[EDIT]

OK ! WORKS ! THX ! Simply I made syntax error. Shame...

Last edited by mackowiakp; 08-16-2020 at 10:06 AM.
 
  


Reply

Tags
https, raspberrry pi, streaming radio


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] error while trying to connect to stream via http/https using vlc sithun Slackware 8 10-18-2017 06:53 AM
https certication error , the page can not be loaded via https ust Linux - Server 2 11-21-2013 08:49 PM
KDE4 can only play one audio stream dugan Slackware 2 04-02-2010 07:56 PM
Play a movie on one computer and stream the audio. almost000 Linux - Software 2 06-29-2007 11:27 PM
Burnt Audio CD by K3B CANNOT play on external CD playing device, but can play on comp robin.com.au Linux - Software 14 05-27-2007 04:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration