[SOLVED] x265 video plays momentarily then freezes.

Post Reply
ftdomen
Posts: 25
Joined: Sat May 21, 2016 1:33 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

[SOLVED] x265 video plays momentarily then freezes.

Post by ftdomen »

Sample Video (Encoded with IFME v4.9.4.0)

LibreElec Logs

It seems that this is an issue with LibreElec. The video plays fine in an Android environment using Kodi nightlies:

Android Logs

Raybuntu
Posts: 1428
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 5 times
Been thanked: 26 times
Contact:

Re: x265 video plays momentarily then freezes.

Post by Raybuntu »

Is it just that video or others too?

ftdomen
Posts: 25
Joined: Sat May 21, 2016 1:33 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by ftdomen »

I've not come across this with any of my other x265 videos yet. I've held off on ripping anything new until I work out what's caused this though.

Raybuntu
Posts: 1428
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 5 times
Been thanked: 26 times
Contact:

Re: x265 video plays momentarily then freezes.

Post by Raybuntu »

I'll try the video later when I'm at home and see if I can reproduce it.

Raybuntu
Posts: 1428
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 5 times
Been thanked: 26 times
Contact:

Re: x265 video plays momentarily then freezes.

Post by Raybuntu »

I was able to play your testfile completely. I have nice video and audio.

ftdomen
Posts: 25
Joined: Sat May 21, 2016 1:33 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by ftdomen »

Raybuntu wrote:I was able to play your testfile completely. I have nice video and audio.
Really? hmm, so that means it's probably just a settings issue. I'll have a play round with them and report back.

ftdomen
Posts: 25
Joined: Sat May 21, 2016 1:33 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by ftdomen »

I can't for the life of me get it to work. wrxtasy had the same issue when he first checked it out too:
wrxtasy wrote:@ftdomen, Strange, that clips plays fine on my OpenELEC C1+ but chokes on the C2. No idea why. Does it play using Android ?
I would actually alert HK to pass the H265 sample on to AMLogic themselves to look at if it fails in Android as well.
Raybuntu, Would you be willing to post a log file or screenshots of your video settings to I can try a like for like test?

User avatar
meveric
Posts: 12144
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 95 times
Been thanked: 683 times
Contact:

Re: x265 video plays momentarily then freezes.

Post by meveric »

I tried the video as well, on the C2 the picture always freezes, even if I use ffplay to run the movie in software mode it freezes.
I tried it on my XU3 where it works perfectly fine as well, both in Kodi and ffplay.
Using ffplay shows tons of error while playing though but these look like audio errors, so can probably be ignored for the video issue.

What program are you using for ripping? I've seen references to "IFME v4.9.4.0" as an encoder as well as mkvmerge.
Have you tried using makemkv for ripping and handbrake for converting? I had very good results with these.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

ftdomen
Posts: 25
Joined: Sat May 21, 2016 1:33 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by ftdomen »

meveric wrote:What program are you using for ripping? I've seen references to "IFME v4.9.4.0" as an encoder as well as mkvmerge.
Have you tried using makemkv for ripping and handbrake for converting? I had very good results with these.
Used to use Handbrake for encoding, but last time I checked it didn't do x265.

As for ripping, I just use VLC.

User avatar
meveric
Posts: 12144
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 95 times
Been thanked: 683 times
Contact:

Re: x265 video plays momentarily then freezes.

Post by meveric »

I converted a couple movies to H265 using HandBrake already.. It's in there for quite a while already.

https://handbrake.fr/news.php?peek=-9
Saturday, Nov 22, 2014

"In theory, theory and practice are the same. In practice, they're not." - Yoggi Berra
Release Highlights
0.10 releases with hundreds of new features, changes, and bug fixes. To highlight a few:

Encoders
We are introducing several new encoders with this release and replacing others.

Intel QuickSync Video
is a hardware based H.264 encoder that is available on Intel CPUs. Currently, QSV is only supported on Windows but we hope to bring this to Linux users in the future. Thanks to the good people at Intel for making this possible!
H.265
is now available through x265 1.4. While this encoder is still fairly new, we have seen some promising results come out of it. It's still under heavy active development and is only going to improve over time!

VP8
using the libvpx encoder. We have now deprecated Theora (VP3) in favour of VP8 which is a more modern encoder offering better quality encodes at lower file sizes.
LibFaac
Has now officially been removed due to GPL compatibility issues, and replaced with the libav AAC encoder as the new default for Windows and Linux. In addition, we have added the FDK AAC encoder for Windows and Linux as a optional compile-time option. The Mac release will continue to use CoreAudio as the default.
As usual, we've updated a number of the core libraries including x264 and libav

Filters and Scalers

Denoise
The new NLMeans filter offers much higher quality denoising. Our previous filter, hqdn3d, now accepts individual settings for each of the chroma channels (Cb, Cr).
OpenCL Scaling
In addition to the default Lanczos scaling algorithm, HandBrake now offers BiCubic scaling on Windows via OpenCL. If the results prove positive, we may roll it out to other platforms in a future release. Thanks to the guys at AMD for building our OpenCL framework!

GUIs

Feature Parity
A lot of work has been done to bring the user interfaces closer in terms of feature parity. We are now much closer than in any previous release.
Audio and Subtitle Defaults
The audio and subtitle controls have been overhauled to support default behaviours which can be stored in presets. This simplifies the workflow for many batch encoding scenarios.

There are literally hundreds of other improvements, so check out the release notes for more details.

If you happen to discover any bugs or issues please tell us about them in the bugs forum or let us know via our IRC channels.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

odronew
Posts: 28
Joined: Tue May 10, 2016 6:06 am
languages_spoken: english, italian, greek
ODROIDs: C2, HC1
Has thanked: 0
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by odronew »

ftdomen wrote:I can't for the life of me get it to work. wrxtasy had the same issue when he first checked it out too:
wrxtasy wrote:@ftdomen, Strange, that clips plays fine on my OpenELEC C1+ but chokes on the C2. No idea why. Does it play using Android ?
I would actually alert HK to pass the H265 sample on to AMLogic themselves to look at if it fails in Android as well.
Raybuntu, Would you be willing to post a log file or screenshots of your video settings to I can try a like for like test?
Hello,

I am playing without any problem my HEVC videos on C2. I have the official 28/5 version.
In fact I have replaced several portion of my 720p/x264/5.1 collection with the equivalent 1080p/x265.HEVC 10bit either 5.1 or 2 channels, because I save an average of 65% of storage space and I have better quality!

Very rarely I come across to non 10bit x265 media and those files have problems in any PC, not just C2.
In Kodi I do not recall any x265 specific setting either.

Hope that the above help.

BR

Michalis

soryuuha
Posts: 65
Joined: Fri Apr 15, 2016 6:38 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by soryuuha »

some hevc rip will have that issue

try disable amcodec acceleration, problem will be gone

wrxtasy said to find another source of hevc..

ftdomen
Posts: 25
Joined: Sat May 21, 2016 1:33 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by ftdomen »

soryuuha wrote:try disable amcodec acceleration, problem will be gone.
The C2 doesn't have enough cpu power to play the video's without gpu acceleration.

Raybuntu
Posts: 1428
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 5 times
Been thanked: 26 times
Contact:

Re: x265 video plays momentarily then freezes.

Post by Raybuntu »

I could play them without any problems. But I used odrobian to test the files. So I dont think there is a bug in the chip itself.

Currently I'm very busy and wont be able to much testing since or answer the next few days.

ftdomen
Posts: 25
Joined: Sat May 21, 2016 1:33 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by ftdomen »

Raybuntu wrote:I could play them without any problems. But I used odrobian to test the files. So I dont think there is a bug in the chip itself.

Currently I'm very busy and wont be able to much testing since or answer the next few days.
I know it's not the chip. I should have made the Op clearer. The android install I used was on the C2.

odronew
Posts: 28
Joined: Tue May 10, 2016 6:06 am
languages_spoken: english, italian, greek
ODROIDs: C2, HC1
Has thanked: 0
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by odronew »

ftdomen wrote:Sample Video (Encoded with IFME v4.9.4.0)

LibreElec Logs

It seems that this is an issue with LibreElec. The video plays fine in an Android environment using Kodi nightlies:

Android Logs
I tested the sample video and it plays correctly on Linux & Windows x86 modern PC, it does not play on the C2!
Although the sounds plays correctly only the 1st frame is displayed!

I did also some tests with all the x265 samples (and not only) Kodi wiki is offering: http://kodi.wiki/view/Samples
On Linux x86 all played correctly.
On C2 I played all the x265 videos successfully but not 2 samples having H.264-MPEG-4 AVC Part 10 (AVC1). They failed! Could be the AVC version the cause?

The successful samples have the "MPEG-H Part2/HEVC, Planar 4:2:0 YuV" video codec and audio is DTS.

Your video has exactly the same codec but 2 different audio streams 5.1 and 2ch MPEG AAC (mp4a).

I do not know if this is the problem..it is weird

User avatar
wrxtasy
Posts: 1306
Joined: Wed May 13, 2015 1:59 pm
languages_spoken: english
ODROIDs: C1, C1+, C2, N2
Location: Australia
Has thanked: 4 times
Been thanked: 4 times
Contact:

Re: x265 video plays momentarily then freezes.

Post by wrxtasy »

Just be aware, last time I checked the default HEVC encoding settings that are used by HandBrake are set to use Variable Frame Rate when x265 encoding. VFR has been known to cause HEVC playback issues with AML devices.
Constant Frame Rate should be used for maximum Hardware playback compatibility.

Suggestion: download the program MediaInfo and interrogate the Metadata of files.
I would suspect some sort of x265 encoding setting is not compatible with the version of libamcodec (aml_libs) used in LibreELEC, which is different to the version used in all other C2 distros.
Kodi Hardware Guru

ftdomen
Posts: 25
Joined: Sat May 21, 2016 1:33 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by ftdomen »

wrxtasy wrote:I would suspect some sort of x265 encoding setting is not compatible with the version of libamcodec (aml_libs) used in LibreELEC, which is different to the version used in all other C2 distros.
Wouldn't that mean there's an issue with this version of libamcodec that needs to be addressed?

I definitely didn't use a variable bitrate:

Code: Select all

ID/String                        : 1
Format                           : HEVC
Format/Info                      : High Efficiency Video Coding
Format_Profile                   : Main@L5@Main
CodecID                          : V_MPEGH/ISO/HEVC
Duration/String                  : 1mn 33s
BitRate/String                   : 3 198 Kbps
Width/String                     : 1 920 pixels
Height/String                    : 1 080 pixels
DisplayAspectRatio/String        : 16:9
FrameRate_Mode/String            : Constant
FrameRate/String                 : 23.976 (24000/1001) fps
ColorSpace                       : YUV
ChromaSubsampling/String         : 4:2:0
BitDepth/String                  : 8 bits
Bits-(Pixel*Frame)               : 0.064
StreamSize/String                : 35.7 MiB (92%)
Title                            : Encoded with IFME v4.9.4.0
Encoded_Library/String           : x265 1.7+509-f4c267f28487:[Windows][GCC 4.8.2][64 bit] 8bit
Encoded_Library_Settings         : wpp / ctu=64 / min-cu-size=8 / max-tu-size=32 / tu-intra-depth=1 / tu-inter-depth=1 / me=3 / subme=3 / merange=57 / no-rect / no-amp / max-merge=2 / temporal-mvp / no-early-skip / rdpenalty=0 / no-tskip / no-tskip-fast / strong-intra-smoothing / no-lossless / no-cu-lossless / no-constrained-intra / no-fast-intra / open-gop / no-temporal-layers / interlace=0 / keyint=250 / min-keyint=23 / scenecut=40 / rc-lookahead=250 / lookahead-slices=0 / bframes=8 / bframe-bias=0 / b-adapt=2 / ref=6 / limit-refs=0 / weightp / weightb / aq-mode=2 / qg-size=32 / aq-strength=1.00 / cbqpoffs=0 / crqpoffs=0 / rd=3 / psy-rd=0.30 / rdoq-level=0 / psy-rdoq=0.00 / signhide / deblock / sao / no-sao-non-deblock / b-pyramid / cutree / rc=crf / crf=25.0 / qcomp=0.60 / qpmin=0 / qpmax=51 / qpstep=4 / ipratio=1.40 / pbratio=1.30
Default/String                   : Yes
Forced/String                    : No
colour_range                     : Limited
colour_primaries                 : BT.709

ftdomen
Posts: 25
Joined: Sat May 21, 2016 1:33 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by ftdomen »

for what it's worth, it does seem like it's something to do with the video. Re-muxing this without the audio tracks, or the subtitles does not fix the issue at all.

Video only

soryuuha
Posts: 65
Joined: Fri Apr 15, 2016 6:38 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by soryuuha »

even on constant frame, the clip freeze. ive posted this issue a while back : http://forum.odroid.com/viewtopic.php?f ... ha#p139846

wrxtasy response :
bet that clip has been re-encoded from H264 HiP10 Anime source and there is something up with the re-encoding itself that messed up the flags at the start of the file.
As a test I found a 10bit H265 720p version of that same clip with ogg Dual Audio and it plays fine.

Disabling amcodec uses ffmpeg-hevc Software decoding which can pretty much play anything so long as you have enough CPU grunt.
That currently will be the only solution.
Users having HEVC playback issues will usually find whomever is doing the encoding is either settings some Exotic (non spec) HEVC compression options or is lazy and just using Variable Frame Rate default settings, which is not a good idea at all for widespread playback compatibility.

ftdomen
Posts: 25
Joined: Sat May 21, 2016 1:33 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by ftdomen »

I saw your issue and wrxtasy's response. I haven't used 264 HiP10. My method was DVD > Vob > X265.

If there is indeed an incompatibility with libamcodec I'd like to figure out what. But it appears this forum isn't the right place & for now I don't have any other devices that use LibreElec with hardware 265 decoding, so I don't think I can test further.

Raybuntu
Posts: 1428
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 5 times
Been thanked: 26 times
Contact:

Re: x265 video plays momentarily then freezes.

Post by Raybuntu »

@ftdomen try aml libs from odrobian. I had no issues with your sample video using odrobian.

ftdomen
Posts: 25
Joined: Sat May 21, 2016 1:33 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by ftdomen »

Raybuntu wrote:@ftdomen try aml libs from odrobian. I had no issues with your sample video using odrobian.
Once I manage to find libamcodec.so within the Odrobian image, is that as easy as swapping the libamcodec.so file found in (\target\SYSTEM\usr\lib\) then rebooting? Or do I need to recompile an LE installer?

User avatar
wrxtasy
Posts: 1306
Joined: Wed May 13, 2015 1:59 pm
languages_spoken: english
ODROIDs: C1, C1+, C2, N2
Location: Australia
Has thanked: 4 times
Been thanked: 4 times
Contact:

Re: x265 video plays momentarily then freezes.

Post by wrxtasy »

I've tested your sample file with the aml_libs (libamcodc) from mdrjr's Github and the file still won't play. In fact this alternate libamcodec is in the Test Bug fix .tar release found in Post #1 of the main thread.
Kodi Hardware Guru

hephooey
Posts: 54
Joined: Tue Mar 22, 2016 4:19 am
languages_spoken: english
ODROIDs: C1+, C2
Has thanked: 0
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by hephooey »

Not really an expert, I used to have a similar issue playing hevc and fixed by:

Code: Select all

echo 16 > /sys/module/amvdec_h265/parameters/dynamic_buf_num_margin
I do not know if libreELEC is already doing this or not, but maybe you can try it.

Raybuntu
Posts: 1428
Joined: Mon Nov 30, 2015 4:23 pm
languages_spoken: english, german
ODROIDs: C1+, C2
Has thanked: 5 times
Been thanked: 26 times
Contact:

Re: x265 video plays momentarily then freezes.

Post by Raybuntu »

@hephooey: your're right i have some of those in my rc.local. can you try ftdomen.

User avatar
wrxtasy
Posts: 1306
Joined: Wed May 13, 2015 1:59 pm
languages_spoken: english
ODROIDs: C1, C1+, C2, N2
Location: Australia
Has thanked: 4 times
Been thanked: 4 times
Contact:

Re: x265 video plays momentarily then freezes.

Post by wrxtasy »

hephooey wrote:Not really an expert, I used to have a similar issue playing hevc and fixed by:

Code: Select all

echo 16 > /sys/module/amvdec_h265/parameters/dynamic_buf_num_margin
I do not know if libreELEC is already doing this or not, but maybe you can try it.
Just tested this and whadda ya know it WORKS !

ftdomen will be very happy. You can put that echo text into the autostart.sh in the .config directory until I compile the fix into platform_init for a permanent solution.

I think we should get hephooey over into the Slack - LibreELEC development board with all the inside AML knowledge his Mega brain contains ;)
We could surely use it !
Kodi Hardware Guru

soryuuha
Posts: 65
Joined: Fri Apr 15, 2016 6:38 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by soryuuha »

hephooey wrote:Not really an expert, I used to have a similar issue playing hevc and fixed by:

Code: Select all

echo 16 > /sys/module/amvdec_h265/parameters/dynamic_buf_num_margin
I do not know if libreELEC is already doing this or not, but maybe you can try it.
wrxtasy wrote:
hephooey wrote:Not really an expert, I used to have a similar issue playing hevc and fixed by:

Code: Select all

echo 16 > /sys/module/amvdec_h265/parameters/dynamic_buf_num_margin
I do not know if libreELEC is already doing this or not, but maybe you can try it.
Just tested this and whadda ya know it WORKS !

ftdomen will be very happy. You can put that echo text into the autostart.sh in the .config directory until I compile the fix into platform_init for a permanent solution.

I think we should get hephooey over into the Slack - LibreELEC development board with all the inside AML knowledge his Mega brain contains ;)
We could surely use it !
ive tried this, all my hevc problematic media can be played now!

ftdomen
Posts: 25
Joined: Sat May 21, 2016 1:33 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: x265 video plays momentarily then freezes.

Post by ftdomen »

hephooey wrote:Not really an expert, I used to have a similar issue playing hevc and fixed by:

Code: Select all

echo 16 > /sys/module/amvdec_h265/parameters/dynamic_buf_num_margin
I do not know if libreELEC is already doing this or not, but maybe you can try it.
I could kiss you <3
wrxtasy wrote: ftdomen will be very happy. You can put that echo text into the autostart.sh in the .config directory until I compile the fix into platform_init for a permanent solution.
And you too <3

I was seriously dreading the prospect of re-encoding my entire library :D

Post Reply

Return to “CoreELEC/LibreELEC - Kodi Project for C1/C2”

Who is online

Users browsing this forum: No registered users and 0 guests