Audio/video stream recording forums
|
Attention Visitor: |
You may have to register or log in before you can post:
|
|
|
Thread Tools | Display Modes |
#51
|
|||
|
|||
Re: Can somebody help get filmon rtmp code to play with livestreamer?Livestreamer
File output options: -o FILENAME, --output FILENAME Write stream data to FILENAME instead of playing it. You will be prompted if the file already exists. -f, --force When using -o, always write to file even if it already exists. -O, --stdout Write stream data to stdout instead of playing it. |
#52
|
|||
|
|||
Re: Can somebody help get filmon rtmp code to play with livestreamer?Laj,
here is HRTV recorded as one continuous file. You can play it with a player "as it goes", but player may stumble or fall now and then. Recorded file will be of acceptable standard. @title hrtvVLCrtmp.bat @if "%time:~0,1%" == " " (set d=%date:~-4%%date:~3,2%%date:~0,2%0%time:~1,1%%time:~3,2%%ti me:~6,2%) ^ else (set d=%date:~-4%%date:~3,2%%date:~0,2%%time:~0,2%%time:~3,2%%tim e:~6,2%) :start @for /f %%x in ('hrtv.exe') do @set var=%%x vlc.exe %var% --sout=file{append}/ts:hrtv_%d%.mpg :loop @for /f %%y in ('hrtv.exe') do @set var2=%%y if "%var%"=="%var2" goto loop goto start For this to work you need these files in the same location and vlc on the path, and to make an effort and compile hrtv.au3 with autoit to get hrtv.exe. hrtvVLCrtmp.bat hrtv.exe curl.exe Recorded file will look something like this: hrtv_201701131915.mpg ;hrtv.au3 RunWait( 'cmd.exe /c curl -A Mozilla/5.0 -s http://www.filmon.com/api-v2/channel/694?protocol=rtmp | CLIP','', @SW_HIDE ) $sData = ClipGet() $first = StringInStr( $sData, '"quality":"high","url":"' ) + 23 $sData = StringTrimLeft( $sData, $first ) $last = StringLen( $sData ) - ( StringInStr( $sData, '","watch-timeout":0}]' ) - 1 ) $sData = StringTrimRight( $sData, $last ) & '/694.high.stream' ConsoleWrite( $sData & @CRLF ) autoit: https://www.autoitscript.com/site/autoit/downloads/ autoit-v3.zip Aut2Exe.exe /in hrtv.au3 curl: http://www.paehl.com/open_source/?CURL_7.51.0 curl_751_0.zip https://wiki.videolan.org/Documentat...Save_a_Stream/ Last edited by j_cool : 01-14-2017 at 03:14 AM. Reason: time stamp improved |
#53
|
|||
|
|||
Re: Can somebody help get filmon rtmp code to play with livestreamer?j cool,
Thanks for working on this filmon code for me! I have never used autoit or curl before. What should I do first? Thanks again buddy! |
#54
|
|||
|
|||
Re: Can somebody help get filmon rtmp code to play with livestreamer?It appears to be that you are the only one on the internet watching HRTV and me and Ihry
only ones interested about how it all works. I find it amazing. Confused says: Livestreamer ! The only problem with livestreamer is that it's error messages are not so descriptive, it says only 403, forbidden. FFplay is a little more explainatory saying: cookie missing, though it is questionable because I can play first chunk, and then break. So with HLS. RTMP can be done with livestreamer but it would require longer code to get parameters right. It would be great to get this working in HLS as well, I started to look to spoof cookie on command line for the start, but is it cookie or not, it would be great to hear from other members. |
#55
|
|||
|
|||
Re: Can somebody help get filmon rtmp code to play with livestreamer?Back to VLC:
First thing to do is to make sure your VLC works everywhere in windows. on command line type: path, press enter key. You should see something like this: C:\>path PATH=C:\Windows\system32;C:\Windows;C:\Windows\Sys tem32\Wbem;C:\Windows\System32\WindowsPowerShell\v 1.0\;C:\P\GnuWin32\b in;C:\AP;C:\AP\7Z;C:\AP\FF;C:\AP\RDUMP;C:\P\M;C:\P \VLC;C:\P\LIVESTR;C:\Program Files (x86)\Java\jre1.8.0_111\bin If you don't see location of your vlc.exe here you will have to replace vlc.exe in batch file with full path to wherever your vlc.exe is: "C:\Program Files ...\vlc.exe" To make this organized create directory C:\HRTV and copy to it all files required: C:\HRTV>dir /b /on curl.exe HRTV.au3 HRTV.exe - this one you will get after you compile hrtv.au3 with autoit. hrtvVLCrtmp.bat Create txt file and name it: hrtvVLCrtmp.bat, copy code from below and paste it in. :start for /f %%x in ('hrtv.exe') do set var=%%x vlc.exe %var% --sout=file{append}/ts:hrtv.mpg :loop for /f %%y in ('hrtv.exe') do set var2=%%y if "%var%"=="%var2" goto loop goto start This is the simplest code possible it can be. Batch file will create hrtv.mpg file. This batch file will start working only when you start it and stop only when you kill it. If you let it run it will never stop, appending chunks untill your disk is full and PC stops working. If you come in situation that you cannot stop it for some reason beyond me, switch the power button on your PC off. Restart the PC, and batch file will not run again unless you start it again. After you finish with recording rename hrtv.mpg to something else or delete it. If you leave it, next time you run batch file it will continue appending to saved hrtv.mpg. To play the stream while it is being recorded, to get uninterupted play start playing when there is some of this stream already saved on the disk, ideally after second chunk had started recording. Download curl_752_1.zip from this link and unzip it, there will be only one file inside zip, curl.exe. http://www.paehl.com/open_source/?CURL_7.52.1 CURL 7.52.1 Download WITHOUT SSL create txt file, name it htrv.au3, copy code from below and paste it in. RunWait( 'cmd.exe /c curl -A Mozilla/5.0 -s http://www.filmon.com/api-v2/channel/694?protocol=rtmp | CLIP','', @SW_HIDE ) $sData = ClipGet() $first = StringInStr( $sData, '"quality":"high","url":"' ) + 23 $sData = StringTrimLeft( $sData, $first ) $last = StringLen( $sData ) - ( StringInStr( $sData, '","watch-timeout":0}]' ) - 1 ) $sData = StringTrimRight( $sData, $last ) & '/694.high.stream' ConsoleWrite( $sData & @CRLF ) Download autoit from here: https://www.autoitscript.com/site/autoit/downloads/ Download zip: autoit-v3.zip unzip it wherever you like and you will get directory: install: C:\install>dir /b /on Aut2Exe AutoItX Examples Extras Icons Include SciTe Au3Check.dat Au3Check.exe Au3Info.exe Au3Info_x64.exe AutoIt v3 Website.url AutoIt.chm AutoIt3.exe AutoIt3_x64.exe AutoIt3Help.exe change to directory Aut2Exe and copy to it hrtv.au3, content should look like this: C:\install\Aut2Exe>dir /o/b Icons Aut2exe.exe Aut2exe_x64.exe HRTV.au3 upx.exe on command line type this and press enter: C:\install\Aut2Exe>Aut2exe.exe /in hrtv.au3 This will create hrtv.exe Now, when you have it all together inside HRTV directory double click on hrtvVLCrtmp.bat and cmd window and minimal vlc will pop up ( no stream to see ) and stream will be recording to hrtv.mpg. After every chunk vlc will close and pop-up again every 2 minutes, and in between while waiting for next chunk to start. This all can be made invisible and better and would require longer code. So long for now, this post is Marathon, you can always ask for more details. |
#56
|
|||
|
|||
Re: Can somebody help get filmon rtmp code to play with livestreamer?You are a...
VIRUS ! |
#57
|
|||
|
|||
Re: Can somebody help get filmon rtmp code to play with livestreamer?If you don't see the stream, don't panic.
HRTV is not on the air for 24 hours as they claim they are. It can be seen if the stream is on the air or not. title hrtvFFplayHLS.bat :start for /f %%x in ('hrtvhls.exe') do set var=%%x ffplay.exe %var% :loop for /f %%a in ('hrtvhls.exe') do set var2=%%a if "%var%"=="%var2" goto loop goto start ;HRTVhls.au3 RunWait( 'cmd.exe /c curl -A Mozilla/5.0 -s http://www.filmon.com/api-v2/channel/694?protocol=hls | CLIP','', @SW_HIDE ) $sData = ClipGet() $first = StringInStr( $sData, '"quality":"high","url":"' ) + 23 $sData = StringTrimLeft( $sData, $first ) $last = StringLen( $sData ) - ( StringInStr( $sData, '","watch-timeout":0}]' ) - 1 ) $sData = StringTrimRight( $sData, $last ) ConsoleWrite( $sData & @CRLF ) If the stream in not on the air HLS protocol will kindly display "no stream available". If the stream is on the air, FFplay with play the first chunk and than close and cmd winow will display this: Invalid cookie found, no value, path or domain specified HTTP error 403 Forbidden C:\MISC\NEWS\OLD>title hrtvFFplayHLS.bat C:\MISC\NEWS\OLD>for /F %x in ('hrtvhls.exe') do set var=%x C:\MISC\NEWS\OLD>set var=http://edge-1130-us-la.filmon.com/live/694.high.stream/playlist.m3u8?id=035bca1a71b11fce016d28a cd3dbea51cbc96ddfe5b9ed3f8fe3286df6a738d375aa36816 6afe1c544fac31ebd9183124b6180e7293350017211533d3d9 5c1917da58560961e8ce 5fe018251de42102ef4e275dcb90600a49519c597eb2e0ff4f fc7d19f308722ebefab04390e61dba20d1a8dda36683cdff46 718d96f39537d3ebffb8 5c0d6c2725b1dd7d3d8ff05e6098f990831bd324c C:\MISC\NEWS\OLD>ffplay.exe http://edge-1130-us-la.filmon.com/li...1a71b11fce016d 28acd3dbea51cbc96ddfe5b9ed3f8fe3286df6a738d375aa36 8166afe1c544fac31ebd9183124b6180e7293350017211533d 3d95c1917da58560961e 8ce5fe018251de42102ef4e275dcb90600a49519c597eb2e0f f4ffc7d19f308722ebefab04390e61dba20d1a8dda36683cdf f46718d96f39537d3ebf fb85c0d6c2725b1dd7d3d8ff05e6098f990831bd324c ffplay version 3.2.2 Copyright (c) 2003-2016 the FFmpeg developers built with gcc 5.4.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable -bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-li bbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enabl e-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-li bopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en able-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable -libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zl ib libavutil 55. 34.100 / 55. 34.100 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.100 / 57. 56.100 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 [http @ 04933140] Invalid cookie found, no value, path or domain specified Input #0, hls,applehttp, from 'http://edge-1130-us-la.filmon.com/live/694.high.stream/playlist.m3u8?id=035bca1a71b11fce0 16d28acd3dbea51cbc96ddfe5b9ed3f8fe3286df6a738d375a a368166afe1c544fac31ebd9183124b6180e72933500172115 33d3d95c1917da585609 61e8ce5fe018251de42102ef4e275dcb90600a49519c597eb2 e0ff4ffc7d19f308722ebefab04390e61dba20d1a8dda36683 cdff46718d96f39537d3 ebffb85c0d6c2725b1dd7d3d8ff05e6098f990831bd324c': Duration: N/A, start: 66479.104856, bitrate: N/A Program 0 Metadata: variant_bitrate : 0 Stream #0:0: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p, 720x480 [SAR 40:33 DAR 20:11], Closed Caption s, 29.97 tbr, 90k tbn, 59.94 tbc Metadata: variant_bitrate : 0 Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp Metadata: variant_bitrate : 0 Stream #0:2: Data: timed_id3 (ID3 / 0x20334449) Metadata: variant_bitrate : 0 [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 06820880] HTTP error 403 Forbidden= 78KB sq= 0B f=0/0 [hls,applehttp @ 0492e700] Failed to reload playlist 0 [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 06820880] HTTP error 403 Forbidden= 49KB sq= 0B f=0/0 [hls,applehttp @ 0492e700] Failed to reload playlist 0 [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 06820880] HTTP error 403 Forbidden= 11KB sq= 0B f=0/0 [hls,applehttp @ 0492e700] Failed to reload playlist 0 [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 06820880] HTTP error 403 Forbidden= 0KB sq= 0B f=0/0 [hls,applehttp @ 0492e700] Failed to reload playlist 0 [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 06820880] HTTP error 403 Forbidden= 0KB sq= 0B f=0/0 [hls,applehttp @ 0492e700] Failed to reload playlist 0 0B f=0/0 [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 06820880] HTTP error 403 Forbidden= 0KB sq= 0B f=0/0 [hls,applehttp @ 0492e700] Failed to reload playlist 0 [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 06820880] HTTP error 403 Forbidden= 0KB sq= 0B f=0/0 [hls,applehttp @ 0492e700] Failed to reload playlist 0 [http @ 04933140] Invalid cookie found, no value, path or domain specified [http @ 06820880] HTTP error 403 Forbidden= 0KB sq= 0B f=0/0 Terminate batch job (Y/N)? 2 aq= 0KB vq= 0KB sq= 0B f=0/0 |
#58
|
|||
|
|||
Re: Can somebody help get filmon rtmp code to play with livestreamer?Livestreamer is replaced with Streamlink.
Links to new filmon plug-in: https://github.com/streamlink/streamlink/issues/507 https://github.com/beardypig/streaml...gins/filmon.py set url=http://www.filmon.com/channel/bbc-news streamlink --http-header "User-Agent=Mozilla/5.0" --player "ffplay.exe -vf scale=854:480" %url% worst Last edited by j_cool : 01-30-2017 at 12:31 PM. |
#59
|
|||
|
|||
Re: Can somebody help get filmon rtmp code to play with livestreamer?Laj,
you can try solution for HRTV from here: https://github.com/streamlink/streamlink/issues/510 May work for you. Cheers, Johnny. |
#60
|
|||
|
|||
Re: Can somebody help get filmon rtmp code to play with livestreamer?Last edited by j_cool : 01-31-2017 at 10:52 AM. Reason: changing fast |
Tags: filmon, livestreamer |
Thread Tools | |
Display Modes | |
|
|