Stream saving with FFmpeg.

This script assumes FFmpeg to be installed in %PATH%.

Create the following folder structure

../record-logirl.bat (this file)

../live/ (folder where the playlist file will reside)

../live/chunks/ (folder where all the stream chunks will be held)

../recording/ (folder where the full stream file will be placed)

If you install a webserver and have the root at /live/ you cn access the stream via the url http:// /logirl.m3u8 This could be useful if more than one person in the house wants to watch the stream but the internet connection only allows for one stream to run without interruption.

This script will re-emit the stream to ..\live\logirl.m3u8 you can open this file with VLC or any other media player that supports the format or use a webserver to access it from other computers.

@ECHO OFF REM make the following folder structure: REM ../record-logirl.bat REM ../live/ REM ../live/chunks/ REM ../recording/ REM defaults SET outputfile=recording/logirl_out-%RANDOM% SET length=50000 SET url=http://aka-liveportal01-live.uliza.jp/hls/video/liveportal01/liveportal01_channel01_3/chunklist.m3u8 SET muxer=ts :loop IF NOT "%1"=="" ( IF "%1"=="-out" ( SET outputfile=%2 SHIFT ) IF "%1"=="-mux" ( SET muxer=%2 SHIFT ) IF "%1"=="-len" ( SET length=%2 SHIFT ) IF "%1"=="-url" ( SET url=%2 SHIFT ) SHIFT GOTO :loop ) ECHO Outputfile = %outputfile%.%muxer% (This will be a %muxer% file) ECHO Length = %length% seconds ECHO URL = %url% echo Starting FFmpeg. rem this line will restream the stream so you can open the m3u8 file using vlc (just double click) ffmpeg -i %url% -t %length% -c copy %outputfile%.%muxer% -c copy -f hls -hls_flags delete_segments -hls_time 5 -hls_base_url chunks\ -hls_segment_filename live\chunks\logirl_chunk%%03d.ts live\logirl.m3u8 rem this line would stream via a pipe to vlc, I have had issues with that. rem ffmpeg -i %url% -t %length% -c copy %outputfile%.%muxer% -c copy -f mpegts - | "C:\Program Files\VideoLAN\VLC\vlc.exe" - echo Done if NOT ["%errorlevel%"]==["0"] ( pause exit /b %errorlevel% )

Save this as a .bat file somewhere with enough space.

Usage:

record-logirl.bat [options]

-url <url> : The stream url if you omit this it default to the LoGiRL stream URL used 19-01-2015 23:31 GMT+1 (No idea if they change that thing)

-len <seconds> : The number of seconds you want to record, if you omit this it will default to 50000 seconds.

-out <outputfilepath> : The output *.* file, if you omit this it will default to recording/logirl_out-%RANDOM%.%muxer& (relative to the current directory, and windows cmd's %RANDOM% is not super random so it might overwrite a file.) PLease don't include a file extenstion.

-mux <ts>: The output muxer. FFmpeg supports lots of formats in that case this is the file extension. ts is recommended and default.

Example:

record-logirl.bat -length 3600 -out "E:\raw_record_dump\streamname.ts"

Click to download.

You can also watch the stream here, even outside of Japan or here. (No idea how long that "mirror" lasts)