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 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; push rtmp://; } } }
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 [ SSHFS] with the allow_other option to mount that directory.
== FFmpeg == 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:// 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