I put together a transcoding command (batch script) which creates a 'streamable' result for an iPad/iPhone. It's basically a combination of ffmpeg and a tool called 'segmenter'. There are already a few documents out there where the detailed usage and parameters are discussed (and where I got the information from), but very briefly this is how it works:
1) ffmpeg creates the right format (-f mpegts ...) and pipes it into segmenter.exe
2a) segmenter.exe cuts the stream (video/audio) into chunks of 10s and stores those 'stream-chunks' in files in a web-accessible folder
2b) segmenter.exe creates/updates a .m3u8 playlist and removes old files - so there always less than e.g. 10 files in that folder
3) manually point Safari to the .m3u8 playlist ... and the video/audio starts playing
- Code: Select all
@echo off
@setlocal
@cd c:\subsonic\transcode
set fmpg=-loglevel quiet -f mpegts -acodec libmp3lame -ar 44100 -ab 64k -s 640x360 -vcodec libx264 -b 400k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 50k -maxrate 256k -bufsize 40k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect 640:360 -g 90 -vsync 0 -async 1
set segmenter=c:\subsonic\transcode\segmenter\segmenter.exe - 10 ipad/segment ipad/stream.m3u8 "http://www.yourdomain.com/" 5 1
ffmpeg -i %1 %fmpg% - |%segmenter%
This '.bat' script is called through a transcoding setting ("script.bat %s"), which in turn needs to be enabled for the player you are using.
Well, it is probably not the most elegant way the get streaming working on iPad/iPhone, but at least it's an iPad/iPhone-streamable solution.
Now, the downside is that the 'streaming' is done outside subsonic (don't bother if the player is set to 'Web Player,'External'...). This might be the reason why the 'handle' between subsonic and the transcoding script is lost (please correct if I am wrong ... at least this is happening on my system).
So, the issue is that subsonic starts the transcoding-script, but it's not able to stop the transcoding-script/process anymore until it's finished, unless you kill it from the server's task-manager.
Any improvements on this approach or any ideas how the stop the transcoding?
Tom