Mailing List Archive

IPTV recorder seems broken -- large jumpy files
I have been trying to use the IPTV recorder to record from a particular
HLS stream.

The files resulting from this recording are on the order of 10GB per
hour, which is ridiculous. They also "jump" around while trying to
play them, even with something as generic as mplayer.

I have used "ffmpeg -acodec copy -vcodec copy" to record from the exact
same m3u8 that I am giving to the IPTV recorder and I get something
more reasonably on the order of 1GB per hour and perfectly playable.

I wonder if anyone else has experienced anything similar.

I wonder if anyone has written an "external recorder" around ffmpeg as
a stream copier that they want to share as an alternative to the IPTV
recorder.

Cheers,
b.
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On 03/03/18 23:32, Brian J. Murrell wrote:
> I have been trying to use the IPTV recorder to record from a particular
> HLS stream.
>
> The files resulting from this recording are on the order of 10GB per
> hour, which is ridiculous. They also "jump" around while trying to
> play them, even with something as generic as mplayer.
>
> I have used "ffmpeg -acodec copy -vcodec copy" to record from the exact
> same m3u8 that I am giving to the IPTV recorder and I get something
> more reasonably on the order of 1GB per hour and perfectly playable.
>
> I wonder if anyone else has experienced anything similar.
>
> I wonder if anyone has written an "external recorder" around ffmpeg as
> a stream copier that they want to share as an alternative to the IPTV
> recorder.
>
> Cheers,
> b.
>
Have you tried using ffmpeg -i or mediainfo or something equivalent to
compare the file created by mythtv to the file created from ffmpeg? I
would be curious to know what was in the big file that was making it so big.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On 18/03/18 08:41, Mark Perkins wrote:
>
> On 03/03/18 23:32, Brian J. Murrell wrote:
>> I have been trying to use the IPTV recorder to record from a particular
>> HLS stream.
>>
>> The files resulting from this recording are on the order of 10GB per
>> hour, which is ridiculous. They also "jump" around while trying to
>> play them, even with something as generic as mplayer.
>>
>> I have used "ffmpeg -acodec copy -vcodec copy" to record from the exact
>> same m3u8 that I am giving to the IPTV recorder and I get something
>> more reasonably on the order of 1GB per hour and perfectly playable.
>>
>> I wonder if anyone else has experienced anything similar.
>>
>> I wonder if anyone has written an "external recorder" around ffmpeg as
>> a stream copier that they want to share as an alternative to the IPTV
>> recorder.
>>
>> Cheers,
>> b.
>>
> Have you tried using ffmpeg -i or mediainfo or something equivalent to
> compare the file created by mythtv to the file created from ffmpeg? I
> would be curious to know what was in the big file that was making it so big.
> _______________________________________________
>
Just to put some additional words around this. I use the IPTV recorder
functionality for my recordings. I have a box with USB DVB-T tuners
attached that runs mumudvb to rebroadcast the streams to multicast IP. I
can then subscribe to those streams from as many mythbackends as I like
simultaneously from anywhere on my network. I picked a SD recording from
the news last night which was 588MiB for 27min which is fairly
comparable to your 1GB per hour. So I don't think your large file sizes
are necessarily a problem with the IPTV recorder functionality but
perhaps related to what is specifically being transmitted in the stream.
Although I have no immediate suggestions as to what the IPTV recorder
functionality is including that is quite large in size but is excluded
by "ffmpeg -acodec copy -vcodec copy".

If I had to guess, based on your sizes, perhaps the IPTV recorder has
recorded an entire multiplex not just a specific channel / stream?
Mediainfo or ffmpeg on the file should reveal more.

Here are some stats from my news recording:

$ ls -alh 1002_20180317093300.ts
-rw-rw-r--. 1 mythtv mythtv 562M Mar 17 20:30 1002_20180317093300.ts

$ ffmpeg -i 1002_20180317093300.ts
ffmpeg version N-90289-g8fb0e51 Copyright (c) 2000-2018 the FFmpeg
developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-16)
  configuration: --prefix=/root/ffmpeg_build
--pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include
--extra-ldflags=-L/root/ffmpeg_build/lib --extra-libs='-lm -lpthread'
--bindir=/usr/local/bin --enable-gpl --enable-libfdk_aac
--enable-libfreetype --enable-libmp3lame --enable-libopus
--enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
  libavutil      56.  9.100 / 56.  9.100
  libavcodec     58. 14.100 / 58. 14.100
  libavformat    58. 10.100 / 58. 10.100
  libavdevice    58.  2.100 / 58.  2.100
  libavfilter     7. 13.100 /  7. 13.100
  libswscale      5.  0.102 /  5.  0.102
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
[mp3 @ 0x3f69840] Header missing
[mpegts @ 0x3f63980] PES packet size mismatch
[mpegts @ 0x3f63980] Could not find codec parameters for stream 3
(Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize'
options
[mpegts @ 0x3f63980] Could not find codec parameters for stream 4
(Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize'
options
Input #0, mpegts, from '1002_20180317093300.ts':
  Duration: 00:27:02.82, start: 9533.651444, bitrate: 2900 kb/s
  Program 1
    Stream #0:0[0x200]: Video: mpeg2video (Main) ([2][0][0][0] /
0x0002), yuv420p(tv, bt470bg, top first), 720x576 [SAR 64:45 DAR 16:9],
25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x28a]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
stereo, s16p, 256 kb/s
    Stream #0:2[0x240](eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:3[0x157d]: Unknown: none ([11][0][0][0] / 0x000B)
    Stream #0:4[0x157c]: Unknown: none ([5][0][0][0] / 0x0005)
At least one output file must be specified


$ mediainfo 1002_20180317093300.ts
General
ID                                       : 593 (0x251)
Complete name                            : 1002_20180317093300.ts
Format                                   : MPEG-TS
File size                                : 561 MiB
Duration                                 : 27 min 2 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 2 901 kb/s

Video
ID                                       : 512 (0x200)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@Main
Format settings                          : CustomMatrix / BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : Variable
Format settings, picture structure       : Frame
Codec ID                                 : 2
Duration                                 : 27 min 2 s
Bit rate mode                            : Variable
Bit rate                                 : 2 499 kb/s
Maximum bit rate                         : 6 000 kb/s
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 FPS
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.241
Stream size                              : 483 MiB (86%)
Writing library                          : xec 7.1.18
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.470 System B, BT.470 System G
Matrix coefficients                      : BT.470 System B, BT.470 System G

Audio
ID                                       : 650 (0x28A)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 3
Duration                                 : 27 min 2 s
Bit rate mode                            : Constant
Bit rate                                 : 256 kb/s
Maximum bit rate                         : 272 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -419 ms
Stream size                              : 49.5 MiB (9%)

Text
ID                                       : 576 (0x240)-801
Menu ID                                  : 1 (0x1)
Format                                   : Teletext Subtitle
Language                                 : English

Menu
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
List                                     : 512 (0x200) (MPEG Video) /
650 (0x28A) (MPEG Audio) / 576 (0x240)-801 (Teletext Subtitle, en)
Language                                 :  /  / English
Maximum bit rate                         : 6726000


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On Sat, 2018-03-17 at 22:58 +0000, Mark Perkins wrote:
>
> On 18/03/18 08:41, Mark Perkins wrote:
> >
> > Have you tried using ffmpeg -i or mediainfo or something equivalent
> > to
> > compare the file created by mythtv to the file created from ffmpeg?

I didn't. I ended up replacing the IPTV recorder with my own External
recorder based on "ffmpeg -i "$URL" -acodec copy -vcodec copy -f
mpegts"

> Just to put some additional words around this. I use the IPTV
> recorder
> functionality for my recordings. I have a box with USB DVB-T tuners
> attached that runs mumudvb to rebroadcast the streams to multicast
> IP. I
> can then subscribe to those streams from as many mythbackends as I
> like
> simultaneously from anywhere on my network. I picked a SD recording
> from
> the news last night which was 588MiB for 27min which is fairly
> comparable to your 1GB per hour. So I don't think your large file
> sizes
> are necessarily a problem with the IPTV recorder functionality but
> perhaps related to what is specifically being transmitted in the
> stream.

No disagreement. ffmpeg seems to handle whatever is in the stream
better than mythtv though, which is what is interesting about it. The
URL I am recording from is:

https://cbclivedai5-i.akamaihd.net/hls/live/567235/event2/CBOT/master1.m3u8

I wouldn't be surprised if it's geoblocked outside of Canada though.

> If I had to guess, based on your sizes, perhaps the IPTV recorder
> has
> recorded an entire multiplex not just a specific channel / stream?

I'm not sure it's that simple. I think it's more related to the
jumpiness. By jumpiness I mean that it will play a few minutes of the
recording and then seemingly go back to the beginning but this time
play a few more minutes than last time but then again, jump back to the
beginning and play yet a longer segment. I doubt there is any actual
jumping around in the stream and it's more like the stream is being
repeatedly written to the file from the beginning with each segment
writing a few more minutes than the last one.

Cheers,
b.
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On Sun, Mar 18, 2018 at 1:57 PM, Brian J. Murrell <brian@interlinx.bc.ca>
wrote:

> On Sat, 2018-03-17 at 22:58 +0000, Mark Perkins wrote:
> >
> > On 18/03/18 08:41, Mark Perkins wrote:
> > >
> > > Have you tried using ffmpeg -i or mediainfo or something equivalent
> > > to
> > > compare the file created by mythtv to the file created from ffmpeg?
>
> I didn't. I ended up replacing the IPTV recorder with my own External
> recorder based on "ffmpeg -i "$URL" -acodec copy -vcodec copy -f
> mpegts"
>
>
Would you mind sharing your script or code to do this? I am looking at
doing something like this myself with my TBS2603 HDMI to IP encoder due to
some Live TV issues with the IPTV recorder.


Thanks!

-Greg
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On Sun, Mar 18, 2018 at 12:55 PM Greg Thompson <gthompson20@gmail.com>
wrote:

> On Sun, Mar 18, 2018 at 1:57 PM, Brian J. Murrell <brian@interlinx.bc.ca>
> wrote:
>
>> On Sat, 2018-03-17 at 22:58 +0000, Mark Perkins wrote:
>> >
>> > On 18/03/18 08:41, Mark Perkins wrote:
>> > >
>> > > Have you tried using ffmpeg -i or mediainfo or something equivalent
>> > > to
>> > > compare the file created by mythtv to the file created from ffmpeg?
>>
>> I didn't. I ended up replacing the IPTV recorder with my own External
>> recorder based on "ffmpeg -i "$URL" -acodec copy -vcodec copy -f
>> mpegts"
>>
>>
> Would you mind sharing your script or code to do this? I am looking at
> doing something like this myself with my TBS2603 HDMI to IP encoder due to
> some Live TV issues with the IPTV recorder.
>

Hi Greg,

Do you know c++? If you want a full c++ example of writing an external
recorder, you can look at https://github.com/jpoet/HauppaugeUSB . That is
for the Colossus2 which uses usb, but you could replace that part with some
ffmpeg code.

That being said, I would not mind seeing what Brian came up with for
ffmpeg. There are times when such an interface would be useful.

John
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On Sun, 2018-03-18 at 19:12 +0000, John P Poet wrote:
> On Sun, Mar 18, 2018 at 12:55 PM Greg Thompson <gthompson20@gmail.com
> > wrote:
> > On Sun, Mar 18, 2018 at 1:57 PM, Brian J. Murrell <brian@interlinx.
> > bc.ca> wrote:
> > > On Sat, 2018-03-17 at 22:58 +0000, Mark Perkins wrote:
> > >
> > > >
> > >
> > > > On 18/03/18 08:41, Mark Perkins wrote:
> > >
> > > > >
> > >
> > > > > Have you tried using ffmpeg -i or mediainfo or something
> > > equivalent
> > >
> > > > > to
> > >
> > > > > compare the file created by mythtv to the file created from
> > > ffmpeg?
> > >
> > >
> > >
> > > I didn't. I ended up replacing the IPTV recorder with my own
> > > External
> > >
> > > recorder based on "ffmpeg -i "$URL" -acodec copy -vcodec copy -f
> > >
> > > mpegts"
> > >
> > >
> > >
> >
> > Would you mind sharing your script or code to do this? I am looking
> > at doing something like this myself with my TBS2603 HDMI to IP
> > encoder due to some Live TV issues with the IPTV recorder.
>
> Hi Greg,
>
> Do you know c++? If you want a full c++ example of writing an
> external recorder, you can look at https://github.com/jpoet/Hauppauge
> USB . That is for the Colossus2 which uses usb, but you could
> replace that part with some ffmpeg code.
>
> That being said, I would not mind seeing what Brian came up with for
> ffmpeg. There are times when such an interface would be useful.
>
> John
>
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

i would like to see this also, as i have hls streams that myth iptv
won't open but ffmpeg can open and record. i installed tvheadend solely
to deal with those links. it would be great to incorporate ffmpeg into
a recorder in myth.
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
>
>
> Hi Greg,
>
> Do you know c++? If you want a full c++ example of writing an external
> recorder, you can look at https://github.com/jpoet/HauppaugeUSB . That
> is for the Colossus2 which uses usb, but you could replace that part with
> some ffmpeg code.
>
> That being said, I would not mind seeing what Brian came up with for
> ffmpeg. There are times when such an interface would be useful.
>
> John
>
> _______________________________________________
> mythtv-users mailing listmythtv-users@mythtv.orghttp://lists.mythtv.org/mailman/listinfo/mythtv-usershttp://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
>
> i would like to see this also, as i have hls streams that myth iptv won't
> open but ffmpeg can open and record. i installed tvheadend solely to deal
> with those links. it would be great to incorporate ffmpeg into a recorder
> in myth.
>


I do have some experience in C++ but my main languages are Objective C,
Swift, and C#...

I did make a down and Dirty Bash script which is working... Obviously I
have no flow control as MythTV requests, but I haven't seen it use it yet
so it may not ever hit a condition where flow control is necessary. Here is
the pastebin if your interested... Comments / Suggestions welcome...

https://pastebin.com/3dEKNfHa

-Greg
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On Sun, 2018-03-18 at 14:51 -0400, Greg Thompson wrote:
>
> Would you mind sharing your script or code to do this? I am looking
> at
> doing something like this myself with my TBS2603 HDMI to IP encoder
> due to
> some Live TV issues with the IPTV recorder.

Sure:

#!/bin/bash

exec 3>/var/tmp/"${0##*/}".debug$$
export BASH_XTRACEFD=3
set -x
echo "$@" >&3
env >&3

send() {

echo "Sending $1" >&3
echo "$1" >&2

}

while read -r cmd; do
echo "Got \"$cmd\"" >&3
case $cmd in
"Version?")
send "OK:1.0.0"
;;
"HasTuner?")
send "OK:Yes"
;;
"CloseRecorder")
send "OK:Terminating"
exit 0
;;
"HasPictureAttributes?")
send "OK:No"
;;
"FlowControl?")
send "OK:XON/XOFF"
;;
BlockSize:*)
send "OK"
;;
TuneChannel:*)
channel=${cmd##*:}
case $channel in
3) URL="https://..."
;;
4) URL="https://..."
;;
esac
send "OK"
;;
"LockTimeout?")
send "OK:5000"
;;
"SignalStrengthPercent?")
send "OK:100"
;;
"HasLock?")
send "OK:Yes"
;;
"StartStreaming")
ffmpeg -i "$URL" -acodec copy -vcodec copy -f mpegts - 2>&3 &
ffmpeg_pid=$!
send "OK:Started"
;;
"StopStreaming")
if [ -n "$ffmpeg_pid" ] && [ -d /proc/$ffmpeg_pid ]; then
kill $ffmpeg_pid
fi
send "OK:Stopped"
;;
"IsOpen?")
if [ -n "$ffmpeg_pid" ] && [ -d /proc/$ffmpeg_pid ]; then
send "OK:Open"
else
send "OK:No"
fi
;;
"XON")
echo "Uh oh! need to handle \"$cmd\" at $(date)" >&3
send "OK"
;;
"XOFF")
echo "Uh oh! need to handle \"$cmd\" at $(date)" >&3
send "OK"
;;
*)
echo "Unknown cmd \"$cmd\"" >&3
;;
esac
done

Clearly, this hack doesn't handle flow control but it seems to get the
job done.

I did come across a python External recorder in my research that did
handle flow control.

Cheers,
b.
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On 03/19/2018 06:47 AM, Brian J. Murrell wrote:
>
> Clearly, this hack doesn't handle flow control but it seems to get the
> job done.
>
> I did come across a python External recorder in my research that did
> handle flow control.
>
> Cheers,
> b.
I tried to use your script with slight modifications
(https://pastebin.com/k8QqLeE1) disabling the 'Tunechannel'
functionality as I use the External Channel script field in the Input
Connection. Unfortunately, I am getting random failures when using
LiveTV, sometimes the video works fine but on other occasions it works
for some time and then fails like so,

+ read -r cmd
frame=   98 fps=0.0 q=-1.0 size=    5574kB time=00:00:03.81
bitrate=11965.0kbits/s speed=7.17x   
frame=  113 fps=109 q=-1.0 size=    6214kB time=00:00:04.32
bitrate=11784.1kbits/s speed=4.17x   
frame=  130 fps= 83 q=-1.0 size=    7236kB time=00:00:04.84
bitrate=12227.8kbits/s speed=3.09x   
frame=  146 fps= 69 q=-1.0 size=    8026kB time=00:00:05.37
bitrate=12229.5kbits/s speed=2.56x   
frame=  162 fps= 61 q=-1.0 size=    8902kB time=00:00:05.90
bitrate=12352.0kbits/s speed=2.24x   
frame=  177 fps= 56 q=-1.0 size=    9728kB time=00:00:06.40
bitrate=12436.9kbits/s speed=2.04x   
frame=  192 fps= 52 q=-1.0 size=   10551kB time=00:00:06.96
bitrate=12418.6kbits/s speed=1.89x   
[udp @ 0x55f38aae5740] Circular buffer overrun. To avoid, increase
fifo_size URL option. To survive in such case, use overrun_nonfatal option

Full log is at https://pastebin.com/PkQRhdkj. On pressing 'Esc' in
LiveTV the frontend returns to the main menu, however ffmpeg is not
killed as 'StopStreaming' is never sent to the externalrecorder script.

Any idea what could be the issue?

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
>
> + read -r cmd
> frame= 98 fps=0.0 q=-1.0 size= 5574kB time=00:00:03.81
> bitrate=11965.0kbits/s speed=7.17x
> frame= 113 fps=109 q=-1.0 size= 6214kB time=00:00:04.32
> bitrate=11784.1kbits/s speed=4.17x
> frame= 130 fps= 83 q=-1.0 size= 7236kB time=00:00:04.84
> bitrate=12227.8kbits/s speed=3.09x
> frame= 146 fps= 69 q=-1.0 size= 8026kB time=00:00:05.37
> bitrate=12229.5kbits/s speed=2.56x
> frame= 162 fps= 61 q=-1.0 size= 8902kB time=00:00:05.90
> bitrate=12352.0kbits/s speed=2.24x
> frame= 177 fps= 56 q=-1.0 size= 9728kB time=00:00:06.40
> bitrate=12436.9kbits/s speed=2.04x
> frame= 192 fps= 52 q=-1.0 size= 10551kB time=00:00:06.96
> bitrate=12418.6kbits/s speed=1.89x
> [udp @ 0x55f38aae5740] Circular buffer overrun. To avoid, increase
> fifo_size URL option. To survive in such case, use overrun_nonfatal option


Why are your fps jumping around so much? It looks like maybe your ffmpeg command line needs tweaked.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On 04/06/2018 06:52 AM, Greg Thompson wrote:
>
> Why are your fps jumping around so much? It looks like maybe your ffmpeg command line needs tweaked.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

It seems to work fine if I run it independently in cli. Also, I have
noticed that if i use the IPTV recorder in mythtv the stream works fine.
It is only when using External recorder with ffmpeg when things break
down. Could this be related how fast Mythtv wants to read from ffmpeg
and how quickly can ffmpeg deliver?

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
> On Apr 6, 2018, at 8:56 AM, Rajil Saraswat <rajil.s@gmail.com> wrote:
>
> On 04/06/2018 06:52 AM, Greg Thompson wrote:
>>
>> Why are your fps jumping around so much? It looks like maybe your ffmpeg command line needs tweaked.
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users@mythtv.org
>> http://lists.mythtv.org/mailman/listinfo/mythtv-users
>> http://wiki.mythtv.org/Mailing_List_etiquette
>> MythTV Forums: https://forum.mythtv.org
>
> It seems to work fine if I run it independently in cli. Also, I have
> noticed that if i use the IPTV recorder in mythtv the stream works fine.
> It is only when using External recorder with ffmpeg when things break
> down. Could this be related how fast Mythtv wants to read from ffmpeg
> and how quickly can ffmpeg deliver?

I suppose it could.. What is your source? Also what is your ffmpeg command line ? I use a TBS2603 Encoder so I am not doing anything fancy, just taking the .TS from the encoder and using ffmpeg to output that to STDOUT. Here is my command...

ffmpeg -hide_banner -loglevel panic -i http://192.168.1.48:8080/hdmi -codec copy -r 60 -f mpegts - &
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On 4/6/18 8:56 AM, Rajil Saraswat wrote:
> On 04/06/2018 06:52 AM, Greg Thompson wrote:
>> Why are your fps jumping around so much? It looks like maybe your ffmpeg command line needs tweaked.
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users@mythtv.org
>> http://lists.mythtv.org/mailman/listinfo/mythtv-users
>> http://wiki.mythtv.org/Mailing_List_etiquette
>> MythTV Forums: https://forum.mythtv.org
> It seems to work fine if I run it independently in cli. Also, I have
> noticed that if i use the IPTV recorder in mythtv the stream works fine.
> It is only when using External recorder with ffmpeg when things break
> down. Could this be related how fast Mythtv wants to read from ffmpeg
> and how quickly can ffmpeg deliver?
In my attempts to get the Blackmagic DeckLink to record with Myth, I ran
into similar problems. It wasn't until I modified mythfilerecorder to
allow for the stdout of a program (like ffmpeg) to be sent unbuffered to
the backend that things started to work. You can see my patch here, if
you want to try it:

https://code.mythtv.org/trac/ticket/13251
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On 04/06/2018 08:35 AM, Dan Wilga wrote:
> On 4/6/18 8:56 AM, Rajil Saraswat wrote:
>> On 04/06/2018 06:52 AM, Greg Thompson wrote:
>>> Why are your fps jumping around so much? It looks like maybe your
>>> ffmpeg command line needs tweaked.
>>> _______________________________________________
>>> mythtv-users mailing list
>>> mythtv-users@mythtv.org
>>> http://lists.mythtv.org/mailman/listinfo/mythtv-users
>>> http://wiki.mythtv.org/Mailing_List_etiquette
>>> MythTV Forums: https://forum.mythtv.org
>> It seems to work fine if I run it independently in cli. Also, I have
>> noticed that if i use the IPTV recorder in mythtv the stream works fine.
>> It is only when using External recorder with ffmpeg when things break
>> down. Could this be related how fast Mythtv wants to read from ffmpeg
>> and how quickly can ffmpeg deliver?
> In my attempts to get the Blackmagic DeckLink to record with Myth, I
> ran into similar problems. It wasn't until I modified mythfilerecorder
> to allow for the stdout of a program (like ffmpeg) to be sent
> unbuffered to the backend that things started to work. You can see my
> patch here, if you want to try it:
>
> https://code.mythtv.org/trac/ticket/13251

Does your patch improve the External Recorder or do i need to setup a
new tuner type?

At the moment i simply use ffmpeg like so with External Recorder,

ffmpeg -i "udp://@239.255.42.42:5004" -acodec copy -vcodec copy -f
mpegts - &

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On 4/6/18 9:54 AM, Rajil Saraswat wrote:
> On 04/06/2018 08:35 AM, Dan Wilga wrote:
>> On 4/6/18 8:56 AM, Rajil Saraswat wrote:
>>> On 04/06/2018 06:52 AM, Greg Thompson wrote:
>>>> Why are your fps jumping around so much? It looks like maybe your
>>>> ffmpeg command line needs tweaked.
>>>> _______________________________________________
>>>> mythtv-users mailing list
>>>> mythtv-users@mythtv.org
>>>> http://lists.mythtv.org/mailman/listinfo/mythtv-users
>>>> http://wiki.mythtv.org/Mailing_List_etiquette
>>>> MythTV Forums: https://forum.mythtv.org
>>> It seems to work fine if I run it independently in cli. Also, I have
>>> noticed that if i use the IPTV recorder in mythtv the stream works fine.
>>> It is only when using External recorder with ffmpeg when things break
>>> down. Could this be related how fast Mythtv wants to read from ffmpeg
>>> and how quickly can ffmpeg deliver?
>> In my attempts to get the Blackmagic DeckLink to record with Myth, I
>> ran into similar problems. It wasn't until I modified mythfilerecorder
>> to allow for the stdout of a program (like ffmpeg) to be sent
>> unbuffered to the backend that things started to work. You can see my
>> patch here, if you want to try it:
>>
>> https://code.mythtv.org/trac/ticket/13251
> Does your patch improve the External Recorder or do i need to setup a
> new tuner type?
>
> At the moment i simply use ffmpeg like so with External Recorder,
>
> ffmpeg -i "udp://@239.255.42.42:5004" -acodec copy -vcodec copy -f
> mpegts - &
Interesting. According to the wiki:

  https://www.mythtv.org/wiki/ExternalRecorder

an external recorder needs to implement a set of back-and-forth
commands, which using ffmpeg directly would not do. I'm not sure I ever
even tried it without (my modified) mythfilerecorder doing the command
parsing.

Perhaps this is the reason it's not working well for you? If you have
the source code set up to compile, it's worth a try.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: IPTV recorder seems broken -- large jumpy files [ In reply to ]
On 04/06/2018 10:27 AM, Dan Wilga wrote:
>
>
> Perhaps this is the reason it's not working well for you? If you have
> the source code set up to compile, it's worth a try.
>
I compiled with your patch and specified mythfilereader as the external
recorder. Unfortunately, it dies with the following error,

 CoreContext recorders/ExternalStreamHandler.cpp:1139 (ProcessCommand) -
ExternalRec(/usr/bin/mythfilerecorder  --exec --infile 'ffmpeg  -i
"udp://@239.255.42.42:5004" -acodec copy -vcodec copy  -f mpegts
pipe:1'): External Recorder invalid response to 'Version?': 'Unhandled
option given on command line:'

It is strange that 'mythfilerecorder' does not respond to the commands
as given in the Wiki (https://www.mythtv.org/wiki/ExternalRecorder)

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org