[mythtv-users] Problems when streaming from a web site
Stephen Worthington
stephen_agent at jsw.gen.nz
Sun Nov 6 14:46:47 UTC 2022
On Sun, 6 Nov 2022 08:39:17 -0500, you wrote:
>On 11/5/2022 10:02 PM, Stephen Worthington wrote:
>> On Sat, 5 Nov 2022 21:03:24 -0400, you wrote:
>>> The external tuner uses this ffmpeg command on reading:
>>>
>>> [RECORDER]
>>> command="ffmpeg -hide_banner -nostats -loglevel fatal -re -i %URL% -c:v
>>> copy -c:a copy -f mpegts -"
>>
>> This is probably caused by the URL you are recording from using
>> different video and/or audio streams from what MythTV is programmed
>> for. The streams used by the usual broadcast sources are a quite
>> limited set (such as MPEG2, H.264), and there are lots of others that
>> MythTV does not handle at all or at all well. To find out what the
>> streams involved are, use mediainfo and/or ffprobe on the recording
>> file. You may need to install the mediainfo package to get that
>
>Thanks for all the advice from everyone. I tried a few things. Here are
>the results:
>
>1.mythcommflag --rebuild -f %FILE%
>Didn't work. Now when I skip ahead it says 0 length and doesn't work.
Did mythcommflag produce any warning or error messages?
>
>2. ffmpeg -i xxxx.ts -c copy t.ts
>Didn't make any difference
Every time you change the recording file, you have to run mythcommflag
--rebuild again before you try playing the file. The skip data made
from the old file will definitely not work with the new file.
>3. initial multiplexing as an MKV work better than an MPEG transport stream
>Not sure how to do this.
I have never done this, but I think you just have to tell ffmpeg to
produce a .mkv output file, instead of .ts. So try changing "-f
mpegts" to "-f mkv". The rest of the recorder setup should also be
changed somewhere to make the output file have a .mkv extension if
possible. But I think it is not essential to do that as most player
software, including MythTV, will ignore the extension and read the
headers at the start of the file to find out what the real format is.
>4. Adding these options:-fflags +genpts+igndts
>Didn't seem to do anything.
>
>Here is the output of ffprobe and mediainfo on the created file:
>
>** ffprobe **
>
>ffprobe version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2007-2021 the
>FFmpeg developers
> built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
> configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1
>--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
>--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
>--disable-stripping --enable-gnutls --enable-ladspa --enable-libaom
>--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
>--enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite
>--enable-libfontconfig --enable-libfreetype --enable-libfribidi
>--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
>--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
>--enable-libopus --enable-libpulse --enable-librabbitmq
>--enable-librubberband --enable-libshine --enable-libsnappy
>--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh
>--enable-libtheora --enable-libtwolame --enable-libvidstab
>--enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265
>--enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq
>--enable-libzvbi --enable-lv2 --enable-omx --enable-openal
>--enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx
>--enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm
>--enable-libiec61883 --enable-chromaprint --enable-frei0r
>--enable-libx264 --enable-shared
> libavutil 56. 70.100 / 56. 70.100
> libavcodec 58.134.100 / 58.134.100
> libavformat 58. 76.100 / 58. 76.100
> libavdevice 58. 13.100 / 58. 13.100
> libavfilter 7.110.100 / 7.110.100
> libswscale 5. 9.100 / 5. 9.100
> libswresample 3. 9.100 / 3. 9.100
> libpostproc 55. 9.100 / 55. 9.100
>Input #0, mpegts, from '36114_20221105170000.ts':
> Duration: 00:34:51.10, start: 1.400000, bitrate: 5245 kb/s
> Program 1
> Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
>yuv420p(tv, bt709, progressive), 1920x1080, Closed Captions, 29.97 fps,
>29.97 tbr, 90k tbn, 96k tbc
> Stream #0:1[0x101]: Audio: aac (HE-AAC) ([15][0][0][0] / 0x000F),
>48000 Hz, stereo, fltp, 128 kb/s
>
>** mediainfo **
>
>General
>ID : 1 (0x1)
>Complete name : 36114_20221105170000.ts
>Format : MPEG-TS
>File size : 1.28 GiB
>Duration : 34 min 51 s
>Overall bit rate mode : Variable
>Overall bit rate : 5 246 kb/s
>Law rating : TV-PG
>
>Video
>ID : 256 (0x100)
>Menu ID : 1 (0x1)
>Format : AVC
>Format/Info : Advanced Video Codec
>Format profile : High at L4
>Format settings : CABAC / 2 Ref Frames
>Format settings, CABAC : Yes
>Format settings, Reference frames : 2 frames
>Codec ID : 27
>Duration : 34 min 51 s
>Nominal bit rate : 5 000 kb/s
>Width : 1 920 pixels
>Height : 1 080 pixels
>Display aspect ratio : 16:9
>Frame rate mode : Variable
>Color space : YUV
>Chroma subsampling : 4:2:0
>Bit depth : 8 bits
>Scan type : Progressive
>Writing library : x264 core 148 r2579M 73ae2d1
>Encoding settings : cabac=1 / ref=2 /
>deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=2 / psy=1 /
>psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 /
>8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 /
>threads=4 / lookahead_threads=1 / sliced_threads=0 / nr=250 / decimate=1
>/ interlaced=0 / bluray_compat=0 / stitchable=1 / constrained_intra=0 /
>bframes=0 / weightp=1 / keyint=250 / keyint_min=25 / scenecut=40 /
>intra_refresh=0 / rc_lookahead=10 / rc=2pass / mbtree=1 / bitrate=5000 /
>ratetol=1.0 / qcomp=0.60 / qpmin=5 / qpmax=69 / qpstep=4 / cplxblur=20.0
>/ qblur=0.5 / vbv_maxrate=10000 / vbv_bufsize=5000 / nal_hrd=none /
>filler=0 / ip_ratio=1.40 / aq=1:1.00
>Color range : Limited
>Color primaries : BT.709
>Transfer characteristics : BT.709
>Matrix coefficients : BT.709
>
>Audio
>ID : 257 (0x101)
>Menu ID : 1 (0x1)
>Format : AAC LC SBR
>Format/Info : Advanced Audio Codec Low
>Complexity with Spectral Band Replication
>Commercial name : HE-AAC
>Format version : Version 4
>Format settings : Implicit
>Muxing mode : ADTS
>Codec ID : 15-2
>Duration : 34 min 50 s
>Bit rate mode : Variable
>Channel(s) : 2 channels
>Channel layout : L R
>Sampling rate : 48.0 kHz
>Frame rate : 23.438 FPS (2048 SPF)
>Compression mode : Lossy
>Delay relative to video : -7 ms
>
>Text
>ID : 256 (0x100)-CC1
>Menu ID : 1 (0x1)
>Format : EIA-608
>Muxing mode : SCTE 128 / DTVCC Transport
>Muxing mode, more info : Muxed in Video #1
>Duration : 34 min 51 s
>Bit rate mode : Constant
>Stream size : 0.00 Byte (0%)
>CaptionServiceName : CC1
The streams that you are recording should be fully compatible with
MythTV as they are just H.264 video (in a decent high quality mode)
and HE-AAC audio. These are just the same streams that broadcast
DVB-T/T2 programmes use. I have not met the format being used by the
closed caption stream, but it does not look abnormal. The only real
thing that I can see that is different is that the video is 1080p,
which is uncommon in broadcast video, where 1080i or 720p is usually
used. But that should not cause any problems.
I have also not met the muxing mode being used for audio stream - our
DVB-T uses LATM muxing. But I can not see any reason for that to
cause problems. Just in case the ADTS muxing of the audio is a
problem, I think ffmpeg's "-bsf:a aac_adtstoasc" option is supposed to
convert from that form of muxing to a more common one. But I have
never used that myself.
More information about the mythtv-users
mailing list