Jump to content

Recording Failures From IPTV m3u .ts sources


maegibbons

Recommended Posts

maegibbons

Hi

 

I record from both HDhomerun and m3u sources.

 

Generally all works good.  Thank you.

 

Ocaasionally, due to brief internet outages the IPTV streams get "lost".

 

But the emby copystream process does not appear to detect this.  Whilst nothing more is written to the local .ts file the recording is only closed at the scheduled end time.  The length of the recording is properly shown to the time that the interruption happened.

 

Can this be improved at all so that if the bitrate goes to 0 or well below average stream rate that the copy is restarted just like what happens if i restarted the server and goes to a -1 filename?

 

I enclose the server log from last night.  2 IPTV recordings, Elementary and Pawn Stars, started at 20:58.  Both stream copies ended up being 8 minutes long.  However, Emby closes the Pawn star copy at 21:32 and Elementart at 22:03.

 

So something "internet" happened at 21:06 which killed the streams.  The stream copy process did not detect this or try to recover from it.

 

I have seen this quite a few times so thought I should bring it up as an issue.

 

Krs

 

Mark

server-streamcopy.txt

Link to comment
Share on other sites

maegibbons

Ok - I can try that - thankls for the suggestion.

 

Can you explain why that should help?

 

krs

 

Mark

Link to comment
Share on other sites

maegibbons

Hi

 

@@Luke

 

Th\t did not turn out too well.  record transcoding to MKV gives:

{"Protocol":"Http","Id":"1a968ad5c2924255847f41441a46b96d_4da96c9e29af639d1c9988c53e754f04","Path":"http://ace-iptv.xyz:4545/live/xxxxxxxxxx/xxxxxxxxxx/640.ts","Type":"Default","IsRemote":true,"ReadAtNativeFramerate":false,"SupportsTranscoding":true,"SupportsDirectStream":false,"SupportsDirectPlay":true,"IsInfiniteStream":true,"RequiresOpening":true,"RequiresClosing":true,"SupportsProbing":true,"MediaStreams":[{"IsInterlaced":true,"IsDefault":false,"IsForced":false,"Type":"Video","Index":-1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false},{"DisplayTitle":"","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":-1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false}],"PlayableStreamFileNames":[],"Formats":[],"RequiredHttpHeaders":{}}

/usr/bin/ffmpeg -fflags +genpts -async 1 -vsync -1 -analyzeduration 5000000 -i "http://ace-iptv.xyz:4545/live/xxxxxxxxxx/xxxxxxxxxx/640.ts" -t 00:13:55.577 -map 0 -codec:v:0 copy -map_metadata -1 -threads 0 -codec:a:0 copy -y "/mnt/Multimedia/Videos/Recordings/Series/Rizzoli & Isles/Season 3/Rizzoli & Isles S03E01 What Doesn't Kill You-10.mkv"


ffmpeg version 2.8.10-0ubuntu0.16.04.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mpegts, from 'http://ace-iptv.xyz:4545/live/xxxxxxxxxx/xxxxxxxxxx/640.ts':
  Duration: N/A, start: 7860.047400, bitrate: N/A
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 125 kb/s
[matroska @ 0xfae620] Codec for stream 0 does not use global headers but container format requires global headers
[matroska @ 0xfae620] Codec for stream 1 does not use global headers but container format requires global headers
[matroska @ 0xfae620] Error parsing AAC extradata, unable to determine samplerate.
Output #0, matroska, to '/mnt/Multimedia/Videos/Recordings/Series/Rizzoli & Isles/Season 3/Rizzoli & Isles S03E01 What Doesn't Kill You-10.mkv':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 1k tbn, 90k tbc
    Stream #0:1: Audio: aac ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, 125 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

That was to MKV.  It created about 10 files in a fraction of a second

 

I tried MP4 which starts recording BUT i cannot seem to play them as "Active Recordings".

 

So not sure this is the right way to go.

 

Krs

 

Mark

Link to comment
Share on other sites

maegibbons

If you are talking LiveTV then in the Live tv section - add a tuner of type m3u.

 

Any issues start a new thread. Otherwise this issue i am reporting gets lost.

 

Krs

 

Mark

Link to comment
Share on other sites

maegibbons

Hi

 

You have had my m3u before but I have resent it to you by PM.

 

Krs

 

Mark

Link to comment
Share on other sites

there must be a stream specific issue here. using the first url in your m3u i am not having any problems. that's both with and without recording conversion enabled.

Link to comment
Share on other sites

maegibbons

Firstly,  thanks for looking.  I do not like to waste your time.

 

I will investigate further because I literally tried one recording (which I think was Alibi Channel) and got the mkv transode issue above.  Tried MP4 and got the unable to play "Active Recordings" problem.

 

When not record-transcoding The IPTV streamcopy failure only happens infrequently when I loose internet. The issue is that It appears that the streamcopy process does not detect this. I will see if I can prove this also by cutting my internet connection deliberately.

 

I am away for the beginning of next week but will try and test this all out and come back with definitive failure scenario's for you to test.

 

Krs

 

Mark

Link to comment
Share on other sites

maegibbons

Not sure I relayed previously that the file system time stamp stops when the streamcopy process fails.

 

An example:  Tonight i was recording "Lord of the Rings".  It is now 21.11 but the last write to the .ts file was 20:31 so I know this recording has stopped.  Emby still thinks it is recording and will close the file when the end timer strikes in an hour or so (and update the time stamp). However, the runtime will be about 1hr i.e truncated. The streamcopy process should be able to detect the lack of stream writes, when it happenned at 20:31, and restart the streamcopy to a "-1" file.

 

Krs

 

Mark

Link to comment
Share on other sites

  • 3 weeks later...
maegibbons

Hi

 

@@Luke

 

So I revisited this after seeing a post you made on fixing muliple mkv files on transcode error. https://emby.media/community/index.php?/topic/31222-3058863651-recording-conversion/?p=423223

 

Before moving on to m3u's I thought I would just try to record HDhomerun streams and transcode to MKV.  Even this does not work and now produces no mkv files at all.  I emclose ffmpeg log herewith - ffmpeg-mkv.

 

I then tried MP4.  The transcode works. log enclosed ffmpeg-mp4-badaspect, BUT  firstly you cannot play it as an "Active Recording".  When it finishes, I still cannot play it in the web browser and on Fire TV the aspect ratio is wrong AND it is transcoding AGAIN - ffmpeg-firetv !!!! 

 

Recording transcoding is a complete fail here at the moment!   

 

Is there no chance of just doing some checking in the streamcopy routine to see if the input stream has stalled to address the original issue in this thread?  My other concern is CPU load on transcoding at the recording stage.  I sometimes record 6 streams at once which is fine when streamcopying but would be quite a load transcoding ALL input streams at the same time even if it worked and had the desired effect in detecting stream stall.

 

Many thanks for your help.

 

Krs

 

Mark

ffmpeg-mkv-fail.txt

ffmpeg-mp4-badaspect.txt

ffmpeg-firetv.txt

Edited by maegibbons
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...