title: Playing only audio ts streams from M3U8 file from youtube-dl
body: <p>I am trying to come up with a way where I can play the audio only portion of a live stream using for example VLC player. The stream in question is from ChilledCow, the url which is 24x7 streaming is <a href="https://www.youtube.com/watch?v=DWcJFNfaw9c" rel="nofollow noreferrer">https://www.youtube.com/watch?v=DWcJFNfaw9c</a>. Using <code>youtube-dl -F</code>, I can see there are no Audio Only streams;</p>
  
  <pre><code>[youtube] DWcJFNfaw9c: Downloading webpage
  [youtube] DWcJFNfaw9c: Downloading m3u8 information
  [youtube] DWcJFNfaw9c: Downloading MPD manifest
  [info] Available formats for DWcJFNfaw9c:
  format code  extension  resolution note
  91           mp4        256x144    HLS  197k , avc1.42c00b, 30.0fps, mp4a.40.5@ 48k
  92           mp4        426x240    HLS  338k , avc1.4d4015, 30.0fps, mp4a.40.5@ 48k
  93           mp4        640x360    HLS  829k , avc1.4d401e, 30.0fps, mp4a.40.2@128k
  94           mp4        854x480    HLS 1380k , avc1.4d401f, 30.0fps, mp4a.40.2@128k
  95           mp4        1280x720   HLS 2593k , avc1.4d401f, 30.0fps, mp4a.40.2@256k
  96           mp4        1920x1080  HLS 4715k , avc1.640028, 30.0fps, mp4a.40.2@256k (best)
  </code></pre>
  
  <p>If I then use <code>youtube-dl -g -f 96</code> command, I am able to retrieve a M3U8 url (now expired);</p>
  
  <pre><code>https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1586086956/ei/zG-JXobzGP3B1AbawoHgBw/ip/202.153.210.144/id/DWcJFNfaw9c.2/itag/96/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D137/hls_chunk_host/r1---sn-fpqxc5oq-hxal.googlevideo.com/vprv/1/playlist_type/DVR/initcwndbps/14720/mh/Ms/mm/44/mn/sn-fpqxc5oq-hxal/ms/lva/mv/m/mvi/0/pcm2cms/yes/pl/24/dover/11/keepalive/yes/fexp/23882514/mt/1586065238/disable_polymer/true/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,goi,sgoap,sgovp,vprv,playlist_type/sig/AJpPlLswRQIgQ4q-AaeGe9RuORutXufPJpq2jV5qvvYSf8L46jrnOpcCIQDLiqxM-r8EVp8EUby0D8gzWblW56-4NjCpasYtABNGxw%3D%3D/lsparams/hls_chunk_host,initcwndbps,mh,mm,mn,ms,mv,mvi,pcm2cms,pl/lsig/ALrAebAwRgIhAPXST2zJ7NWF6SF7iv1JeiJxIQM9wnuYXlgEipQS1nxRAiEAsE9Vlj1mpqE3t72DvI7JXu0ILWajrQsEjqMNzy5spjQ%3D/playlist/index.m3u8
  </code></pre>
  
  <p>I can open this with VLC and the audio+video streams fine. When I inspect the Codec Details, I can see there are 2 streams; ADTS Audio @ 48000 Hz and H.264 Video. Opening up the M3U8 file, I see instructions on how to download the individual ts segments;</p>
  
  <pre><code>#EXTM3U
  #EXT-X-VERSION:3
  #EXT-X-TARGETDURATION:5
  #EXT-X-MEDIA-SEQUENCE:261917
  #EXT-X-DISCONTINUITY-SEQUENCE:105
  #EXT-X-PROGRAM-DATE-TIME:2020-04-05T01:52:00.024+00:00
  #EXTINF:5.0,
  https://r1---sn-fpqxc5oq-hxal.googlevideo.com/videoplayback/id/DWcJFNfaw9c.2/itag/96/source/yt_live_broadcast/expire/1586087365/ei/ZXGJXsX2Bc-zvATAg5LQCA/ip/202.153.210.144/requiressl/yes/ratebypass/yes/live/1/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D137/hls_chunk_host/r1---sn-fpqxc5oq-hxal.googlevideo.com/vprv/1/playlist_type/DVR/initcwndbps/13910/mh/Ms/mm/44/mn/sn-fpqxc5oq-hxal/ms/lva/mv/m/mvi/0/pl/24/keepalive/yes/fexp/23882513/mt/1586065639/disable_polymer/true/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,goi,sgoap,sgovp,vprv,playlist_type/sig/AJpPlLswRQIhAPZgf7DINxcGTvbH4B_0f-viQhiTpYT1jJuUsvmDCzJaAiB1GcPc2tvTx2wbYDgG5qb5PkSQ7pPS5A5yhlh782GdlQ%3D%3D/lsparams/hls_chunk_host,initcwndbps,mh,mm,mn,ms,mv,mvi,pl/lsig/ALrAebAwRAIgdV-i58zrYviyY4Zin9w6Gu9WVvqv5y99lq4XOsyRH4wCIEohlTMmwYrHgF8YvXWFRWZvYQP7e6NiE7w42YmwUzOM/playlist/index.m3u8/sq/261917/goap/clen%3D81159%3Blmt%3D1585977854061325/govp/clen%3D265668%3Blmt%3D1585977854061323/dur/5.000/file/seg.ts
  #EXTINF:5.0,
  https://r1---sn-fpqxc5oq-hxal.googlevideo.com/videoplayback/id/DWcJFNfaw9c.2/itag/96/source/yt_live_broadcast/expire/1586087365/ei/ZXGJXsX2Bc-zvATAg5LQCA/ip/202.153.210.144/requiressl/yes/ratebypass/yes/live/1/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D137/hls_chunk_host/r1---sn-fpqxc5oq-hxal.googlevideo.com/vprv/1/playlist_type/DVR/initcwndbps/13910/mh/Ms/mm/44/mn/sn-fpqxc5oq-hxal/ms/lva/mv/m/mvi/0/pl/24/keepalive/yes/fexp/23882513/mt/1586065639/disable_polymer/true/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,goi,sgoap,sgovp,vprv,playlist_type/sig/AJpPlLswRQIhAPZgf7DINxcGTvbH4B_0f-viQhiTpYT1jJuUsvmDCzJaAiB1GcPc2tvTx2wbYDgG5qb5PkSQ7pPS5A5yhlh782GdlQ%3D%3D/lsparams/hls_chunk_host,initcwndbps,mh,mm,mn,ms,mv,mvi,pl/lsig/ALrAebAwRAIgdV-i58zrYviyY4Zin9w6Gu9WVvqv5y99lq4XOsyRH4wCIEohlTMmwYrHgF8YvXWFRWZvYQP7e6NiE7w42YmwUzOM/playlist/index.m3u8/sq/261918/goap/clen%3D81404%3Blmt%3D1585977854061335/govp/clen%3D236301%3Blmt%3D1585977854061333/dur/5.000/file/seg.ts
  </code></pre>
  
  <p>I'm not sure if there is a way to only stream the audio portion, my goal is to have a headless raspberry pi (no video output, audio only) that can play the audio stream.</p>