Skip to content

Instantly share code, notes, and snippets.

@snsinfu
Last active August 17, 2020 13:29
Show Gist options
  • Save snsinfu/9b4a6e5a732b7411f01b00ec0527f633 to your computer and use it in GitHub Desktop.
Save snsinfu/9b4a6e5a732b7411f01b00ec0527f633 to your computer and use it in GitHub Desktop.
Live-transcode RTMP stream to WebM using ffmpeg and ffserver for Chromecast
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>
#!/bin/sh -eu
source_url="rtmp://example.com/radio"
feed_url="http://localhost:8090/feed.ffm"
ffmpeg -i "${source_url}" -f ffm "${feed_url}"
@snsinfu
Copy link
Author

snsinfu commented Jun 26, 2018

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 .

@snsinfu
Copy link
Author

snsinfu commented Jun 26, 2018

The audio/video parameters should be tuned for the original stream. The above example is for rtmp://fms-base1.mitene.ad.jp/agqr/aandg22 .

@snsinfu
Copy link
Author

snsinfu commented Jun 26, 2018

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