I am trying to record a self hosted aac m3u8 hls stream to record for multiple hours at a time.
It is broadcasting in 10 second chunks at ~256k.
I am able to record this through vlc via the gui. I am able to record 6+ hours (longest I have tried but no reason it would not go longer). I am able to open and play the streams on multiple devices outside my network for hours and hours with zero drops. I had this setup on my older r610 server 2x X5650-12core, 64gb ram, perc h700 w/ 6x 600gb 10k sas drives. It is running Ubuntu 18.04(no virtualization bare metal install).
I am able to also record the stream at any specified length using streamlink with an aac output (same as input).
I can leave this run in a screen for a day and it works perfectly with playable/seekable output.Code:#!/bin/bash NOW=$(date +"%b-%d-%Y-%I-%Z") echo "Enter Channel Name [ID]:";read name; streamlink "hls://http://127.0.0.1:8888/$name.m3u8" best -o "$name-$NOW.aac"
I am also able to run this same command with a --hls-duration 00:00:00 and it will close out and save properly as well (with specified length).
The problem is whenever I try to output the file to an mp3 using ffmpeg it craps the bed at exactly 2 hours.
My guess is I am just missing some 'default' switch that I need to modify or something.
This script was setup to allow me to specify the channel to record via $name and output for a specified time (keep in mind I know the script side of this works just fine and is not the issue) I have run this outside of my script with same variables with same result.
Code:#!/bin/bash NOW=$(date +"%b-%d-%Y-%I-%Z") echo "Enter Channel Name [ID]:";read name; echo "Time To Record: [HR:MIN:SEC]";read length; ffmpeg -i http://127.0.0.1:8888/$name.m3u8 -acodec libmp3lame -ac 2 -ab 256k -t $length $name-$NOW.mp3
for whatever reason this starts off with no issue. It always ends at the two hour mark.. notice time=02:00:26.51.
So I had a couple of raspberry pi's laying around. I installed two different deb variants (rasbpian buster and ubuntu) on each of them. Got them all updated and all hosting the same content (streaming out on 127.0.0.1:8888). All three of them exit with the same error of Input/output err at the same time.... I am absolutly stumped... the resulting file is perfectly playable it just quits early.Code:.... [hls,applehttp @ 0x23f21e0] Opening 'crypto+http://127.0.0.1:8888/AAC_Data/howardstern100/HLS_howardstern100_256k_v3/howardstern10...0112987_v3.aac' for reading [hls,applehttp @ 0x23f21e0] Failed to reload playlist 0speed= 1x [hls,applehttp @ 0x23f21e0] Opening 'crypto+http://127.0.0.1:8888/AAC_Data/howardstern100/HLS_howardstern100_256k_v3/howardstern10...0112988_v3.aac' for reading http://127.0.0.1:8888/howardstern100.m3u8: Input/output error size= 225830kB time=02:00:26.51 bitrate= 256.0kbits/s speed= 1x video:0kB audio:225829kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000381% R610:~ $
Again, I am able to record the stream with streamlink and output to an aac file. So I figured ok I have the time to play around what if I pull the file with streamlink and then convert the aac file to mp3 with ffmpeg. This also results in an error
It records the aac file correctly and breaks that operation at the specified time. Then when ffmpeg is called it craps itself. Reports back:
xxxx.aac Invalid data found while processing input.
So I then thought ok so I will run it through ffmpeg to fix anything possibly wrong with the aac file first with the script below. This also reports the same error when ffmpeg opens the aac file for processing
Code:#!/bin/bash NOW=$(date +"%b-%d-%Y-%I-%Z") echo "Enter Channel Name [ID]:";read name; echo "Time To Record: [HR:MIN:SEC]";read length; #/usr/bin/ffmpeg -i http://127.0.0.1:8888/$name.m3u8 -c copy -t $length $name-$NOW.aac streamlink "hls://http://127.0.0.1:8888/$name.m3u8" best --hls-duration $length -o "$name-$NOW.aac" sleep 5s ffmpeg -i $name-$NOW.aac -c copy $name-$NOW-fixed.aac ffmpeg -i $name-$NOW-fixed.aac -ab 256k $name-$NOW.mp3
I am completely at a loss as to what else to try. I have this running on three different pieces of hardware. All updated to the latest release versions..
I have been unsuccessful at getting vlc to run from the cli (otherwise I would obviously just do that). If anyone can give me any pointers there that would be rad. Here are the VLC outputs from the gui prior to me streaming (which works)..
Any help would be much appreciated. I have spent literally days playing with this with no luck..Code::sout=#transcode{vcodec=none,acodec=mp3,ab=256,channels=2,samplerate=44100,scodec=none}:file{dst=/home/name/Desktop/outputfile.mp3,no-overwrite} :no-sout-all :sout-keep
Neil
+ Reply to Thread
Results 1 to 3 of 3
-
-
[Attachment 52690 - Click to enlarge]
You can see all three boxes with same errored output after 2 hours... all three boxes can save via vlc gui or streamlink for many hours. It has to be something simple I am missing. Thanks again
Neil
Similar Threads
-
Handbrake without FDK-AAC, new FFMPEG AAC encoder viable alternative?
By jaggy in forum Video ConversionReplies: 15Last Post: 27th Apr 2017, 10:31 -
livestreamer vs ffmpeg vs streamlink for downloading m3u8?
By nobodyhome in forum Newbie / General discussionsReplies: 0Last Post: 15th Mar 2017, 01:10 -
Error in Download of Stream with ffmpeg HLS
By 4lb3rt0 in forum Video Streaming DownloadingReplies: 0Last Post: 25th Sep 2016, 09:11 -
Need your help with HTTPS Stream recording via FFMPEG (Key File, Cookies)
By snasdkind in forum Video Streaming DownloadingReplies: 1Last Post: 2nd Aug 2016, 18:01 -
Creating HLS variants with FFMPEG
By madkap in forum Video ConversionReplies: 1Last Post: 21st Oct 2015, 03:41