Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error opening MPEG-TS files: Error getting frame property "_Matrix" #6

Closed
JJKylee opened this issue Jul 28, 2021 · 11 comments
Closed

Comments

@JJKylee
Copy link

JJKylee commented Jul 28, 2021

  • L-SMASH-Works version: 20210728 (LWLibavVideoSource on AviSynth+ 3.7.0)
  • Video sample: here (MPEG-TS, HEVC, 10bit HDR)

Here's the script code:

LoadPlugin("D:\Utilities\StaxRip\Apps\Plugins\Dual\L-SMASH-Works\LSMASHSource.dll")
LWLibavVideoSource("D:\Test\LG New York HDR UHD 4K Demo (PQ).ts", cachefile="D:\Test\LG New York HDR UHD 4K Demo (PQ)_temp\temp.lwi", prefer_hw=0, format="YUV420P10")

And the screenshot of the error (AvsPmod v2.6.8.7)

L-SMASH-Works_TS_error_20210728

Error getting frame property "_Matrix": property is not set
([ScriptClip], line 1)

This is the same video opened with HolyWu's 20210423 build:

L-SMASH-Works_HolyWu_opening_TS_20210728

And the same video opened with ffms2 (87bae19 StvG, here)

ffms2_opening_TS_20210728

@Asd-g
Copy link
Contributor

Asd-g commented Jul 29, 2021

You can try the latest version.

@JJKylee
Copy link
Author

JJKylee commented Jul 29, 2021

It works alright now. Many thanks. 😊

@JJKylee JJKylee closed this as completed Jul 29, 2021
@JJKylee
Copy link
Author

JJKylee commented Jul 29, 2021

Sorry, but I was hasty in closing this issue thread.

Now the preview opens OK but the pixel type is incorrectly set to YV12 by default (without the format option) for the same file, whose actual pixel type is YUV420P10.

I've seen the same issue with another HDR video (HLG YUV420P10): here.

@Asd-g
Copy link
Contributor

Asd-g commented Jul 30, 2021

I guess you're testing with hardware decoding again because with software decoding I cannot reproduce the issue.
Try this test ver if it's ok with hardware decoding.
LSMASHSource_testhw.zip

@Asd-g Asd-g reopened this Jul 30, 2021
@JJKylee
Copy link
Author

JJKylee commented Jul 30, 2021

Thanks.

With the new binary, I've run into this weird phenomenon.

The first PQ HDR10 sample opens well with or without prefer_hw=1 (cache file deleted before each load).

Software decoding:

L-SMASH-Works_TS_HDR_PQ_20210729

Hardware decoding:

L-SMASH-Works_TS_HDR_PQ_HW_20210729

However, with the HLG HDR sample, it's weird.

Software decoding: works well

L-SMASH-Works_TS_HDR_HLG_20210729

But when I delete the cache file and put hardware decoding option, the pixel type becomes weird.

Hardware decoding:

L-SMASH-Works_TS_HDR_HLG_HW_20210729

I have no clue. 😓

@Asd-g
Copy link
Contributor

Asd-g commented Jul 30, 2021

What's NVIDIA driver version? You need 456.71 or newer.
Do older LSMASHSource versions decoding correctly?
Any difference if you remux the file into mkv?
Unfortunately I don't have NVIDIA GPU to test myself.

@JJKylee
Copy link
Author

JJKylee commented Jul 30, 2021

What's NVIDIA driver version?

My Nvidia driver is NVIDIA Studio driver 471.41 (the most recent one released on July 19, this year).

Do older LSMASHSource versions decoding correctly?

I tested with HolyWu's 20210423 build, and have found that it suffers the same issue. I was not testing it thoroughly back then and didn't find it out. 😓

Any difference if you remux the file into mkv?

I'm observing this phenomenon here. Although the reported pixel type of the AviSynth+ script is YUV420P8, the resulting pixel type becomes YUV420P10 if stream-copy-remuxed to MKV via mkvmerge. It's understandable because stream copy means no decoding.

--------------------------- AviSynth Script ---------------------------

LoadPlugin("D:\Utilities\StaxRip\Apps\Plugins\Dual\L-SMASH-Works\LSMASHSource.dll")
LWLibavVideoSource("D:\Test\TravelXP 4K HDR HLG Demo (HLG).ts", cachefile="D:\Test\TravelXP 4K HDR HLG Demo (HLG)_temp\temp.lwi", prefer_hw=1)

------------------------- Source Script Info -------------------------

Width     : 3840
Height    : 2160
Frames    : 14665
Time      : 04:53.300
Framerate : 50 (50/1)
Format    : YUV420P8

------------------------- Target Script Info -------------------------

Width     : 3840
Height    : 2160
Frames    : 14665
Time      : 04:53.300
Framerate : 50 (50/1)
Format    : YUV420P8

---------------------------- Muxing to MKV ----------------------------

mkvmerge 59.0.0

D:\Utilities\MKVToolNix\mkvmerge.exe -o "D:\Test\TravelXP 4K HDR HLG Demo (HLG).mkv" --no-audio --no-subs --no-chapters --no-attachments --no-track-tags --no-global-tags "D:\Test\TravelXP 4K HDR HLG Demo (HLG).ts" --no-video --no-subs --no-chapters --no-attachments --no-track-tags --no-global-tags --audio-tracks 1 --language 1:und --track-name "1:" --default-track 1:0 --forced-track 1:0 "D:\Test\TravelXP 4K HDR HLG Demo (HLG).ts" --ui-language en

...
...

General
Complete name            : D:\Test\TravelXP 4K HDR HLG Demo (HLG).mkv
Format                   : Matroska
Format version           : Version 4
File size                : 698 MiB
Duration                 : 4 min 59 s
Overall bit rate         : 19.6 Mb/s
Encoded date             : UTC 2021-07-30 02:03:14
Writing application      : mkvmerge v59.0.0 ('Shining Star') 64-bit
Writing library          : libebml v1.4.2 + libmatroska v1.6.4

Video
ID                       : 1
Format                   : HEVC
Format/Info              : High Efficiency Video Coding
Format profile           : Main 10@L5.1@Main
Codec ID                 : V_MPEGH/ISO/HEVC
Duration                 : 2 min 40 s
Bit rate                 : 36.1 Mb/s
Width                    : 3 840 pixels
Height                   : 2 160 pixels
Display aspect ratio     : 16:9
Frame rate mode          : Variable
Frame rate               : 91.145 FPS
Original frame rate      : 50.000 FPS
Color space              : YUV
Chroma subsampling       : 4:2:0
Bit depth                : 10 bits
Bits/(Pixel*Frame)       : 0.048
Stream size              : 691 MiB (99%)
Writing library          : ATEME Titan File 3.7.6 (4.7.6.0)
Default                  : Yes
Forced                   : No
Color range              : Limited
Color primaries          : BT.2020
Transfer characteristics : HLG
Matrix coefficients      : BT.2020 non-constant

...
...

(The duration becomes different than the source file, and I guess it's in turn an issue with mkvmerge.)

Now I suspect it might be a driver issue although I'm not sure. Or maybe the sample file is corrupt(?).
Anyway, I'm totally at a loss now. 😖

Since software decoding seems to be working OK, I'll go with software decoding first when it comes to HDR TS files.

Thanks for your help.

@JJKylee
Copy link
Author

JJKylee commented Jul 30, 2021

For comparison, I used DGDecNV(=DGIndexNV + DGSource), another indexer + source filter that can frameserve video files using Nvidia graphics card to open the above mentioned HLG HDR video.

For reference, DGSource decodes the video stream using the Nvidia graphics card without any particular option by default, based on its dgi index file generated by DGIndexNV. When the source file has 10-bit depth, the decoded video is delivered as 16-bit and is reported to Avisynth+ as pixel format P016(YUV420P16).

The script code is as follows.

LoadPlugin("D:\Utilities\StaxRip\Settings\Plugins\Dual\DGDecNV\DGDecodeNV.dll")
DGSource("D:\Test\TravelXP 4K HDR HLG Demo (HLG)_temp\TravelXP 4K HDR HLG Demo (HLG).dgi")

And unlike LWLibavVideoSource, I could see that DGSource opens the TS file without issues (with the exception of dropped frames).

DGDecNV_DGSource_TS_HDR_HLG_HW_20210730

So it turns out that it's not a video driver issue.

@Asd-g
Copy link
Contributor

Asd-g commented Jul 31, 2021

LWLibavVideoSource (software decoding) is giving the correct pixel type but the clip (HLG HDR video) isn't decoded properly. Check the first few frames.
FFmpeg is giving errors too.
Using ffmpeg to remux the video stream into .hevc and then using mkvmerge to remux it to mkv looks fine. Using mkvmerge to directly remux the video stream from .ts into mkv gives different result than the former process. I'm curious what result gives DGDecNV - similar to directly remuxing into mkv or remuxing into hevc+mkv.

Anyway, I would recommend to not rely ffmpeg decoding for .ts and similar.

@JJKylee
Copy link
Author

JJKylee commented Jul 31, 2021

Got it. Thanks for the detailed info.

@JJKylee JJKylee closed this as completed Jul 31, 2021
Asd-g pushed a commit that referenced this issue Aug 10, 2021
… field in mpegts

Updates #6.

Signed-off-by: akarin <i@akarin.info>
@kedaitinh12
Copy link

Don't know if it's same issue with prefer_hw=1 in Vapoursynth, you can check and notice to AkarinVS. He will fix it in GPU support and Asd-g will backport to avisynth ver

Turkishvan86 pushed a commit to Turkishvan86/L-SMASH-Works-Avisynth-Optimize-znver3 that referenced this issue Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants