shithub: wiki.9front.org

ref: 7c62730484a8cfa0aed8ba80e0e6f9f33511ed75
dir: /youtube.md/

View raw version
Youtube
=======

Commit [treason](https://git.sr.ht/~ft/treason).  It supports H.264,
VP8, VP9 and AV1.

Treason works on 386, AMD64 and ARM64.  Yes, lower resolution videos
can be played on a Raspberry Pi 4.

Install [nvi](https://git.sr.ht/~ft/nvi).

## Playing just audio alone

	nvi -A 251 -a /fd/1 ybGOT4d2Hs8 | mcfs -t audio | audio/opusdec > /dev/audio

## Playing video and/or audio

The easiest way to play ANY video on Youtube is to use H.264
"baseline" stream.  It's of pretty bad quality image-wise, but
contains audio in the container itself and doesn't require too much
CPU resources.

	nvi -V 18 -v /tmp/vid.mp4 ybGOT4d2Hs8 && treason /tmp/vid.mp4 && rm /tmp/vid.mp4

If you want to find the best possible format(s), use the following:

	nvi -a /tmp/audio -v /tmp/video ybGOT4d2Hs8 && treason -a /tmp/audio /tmp/video && rm /tmp/audio /tmp/video

You can put that script to `$home/bin/rc/youtube` and add a plumb rule
for Youtube URLs, right *before* `include basic`:

	type	is	text
	data	matches	'https://(www.)?youtube[^ ]+'
	plumb	start	window youtube ''''$0''''

## Caveats

No. It's great.

## Support

sigrid @ `#cat-v` or `9p.zone` chat.