Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 506322 - media-video/vlc - add x265/hevc support
Summary: media-video/vlc - add x265/hevc support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Paweł Stankowski
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-31 03:13 UTC by drunkenbatman
Modified: 2014-11-11 08:04 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description drunkenbatman 2014-03-31 03:13:32 UTC
Unable to play videos encoded in x265 (HEVC) within VLC on Gentoo, while it plays normally on Windows and such with the same version of the code base. Upgrading to GIT repo didn't solve it, nor did unmasking 2.2_rc2 and adding x265 keywords and make.conf (it looks like there is no x265 keyword for VLC currently).

I'm guessing this code is there, but gentoo isn't turning it on during buildtime?
Comment 1 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-03-31 18:18:44 UTC
The x265 package has been added on 12 March '14 to Gentoo; so, yes, I'll look at adding it. Currently it is forced to be disabled in the ebuild file; as the previous time I've looked into that, it wasn't in the Portage tree yet.
Comment 2 drunkenbatman 2014-04-03 05:00:58 UTC
I could be off on this, but I thought the external x265 was primarily for encoding whereas VLC primarily used ffmpeg's built-in x265/hvec, though currently the builds of ffmpeg that support (2.1ish?) it are hardmasked for unstable, though it's possible I'm off.
Comment 3 Nikoli 2014-05-03 04:00:01 UTC
Same problem here with libav-10: mpv plays HEVC videos fine, but vlc-2.1.4 fails.

P.S. Isn't x265 encoder only? It should not be related to decoding and playing anything.
Comment 4 drunkenbatman 2014-06-03 08:44:24 UTC
Yeah, I got emailed about this from the thread and there seems to be some confusion about x265 & HEVC. From my understanding, playback and encoding of x265 files are handled by two seperate packages: x265 (encoding) and openhevc/hevc (decoding).

The x265 package was added to portage and ffmpeg 2.x+ around October of 2013, which was recently unmaked for unstable, so ffmpeg can be used to encode the files but VLC on Gentoo isn't picking it up. No idea what is going on with openhevc, I believe it's already in ffmpeg (VLC on all other platforms can play it) or rolled in, and I know playback support was rolled in libav10 or so, but I didn't see any obvious use flags so maybe it isn't being broken out.

HIH
Comment 5 Nikoli 2014-06-03 09:35:04 UTC
Playing HEVC videos with avplay works fine too, so support for h.265 decoding is fine in libav-10.
Comment 6 drunkenbatman 2014-07-23 04:22:28 UTC
Tom,

Has there been any traction on this? Decode support for HEVC has been in VLC for nine months (since 2.1.1) in mp4/mkv/etc and it works on other platforms, so some module isn't getting compiled in.

It's starting to really hamper my ability to watch videos of uh gnome-tossing, as most of the gnome-tossing community started putting out mkvs with hevc, and I'm the odd man out in the discussions. It's worse than when I had to work late and everyone was telling me what happened the night before on Friends.

*gives the horns*
Comment 7 drunkenbatman 2014-07-23 04:29:19 UTC
As a quick followup, yeah hevc files play with ffplay as well, so this is just a VLC config issue.

*adjusts hair buns*

Help me Tom-Kenobi, you're my only hope.
Comment 8 Matteo Azzali 2014-10-28 18:41:42 UTC
take a look at https://github.com/strukturag/vlc-libde265
Comment 9 Yixun Lan archtester gentoo-dev 2014-11-08 20:02:44 UTC
have you tried version -9999? what's the output of "emerge --info media-video/vlc"?

it seems that vlc already support HEVC since 2.1.1 [1], and recently also added HEVC OMX hardware support via USE=omxil

[1] Changes between 2.1.0 and 2.1.1:
--------------------------------
Decoders:
 * VP9 support in WebM
 * HEVC/H.265 support in MKV, MP4 and raw files
 * Fix GPU decoding under Windows (DxVA2) crashes
Comment 10 drunkenbatman 2014-11-08 22:03:05 UTC
(In reply to Yixun Lan from comment #9)
> have you tried version -9999?

Yes, I've been staying abreast while trying to be respectful and understanding -- it's worked across all platforms for *a year* (win, osx, other linux variants) but hevc support on Gentoo hasn't happened. I was told this was turned off as a compile flag until x265 stabilized as a package, and explained that x265 was for encoding etc... it just isn't being rolled in and I'm not sure the current maintainers have the time or inclination to deal with it.

Support is everywhere else, so I encourage people to use mpv on Gentoo to play hevc files (be sure to compile in the lua interface so you can have an OSD).

> what's the output of "emerge --info media-video/vlc"?

media-video/vlc-2.1.5 was built with the following:
USE="X a52 alsa avcodec avformat bluray cdda dbus dts dvbpsi dvd encode ffmpeg flac fontconfig gnome libnotify matroska mmx mp3 mpeg ncurses ogg opengl opus png postproc pulseaudio qt4 sdl speex sse svg swscale theora truetype udev vorbis x264 xcb xml xv -aalib (-altivec) -atmo (-audioqueue) -avahi -bidi -cddb -chromaprint -dc1394 -debug -dirac -directfb (-directx) -dvb (-dxva2) -egl -faad -fdk -fluidsynth -gcrypt -gme -gnutls -growl -httpd -ieee1394 (-ios-vout) -jack -kate -kde -libass -libcaca -libsamplerate -libtar -libtiger -linsys -lirc -live -lua (-macosx) (-macosx-audio) (-macosx-dialog-provider) (-macosx-eyetv) (-macosx-qtkit) (-macosx-quartztext) (-macosx-vout) (-media-library) -modplug -mtp -musepack (-neon) -omxil -opencv -optimisememory -projectm (-qt5) -rdp -rtsp -run-as-root -samba -schroedinger -sdl-image -sftp -shout -sid -skins -taglib -test -tremor -twolame -upnp -v4l -vaapi -vcdx -vdpau -vlm -vnc -wma-fixed -zvbi" ABI_X86="64"

> it seems that vlc already support HEVC since 2.1.1 [1], and recently also
> added HEVC OMX hardware support via USE=omxil

VLC itself *does* have working hevc support since October of 2013. However, I'd encourage you to try it for yourself as it isn't actually rolled in on the Gentoo side, where it looks like it'd either need to be enabled by default or made contingent on a use flag. It's just fallen through the cracks at this point.

Interesting @ openmax supporting HEVC, however I'm not sure how it'd help in this case unless that was how VLC was decoding/displaying all hevc video internally, which I'm 99% sure isn't the case.
Comment 11 Paweł Stankowski 2014-11-08 23:11:28 UTC
@drunkenbatman, thank you for report and continuous feedback on that issue. I am new proxy maintainer of vlc. Sorry for delay, this package was unmaintained for some time, so there are many unresolved bugs waiting. Thanks for understanding.

When it comes to encoding, currently '--disable-x265' switch is hardcoded in ebuild, we will have to add new use flag for that.

I will have a closer look at the decoding issue next week. VLC uses libavcodec.so to decode HEVC, so this must be a problem with VLC<->libav communication.
Comment 12 Yixun Lan archtester gentoo-dev 2014-11-10 08:47:25 UTC
USE=x265 has been added to 2.2.9999 9999, current these are only two supported versions.

please reopen if you still have problem
Comment 13 Yixun Lan archtester gentoo-dev 2014-11-10 08:56:50 UTC
sorry for hevc support, it's fixed by following code, thanks

        # Disable avcodec checks when avcodec is not used.
-       sed -i 's/^#if LIBAVCODEC_VERSION_CHECK(.*)$/#if 0/' modules/codec/avcodec/fourcc.c || die
+       if ! use avcodec; then
+               sed -i 's/^#if LIBAVCODEC_VERSION_CHECK(.*)$/#if 0/' modules/codec/avcodec/fourcc.c || die
+       fi
Comment 14 drunkenbatman 2014-11-11 08:04:52 UTC
(In reply to Yixun Lan from comment #13)
> sorry for hevc support, it's fixed by following code, thanks
> 
>         # Disable avcodec checks when avcodec is not used.
> -       sed -i 's/^#if LIBAVCODEC_VERSION_CHECK(.*)$/#if 0/'
> modules/codec/avcodec/fourcc.c || die
> +       if ! use avcodec; then
> +               sed -i 's/^#if LIBAVCODEC_VERSION_CHECK(.*)$/#if 0/'
> modules/codec/avcodec/fourcc.c || die
> +       fi

Tested vlc-2.1.9999 ** and hvec playback works. You're all owed beer. Beer for everyone.

*gives the horns*