Opened 2 months ago

Last modified 4 weeks ago

#13557 assigned Bug Report - General

Decode errors

Reported by: Jarno Suni Owned by: mark-kendall
Priority: major Milestone: 32.0
Component: MythTV - Video Decoding Version: v30-fixes
Severity: high Keywords:
Cc: Ticket locked: no

Description

mythtv-frontend 2:30.0+fixes.201912012038.a27754a~ubuntu19.10.1

When using VAAPI2 decoder: With some recordings playback ends with decode error. If I symlinked the respective ts-file from recordings directory to videos directory I could play it there without the error.

When using Standard decoder: The decode error may happen even if I play from the videos directory. (Besides frontend chashes often.)

Change History (16)

comment:1 Changed 2 months ago by mark-kendall

Status: newinfoneeded_new

Can you please provide a 30-60second sample. Thanks

comment:2 Changed 2 months ago by Jarno Suni

Download the sample here: https://drive.google.com/open?id=1_dYmRaB_FJpJLhV395j74tytJ3gBg0z8 (The error happens almost at the beginning. I extracted the video from a longer video simply using dd.)

Last edited 2 months ago by Jarno Suni (previous) (diff)

comment:3 Changed 2 months ago by mark-kendall

Component: MythTV - GeneralMythTV - Video Decoding
Milestone: needs_triage31.0
Owner: set to mark-kendall
Status: infoneeded_newassigned

Confirmed that the sample has major issues playing in master.

The problem appears to be in our custom mpegts-mythtv demuxer.

A workaround is to enable 'Use FFmpeg's original MPEG-TS muxer' (Setup->Video->Playback->General Playback)

Unfortunately that does not detect all of the streams - and will not detect all subsequent stream changes.

This is the same problem as ticket #13218 - which appears to be a sample from the same channel.

comment:4 Changed 2 months ago by mark-kendall

Output from 'ffprobe decode-error.ts':-

Input #0, mpegts, from 'decode-error.ts':
  Duration: 00:00:36.65, start: 13416.566033, bitrate: 5140 kb/s
  Program 1 
    Stream #0:0[0x136]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x352](fin): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 448 kb/s
    Stream #0:2[0x13ec](fin): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250
    Stream #0:3[0x1901]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:4[0x353](dut): Audio: ac3 (AC-3 / 0x332D4341), 0 channels (visual impaired) (descriptions)
    Stream #0:5[0x467](fin): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:6[0x47e](fin): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) (hearing impaired)
Unsupported codec with id 0 for input stream 3

comment:5 Changed 2 months ago by mark-kendall

Output from mythfronted log (-v playback) when using FFmpeg demuxer (NOTE: only 4 streams detected):-

2020-01-28 09:50:48.901472 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:1011:OpenFile  AFD: Using FFmpeg MPEG-TS demuxer (forced)
2020-01-28 09:50:48.901488 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:918:InitByteContext  AFD: Buffer size: 32768 Streamed 0 Seekable 1 Available 327680
2020-01-28 09:50:48.997822 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:1981:ScanStreams  AFD: Stream #0: ID: 0x136 Codec ID: H264 Type: Video(1920x1080) Bitrate: 0
2020-01-28 09:50:48.997831 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:1981:ScanStreams  AFD: Stream #1: ID: 0x352 Codec ID: AC3 Type: Audio Bitrate: 448000
2020-01-28 09:50:48.997834 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2033:ScanStreams  AFD: codec AC3 has 2 channels
2020-01-28 09:50:48.997836 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2090:ScanStreams  AFD: Looking for decoder for AC3
2020-01-28 09:50:48.997966 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2508:OpenAVCodec  AFD: Opened codec 0x55c99a985640, id(AC3) type(Audio)
2020-01-28 09:50:48.997984 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:1981:ScanStreams  AFD: Stream #2: ID: 0x13ec Codec ID: DVB_TELETEXT Type: Subtitle Bitrate: 0
2020-01-28 09:50:48.997986 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2047:ScanStreams  AFD: subtitle codec (Subtitle)
2020-01-28 09:50:48.997989 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:1981:ScanStreams  AFD: Stream #3: ID: 0x1901 Codec ID: NONE Type: Unknown Bitrate: 0
2020-01-28 09:50:48.997992 E [23256/23256] CoreContext decoders/avformatdecoder.cpp:2074:ScanStreams  AFD: Unknown codec type (Unknown)
2020-01-28 09:50:48.997993 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2254:ScanStreams  AFD: Trying to select best video track
2020-01-28 09:50:48.998014 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2294:ScanStreams  AFD: Selected track #0: ID: 0x136 Codec ID: H264 Profile: High Type: Video(1920x1080) Bitrate: 500000

comment:6 Changed 2 months ago by mark-kendall

Output from mythfrontend with mythtv demuxer. 6 streams detected but not complete and playback goes into a tailspin as the video size is not detected properly:-

2020-01-28 09:52:54.910784 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:1981:ScanStreams  AFD: Stream #0: ID: 0x136 Codec ID: H264 Type: Video(0x0) Bitrate: 0
2020-01-28 09:52:54.910791 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:1981:ScanStreams  AFD: Stream #1: ID: 0x352 Codec ID: AC3 Type: Audio Bitrate: 0
2020-01-28 09:52:54.910794 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2033:ScanStreams  AFD: codec AC3 has 0 channels
2020-01-28 09:52:54.910796 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2090:ScanStreams  AFD: Looking for decoder for AC3
2020-01-28 09:52:54.910925 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2508:OpenAVCodec  AFD: Opened codec 0x55c99a9476c0, id(AC3) type(Audio)
2020-01-28 09:52:54.911115 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:1981:ScanStreams  AFD: Stream #2: ID: 0x353 Codec ID: AC3 Type: Audio Bitrate: 0
2020-01-28 09:52:54.911117 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2033:ScanStreams  AFD: codec AC3 has 0 channels
2020-01-28 09:52:54.911119 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2090:ScanStreams  AFD: Looking for decoder for AC3
2020-01-28 09:52:54.911240 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2508:OpenAVCodec  AFD: Opened codec 0x55c99cd38480, id(AC3) type(Audio)
2020-01-28 09:52:54.911264 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:1981:ScanStreams  AFD: Stream #3: ID: 0x467 Codec ID: DVB_SUBTITLE Type: Subtitle Bitrate: 0
2020-01-28 09:52:54.911266 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2047:ScanStreams  AFD: subtitle codec (Subtitle)
2020-01-28 09:52:54.911268 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2090:ScanStreams  AFD: Looking for decoder for DVB_SUBTITLE
2020-01-28 09:52:54.911396 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2508:OpenAVCodec  AFD: Opened codec 0x55c99ac3ea00, id(DVB_SUBTITLE) type(Subtitle)
2020-01-28 09:52:54.911407 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2195:ScanStreams  AFD: Subtitle track #1 is A/V stream #3 and is in the Finnish language(6711662).
2020-01-28 09:52:54.911410 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:1981:ScanStreams  AFD: Stream #4: ID: 0x47e Codec ID: DVB_SUBTITLE Type: Subtitle Bitrate: 0
2020-01-28 09:52:54.911413 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2047:ScanStreams  AFD: subtitle codec (Subtitle)
2020-01-28 09:52:54.911415 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2090:ScanStreams  AFD: Looking for decoder for DVB_SUBTITLE
2020-01-28 09:52:54.911532 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2508:OpenAVCodec  AFD: Opened codec 0x55c99c0984c0, id(DVB_SUBTITLE) type(Subtitle)
2020-01-28 09:52:54.911538 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2195:ScanStreams  AFD: Subtitle track #2 is A/V stream #4 and is in the Finnish language(6711662).
2020-01-28 09:52:54.911542 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:1981:ScanStreams  AFD: Stream #5: ID: 0x13ec Codec ID: DVB_TELETEXT Type: Subtitle Bitrate: 0
2020-01-28 09:52:54.911557 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:1842:ScanTeletextCaptions  AFD: Teletext stream #0 (Menu) is in the Finnish language on page 1 0.
2020-01-28 09:52:54.911562 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2047:ScanStreams  AFD: subtitle codec (Subtitle)
2020-01-28 09:52:54.911564 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2254:ScanStreams  AFD: Trying to select best video track
2020-01-28 09:52:54.911583 I [23256/23256] CoreContext decoders/avformatdecoder.cpp:2294:ScanStreams  AFD: Selected track #0: ID: 0x136 Codec ID: H264 Profile:  Type: Video(0x0) Bitrate: 500000

comment:7 Changed 2 months ago by mark-kendall

Output from mediainfo decode-error.ts:-

ID                                       : 4865 (0x1301)
Complete name                            : decode-error.ts
Format                                   : MPEG-TS
File size                                : 22.5 MiB
Duration                                 : 35 s 705 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 270 kb/s

Video
ID                                       : 310 (0x136)
Menu ID                                  : 1 (0x1)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : 27
Duration                                 : 35 s 240 ms
Bit rate                                 : 4 363 kb/s
Maximum bit rate                         : 10.0 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 FPS
Standard                                 : Component
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : MBAFF
Scan type, store method                  : Interleaved fields
Scan order                               : Top Field First
Bits/(Pixel*Frame)                       : 0.084
Stream size                              : 18.3 MiB (82%)
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio #1
ID                                       : 850 (0x352)
Menu ID                                  : 1 (0x1)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : 129
Duration                                 : 35 s 648 ms
Bit rate mode                            : Constant
Bit rate                                 : 448 kb/s
Maximum bit rate                         : 459 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : -1 s 15 ms
Stream size                              : 1.90 MiB (8%)
Language                                 : Finnish
Service kind                             : Complete Main

Audio #2
ID                                       : 851 (0x353)
Menu ID                                  : 1 (0x1)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : 129
Duration                                 : 28 s 288 ms
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Maximum bit rate                         : 230 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : 6 s 410 ms
Stream size                              : 663 KiB (3%)
Language                                 : Dutch
Service kind                             : Complete Main

Text #1
ID                                       : 1127 (0x467)
Menu ID                                  : 1 (0x1)
Format                                   : DVB Subtitle
Codec ID                                 : 6
Delay relative to video                  : 8 s 647 ms
Language                                 : Finnish

Text #2
ID                                       : 1150 (0x47E)
Menu ID                                  : 1 (0x1)
Format                                   : DVB Subtitle
Codec ID                                 : 6
Duration                                 : 6 s 79 ms
Delay relative to video                  : 8 s 647 ms
Language                                 : Finnish

Other
ID                                       : 5100 (0x13EC)-100
Menu ID                                  : 1 (0x1)
Format                                   : Teletext
Language                                 : Finnish

Menu
ID                                       : 210 (0xD2)
Menu ID                                  : 1 (0x1)
Duration                                 : 35 s 705 ms
List                                     : 310 (0x136) (AVC) / 850 (0x352) (AC-3, Finnish) / 5100 (0x13EC)-100 (Teletext, fi) / 6401 (0x1901) () / 851 (0x353) (AC-3, Dutch) / 1127 (0x467) (DVB Subtitle, Finnish) / 1150 (0x47E) (DVB Subtitle, Finnish)
Language                                 :  / Finnish / Finnish /  / Dutch / Finnish / Finnish
Maximum bit rate                         : 13418400

comment:8 Changed 2 months ago by mark-kendall

Output of av_dump_format from mythfrontend when using mythtv demuxer:-

2020-01-28 09:59:03.565068 I [23754/23754] CoreContext decoders/avformatdecoder.cpp:303:myth_av_log  Input #0, mpegts, from '/home/mark/Videos//decode-error.ts':
2020-01-28 09:59:03.565079 I [23754/23754] CoreContext decoders/avformatdecoder.cpp:303:myth_av_log  Duration: N/A, bitrate: N/A
2020-01-28 09:59:03.565171 I [23754/23754] CoreContext decoders/avformatdecoder.cpp:303:myth_av_log  Stream #0:0[0x136], 0, 1/90000: Video: h264, none, 500 kb/s, 90k tbn
2020-01-28 09:59:03.565242 I [23754/23754] CoreContext decoders/avformatdecoder.cpp:303:myth_av_log  Stream #0:1[0x352](fin), 0, 1/90000: Audio: ac3 (AC-3 / 0x332D4341), 0 channels
2020-01-28 09:59:03.565303 I [23754/23754] CoreContext decoders/avformatdecoder.cpp:303:myth_av_log  Stream #0:2[0x353](dut), 0, 1/90000: Audio: ac3 (AC-3 / 0x332D4341), 0 channels
2020-01-28 09:59:03.565357 I [23754/23754] CoreContext decoders/avformatdecoder.cpp:303:myth_av_log  Stream #0:3[0x467](fin), 0, 1/90000: Subtitle: dvb_subtitle
2020-01-28 09:59:03.565408 I [23754/23754] CoreContext decoders/avformatdecoder.cpp:303:myth_av_log  Stream #0:4[0x47e](fin), 0, 1/90000: Subtitle: dvb_subtitle
2020-01-28 09:59:03.565461 I [23754/23754] CoreContext decoders/avformatdecoder.cpp:303:myth_av_log  Stream #0:5[0x13ec](fin), 0, 1/90000: Subtitle: dvb_teletext

comment:9 Changed 2 months ago by jpilk

It looks to me as if this could be a recording from the start of a part-time channel, when stream identification has always given problems. The easiest workaround is to start recording later.

comment:10 Changed 2 months ago by dagnygren

How can I get myself on the notification list for this ticket? Would be nice to know what is going on here. Also tell me if I can help with something, please.

comment:11 in reply to:  3 Changed 7 weeks ago by Jarno Suni

Replying to mark-kendall:

A workaround is to enable 'Use FFmpeg's original MPEG-TS muxer' (Setup->Video->Playback->General Playback)

I do not see such an option on Mythtv 30.

comment:12 Changed 7 weeks ago by jpilk

mv mythfilename mythfilename0 Test playback for assorted values of n: 3 worked for me dd bs=1M skip=n count=40 if=mythfilename0 of=mythfilename

When satisfied mythcommflag -q --rebuild --file mythfilename rm mythfilename0

and see comment 9

comment:13 Changed 7 weeks ago by jpilk

 
mv mythfilename mythfilename0 

## Test playback for assorted values of n: 3 worked for me 

dd bs=1M skip=n count=40 if=mythfilename0 of=mythfilename

## When satisfied (omitted in the initial post) :

dd bs=1M skip=n if=mythfilename0 of=mythfilename

mythcommflag -q --rebuild --file mythfilename 

rm mythfilename0

## and see comment 9 :-)
Last edited 7 weeks ago by jpilk (previous) (diff)

comment:14 Changed 6 weeks ago by Jarno Suni

Also got decode errors when using VDPAU.

comment:15 Changed 6 weeks ago by Jarno Suni

Sometimes decode error happens after many minutes of playback. This did not happen by 29.

comment:16 Changed 4 weeks ago by mark-kendall

Milestone: 31.032.0
Priority: criticalmajor
Note: See TracTickets for help on using tickets.