Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: Blues on July 18, 2017, 05:38:48 PM

Title: [mkv] Discarding potentially broken or useless index.
Post by: Blues on July 18, 2017, 05:38:48 PM
Avidemux from GIT, built today. When I encode using H.265 the resulting file is not seekable. The error MKV player is giving me is in subject. The file plays, audio is fine, but picture is frozen. I loaded the file back into Avidemux and it exhibits the same problem.
What's the problem?
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: Jan Gruuthuse on July 19, 2017, 08:21:41 AM
Your hardware does support h.265? and the used profile? could be hardware or driver limitation?
Does VLC play the video?
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: Blues on July 19, 2017, 04:04:57 PM
Yes, my hardware supports 8-bit H.265, other [older] files play fine. MPV is using VAAPI hardware decoding, plays fine, freezes when seeking. VLC behaves exactly the same. It starts playing, but I cannot seek forward, the picture freezes.
Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L3@Main
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 1 h 42 min
Bit rate                                 : 624 kb/s
Width                                    : 640 pixels
Height                                   : 476 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.082
Stream size                              : 459 MiB (76%)
Writing library                          : x265 2.5:[Linux][GCC 7.1.0][64 bit] 8bit+10bit+12bit
Encoding settings                        : cpuid=1173503 / frame-threads=2 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=640x476 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=25 / keyint=250 / bframes=3 / b-adapt=1 / b-pyramid / bframe-bias=0 / rc-lookahead=40 / lookahead-slices=0 / scenecut=40 / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=2 / limit-refs=3 / no-limit-modes / me=3 / subme=5 / merange=16 / temporal-mvp / weightp / weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=3 / early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / rdpenalty=0 / psy-rd=1.00 / psy-rdoq=0.00 / no-rd-refine / analysis-reuse-mode=0 / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=23.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=2 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=0 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / max-cll=0,0 / min-luma=0 / max-luma=255 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / opt-qp-pps / opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / no-hdr / no-hdr-opt / no-dhdr10-opt / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / no-limit-sao / ctu-info=0
Default                                  : Yes
Forced                                   : No

Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: eumagga0x2a on July 19, 2017, 07:07:02 PM
I tried encoding a short (8 min) video using the x265 encoder with the "superfast" preset, main profile, no tuning and the MKV muxer: the resulting video is perfectly seekable in Avidemux and in mpv with software decoding (my hardware doesn't offer accelerated h265 decoding). Please specify exact steps to reproduce and provide a sample.
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: Blues on July 19, 2017, 08:38:51 PM
Sample. (http://asclinux.com/tmp/sample.mkv) I used all default settings with H.265 except setting quality to 23. I can provide a longer sample if needed, I used dd to cut a piece from beginning.
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: Jan Gruuthuse on July 20, 2017, 07:41:40 AM
Your mkv h.265 sample does play in vlc 3.0.0 Vetinari. It does not allow moving in the timeline.

Simple workaround for now: Remux with mkv toolnix: https://mkvtoolnix.download/
Remuxed mkv: https://we.tl/yIYQmC8iW6
Until developers tackle the issue, time permitting.
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: eumagga0x2a on July 20, 2017, 12:43:04 PM
Quote from: Blues on July 19, 2017, 08:38:51 PM
I used all default settings with H.265 except setting quality to 23.

Can't reproduce with the settings specified. The resulting MKV from the same source as above is again perfectly seekable.

Avidemux built on Fedora 26 from the current git with x265 v2.4 from RPF Fusion.

(The provided sample is indeed broken.)
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: Blues on July 20, 2017, 02:37:11 PM
My apologies. Now I recall I used filters, GreyScale and probably a noise filter, can't remember. :( Will try and do it again, this time I'll take a note of filters used.
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: eumagga0x2a on July 20, 2017, 03:24:54 PM
Filters, at least those which don't manipulate timing, shouldn't matter. The x265 version might matter, the source might matter.
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: Blues on July 20, 2017, 08:05:12 PM
Yes, I can reproduce a broken file without filters. So where I should look? Handbrake output does not suffer from this issue. My x265 version is 2.5.
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: eumagga0x2a on July 20, 2017, 10:12:26 PM
The x265 version is the key. I can confirm the issue with 2.5, works fine with 2.4.
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: Blues on July 21, 2017, 01:13:52 AM
Thanks for confirmation. Will wait, hope it gets fixed.
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: eumagga0x2a on July 21, 2017, 10:11:45 AM
I'd rather downgrade x265 for now.
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: Blues on July 24, 2017, 02:18:44 AM
Hmmm ... can I bundle older x265 instead of using system x265?
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: eumagga0x2a on July 24, 2017, 09:50:46 AM
You will have to build Avidemux against the older version in the first place.
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: Blues on July 26, 2017, 12:03:20 AM
What would the solution be for Avidemux? Shall I file a bug?
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: mean on July 26, 2017, 06:19:49 AM
For some reason x265 2.5 is not taggint the slice as IDR
so you have no seek points
Not sure why yet
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: mean on July 26, 2017, 12:18:11 PM
I think i've found the problem, fix coming
Title: Re: [mkv] Discarding potentially broken or useless index.
Post by: eumagga0x2a on July 26, 2017, 08:58:08 PM
Fixed by [x265] Analyze NAL to distinguish between I and IDR if using x265 2.5 (https://github.com/mean00/avidemux2/commit/beb983f510db827142b170d7bb56090497bee511), thanks!