Project

General

Profile

TVHEADEND MUX for YOUTUBE with STREAMLINK ?

Added by manuel neuer about 2 years ago

I want to watch a youtube live channel on TV (RPi) as a tvheadend-channel (withot API-key) what should work with streamlink (?) but how to creat a mux?
I tired for example:

pipe:///home/osmc/.local/bin/streamlink --stdout --default-stream best --url https://www.youtube.com/watch?v=JhajwzEv1Fo

what does not work :( . Can anyone please post a working streamlink mux entry for a tvheadend mux ?!


Replies (6)

RE: TVHEADEND MUX for YOUTUBE with STREAMLINK ? - Added by Njuskalo Njusko about 2 years ago

This works on my setup: pipe:///usr/local/bin/streamlink https://www.youtube.com/watch?v=JhajwzEv1Fo best -O

BTW, this is streamlink 5.0.1

RE: TVHEADEND MUX for YOUTUBE with STREAMLINK ? - Added by manuel neuer about 2 years ago

I found the solution with
pipe:///home/osmc/.local/bin/streamlink --stdout --hls-live-edge 6 --ringbuffer-size 32M -4 --default-stream 720p,best --url https://www.youtube.com/watch?v=JhajwzEv1Fo

RE: TVHEADEND MUX for YOUTUBE with STREAMLINK ? - Added by Nenad nenadd about 2 years ago

streamlink 5.0.1

#EXTINF:-1 tvg-name="NHK Worl-Japan (JP)" tvg-language="English" tvg-country="JP" tvg-logo="https://yt3.ggpht.com/ytc/AKedOLQ9ItuDialCNXYh2ue_wnjMND6mh3JIWPLfDprFZw=s176-c-k-c0x00ffffff-no-rj-mo" group-title="Variety",NHK World-Japan (JP)
pipe:///usr/bin/env streamlink --stdout --default-stream 720p,best --url https://www3.nhk.or.jp/nhkworld/en/live/

works

##########################
tvh debug ############
2022-11-04 15:06:19.739 mpegts: youtube.m3u - NHK World-Japan (JP) in Youtube auto - tuning on IPTV
2022-11-04 15:06:19.744 spawn: Executing "/usr/bin/env"
2022-11-04 15:06:19.744 epggrab: youtube.m3u - NHK World-Japan (JP) in Youtube auto - registering mux for OTA EPG
2022-11-04 15:06:19.744 subscription: 0048: "scan" subscribing to mux "youtube.m3u - NHK World-Japan (JP)", weight: 6, adapter: "IPTV", network: "Youtube auto", service: "Raw PID Subscription" ########################

not work pls help ##########################

pipe:///usr/bin/env streamlink --stdout --hls-live-edge 6 --ringbuffer-size 32M -4 --default-stream 720p,best --url https://www.youtube.com/watch?v=JhajwzEv1Fo

################################

mpegts: 24 in Youtube - tuning on IPTV
2022-11-04 20:57:51.693 spawn: Executing "/usr/bin/env"
2022-11-04 20:57:51.695 subscription: 01A2: "scan" subscribing to mux "24", weight: 6, adapter: "IPTV", network: "Youtube", service: "Raw PID Subscription"
2022-11-04 20:57:52.210 spawn: error: No plugin can handle URL: -4
2022-11-04 20:57:52.257 iptv: stdin pipe unexpectedly closed: No data
2022-11-04 20:57:53.722 TS: Mux2 498 Cot/498MHz/PINK: MPEG2AUDIO @ #1032 Continuity counter error (total 523)
2022-11-04 20:58:06.686 mpegts: 24 in Youtube - scan no data, failed
2022-11-04 20:58:06.686 subscription: 01A2: "scan" unsubscribing

RE: TVHEADEND MUX for YOUTUBE with STREAMLINK ? - Added by Nenad nenadd about 2 years ago

tvh 4.3

#####################################
2022-11-05 16:29:04.264 spawn: Executing "/usr/bin/env"
2022-11-05 16:29:04.265 spawn: Executing "/usr/bin/env"
2022-11-05 16:29:04.271 spawn: Executing "/usr/bin/env"
2022-11-05 16:29:04.271 spawn: Executing "/usr/bin/env"
2022-11-05 16:29:04.279 spawn: Executing "/usr/bin/env"
2022-11-05 16:29:05.037 spawn: [cli][info] Found matching plugin nhkworld for URL https://www3.nhk.or.jp/nhkworld/en/live/
2022-11-05 16:29:05.125 spawn: [cli][info] Found matching plugin youtube for URL https://www.youtube.com/user/france24english/live
2022-11-05 16:29:05.133 spawn: [cli][info] Found matching plugin youtube for URL https://www.youtube.com/user/deutschewelleenglish/live
2022-11-05 16:29:05.183 spawn: [cli][info] Found matching plugin youtube for URL https://www.youtube.com/user/france24/live
2022-11-05 16:29:05.268 spawn: error: No plugin can handle URL: https://olympics.com/en/live/
2022-11-05 16:29:05.345 iptv: stdin pipe 45 unexpectedly closed: No data
2022-11-05 16:29:05.642 spawn: error: No plugin can handle URL: https://tviplayer.iol.pt/direto/CNN
2022-11-05 16:29:05.643 spawn: error: No plugin can handle URL: https://www.cmmedia.es/en-directo/tv/
2022-11-05 16:29:05.704 iptv: stdin pipe 40 unexpectedly closed: No data
2022-11-05 16:29:05.704 iptv: stdin pipe 41 unexpectedly closed: No data
2022-11-05 16:29:05.915 spawn: error: No plugin can handle URL: https://www.cbsnews.com/live/
2022-11-05 16:29:05.971 spawn: error: Could not find a video on this page
2022-11-05 16:29:05.977 iptv: stdin pipe 43 unexpectedly closed: No data
2022-11-05 16:29:05.990 spawn: error: Could not find a video on this page
2022-11-05 16:29:06.006 iptv: stdin pipe 44 unexpectedly closed: No data
2022-11-05 16:29:06.025 iptv: stdin pipe 42 unexpectedly closed: No data
2022-11-05 16:29:06.294 spawn: error: Could not find a video on this page
2022-11-05 16:29:06.326 spawn: Executing "/usr/bin/env"
2022-11-05 16:29:06.730 spawn: [cli][info] Found matching plugin youtube for URL https://www.youtube.com/user/deutschewelleenglish/live
2022-11-05 16:29:07.338 spawn: error: Could not find a video on this page
2022-11-05 16:29:07.390 iptv: stdin pipe 39 unexpectedly closed: No data
2022-11-05 16:29:09.095 spawn: [cli][info] Available streams: 70k_alt (worst), 70k, 180p_alt, 180p, 360p_alt, 360p, 720p_alt, 720p (best)
2022-11-05 16:29:09.095 spawn: [cli][info] Opening stream: 720p (hls)
2022-11-05 16:29:19.248 mpegts: youtube.m3u - Olympics TV (EN) in Youtube Auto - scan no data, failed
2022-11-05 16:29:19.248 subscription: 0043: "scan" unsubscribing
2022-11-05 16:29:19.248 mpegts: youtube.m3u - France 24 English in Youtube Auto - scan no data, failed
2022-11-05 16:29:19.248 subscription: 0042: "scan" unsubscribing
2022-11-05 16:29:19.248 mpegts: youtube.m3u - CBS News (US) in Youtube Auto - scan no data, failed
2022-11-05 16:29:19.248 subscription: 0041: "scan" unsubscribing
2022-11-05 16:29:19.248 mpegts: youtube.m3u - France 24 in Youtube Auto - scan no data, failed
2022-11-05 16:29:19.248 subscription: 0040: "scan" unsubscribing
2022-11-05 16:29:19.248 mpegts: youtube.m3u - Castilla-La Mancha Media (ES) in Youtube Auto - scan no data, failed
2022-11-05 16:29:19.248 subscription: 003F: "scan" unsubscribing
2022-11-05 16:29:19.248 mpegts: youtube.m3u - CNN Portugal (PT) in Youtube Auto - scan no data, failed
2022-11-05 16:29:19.248 subscription: 003E: "scan" unsubscribing
2022-11-05 16:29:19.248 mpegts: youtube.m3u - DW English in Youtube Auto - scan no data, failed
2022-11-05 16:29:19.249 subscription: 003D: "scan" unsubscribing
2022-11-05 16:29:19.249 mpegts: youtube.m3u - NHK World-Japan (JP) in Youtube Auto scan complete
2022-11-05 16:29:19.249 subscription: 003C: "scan" unsubscribing

RE: TVHEADEND MUX for YOUTUBE with STREAMLINK ? - Added by lin colon about 1 year ago

manuel neuer wrote:

I want to watch a youtube live channel on TV (RPi) as a tvheadend-channel (withot API-key) what should work with streamlink (?) but how to creat a mux?
I tired for example:
pipe:///home/osmc/.local/bin/streamlink --stdout --default-stream best --url https://www.youtube.com/watch?v=JhajwzEv1Fo
what does not work :( . Can anyone please post a working streamlink mux entry for a tvheadend mux ?!

Hello, I think you can use streamlink to extract the stream URL from the YouTube page:

streamlink --youtube-hash "https://www.youtube.com/watch?v=CHANNEL_ID" best --stdout | youtube-dl -g

This will output something like an RTMP URL.

Next, you should create a muxconf file for TVheadend to use that channel:

# youtube.mux
input=ffmpeg,pull=http://RTMP_URL
ffmpeg_options=-fflags nobuffer -fflags discardcorrupt 
mux=ts
output=channel1 
service=1:0:0:0:name:YouTube Channel

RE: TVHEADEND MUX for YOUTUBE with STREAMLINK ? - Added by Brooks Turner 12 months ago

lin colon wrote:

manuel neuer wrote:

I want to watch a youtube live channel on TV (RPi) as a tvheadend-channel (withot API-key) what should work with streamlink (?) but how to creat a mux?
I tired for example:
pipe:///home/osmc/.local/bin/streamlink --stdout --default-stream best --url https://www.youtube.com/watch?v=JhajwzEv1Fo
what does not work :( . Can anyone please post a working streamlink mux entry for a tvheadend mux ?!

Hello, I think you can use streamlink to extract the stream URL from the YouTube page:

streamlink --youtube-hash "https://www.youtube.com/watch?v=CHANNEL_ID" best --stdout | youtube-dl -g

This will output something like an RTMP URL.

Next, you should create a muxconf file for TVheadend to use that channel:
[...]

Yeah. Maybe I should do it this way, even though it's a bit more complicated and time-consuming.

    (1-6/6)