shithub: docs.9front.org

ref: b962b3f7da70cc249ae70c77d513a0af0306a154
dir: /youtube.md/

View raw version
Youtube
=======

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

*NOTE* one does not simply commit treason on anything other than AMD64
or 386.  No videos for Raspi users, sorry.  You can still play audio
only on other arches though.

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.