Anonymous

Changes

Computing:Stream transcode

1,771 bytes added, 15:02, 31 March 2014
Updated with a bit more info
Our HD stream is rather high bitrate (2MB at time of writing), so we also offer an SD stream, and a HLS stream for mobile. To do this, a transcode server needs to be running.
This is what is done == Nginx == Nginx needs to get such a server runningbe compiled with the nginx-rtmp-module available from http://github.com/arut/nginx-rtmp-module which also has some build instructions. It may be worth extending the configure line to set the prefix, log file and config directory to be more standard (ie <code>/usr/local</code>, as it's been built at least 4 times in <code>/var/log/nginx</code> and <code>/etc/nginx</code>). Nginx provides segmentation for the last 9 months. Someone might come HLS mobile stream and neaten this up at some pointalso pushes the transcoded video back to the main stream server for the SD flash stream.It needs something like the following in the config file:
== Nginx == rtmp { server { listen 1936; chunk_size 4000; application hls { live on; hls on; hls_path /tmp/hls; hls_fragment 15s; hls_base_url http://ystv.co.uk/static/iphone/; push rtmp://ystvstrm1.york.ac.uk:1935/live/sd1; } } }
Nginx In order for HLS to work the hls_path directive needs to be compiled with point at <code>/data/webs/ystv/static/iphone</code> on the nginxwebserver. Standard practice at time of writing is to use [http://ystv.co.uk/techblog/2012/04/secure-shell-rtmpfilesystem-modulesshfs/ SSHFS] with the allow_other option to mount that directory.
== FFmpeg ==
https://trac.ffmpeg.org/wiki/UbuntuCompilationGuide provides a nearly complete guide on compiling FFmpeg. The modules required are libx264, libfdklibfaac and librtmp and changing the prefix to <code>/usr</code> or <code>/usr/local</code> may prove advantageous when it comes to installing things. Note that pre-built packages are not available as libfaac and libx264 cannot be distributed together for licencing reasons, and libfdk_aac will not work with most mobile devices. With ffmpeg installed the transcode command is something like: ffmpeg -i "rtmp://ystvstrm1.york.ac.uk/live/stream1 live=1" \ -vcodec libx264 -vprofile baseline -g 10 -s 640x360 -crf 28 \ -acodec libfaac -ar 44100 -ac 1 -aac f flv rtmp://localhost:1936/hls/stream1 This should probably be wrapped in an infinite while loop and librtmpset to run from an init script on boot.
webdev, jira-developers, confluence-administrators, jira-users, jira-administrators, stash-administrators, crowd-administrators, confluence-users, stash-users, domain users, domain admins, ladder trained, camera trained, lighting trained, computing team, directors, technical assistants
163
edits