Last active
August 17, 2020 13:29
-
-
Save snsinfu/9b4a6e5a732b7411f01b00ec0527f633 to your computer and use it in GitHub Desktop.
Live-transcode RTMP stream to WebM using ffmpeg and ffserver for Chromecast
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTPBindAddress 0.0.0.0 | |
HTTPPort 8090 | |
CustomLog - | |
<Feed feed.ffm> | |
File ./feed.ffm | |
FileMaxSize 256M | |
ACL ALLOW localhost | |
</Feed> | |
<Stream stream.webm> | |
Feed feed.ffm | |
Format webm | |
AudioCodec libvorbis | |
AudioBitRate 64 | |
AudioSampleRate 24000 | |
AudioChannels 2 | |
VideoCodec libvpx | |
VideoBitRate 128 | |
VideoBitRateRange 16-128 | |
VideoBufferSize 128 | |
VideoSize 320x180 | |
VideoFrameRate 10 | |
</Stream> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -eu | |
source_url="rtmp://example.com/radio" | |
feed_url="http://localhost:8090/feed.ffm" | |
ffmpeg -i "${source_url}" -f ffm "${feed_url}" |
The audio/video parameters should be tuned for the original stream. The above example is for rtmp://fms-base1.mitene.ad.jp/agqr/aandg22 .
ffserver has been removed:
Alternative streaming server should be used. (Icecast maybe?)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go to http://movies.foamsnet.com/url/ and input the stream URL to watch the transcoded stream via your chromecast. If ffserver is running on a machine with IP address 192.168.1.10 then the stream URL would be http://192.168.1.10:8090/stream.webm .