Opened 9 years ago

Closed 6 years ago

#12565 closed bug (fixed)

HEVC/H.265 file extensions not recognized

Reported by: vidrep Owned by: nobody
Priority: low Milestone: Unscheduled
Component: Audio & Video/Codecs Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

FFmpeg has implemented support for HEVC/H.265 decoding since October 2013. It would be nice to see this format supported in Haiku.

Attachments (3)

tearsofsteel-haiku.jpeg (609.8 KB ) - added by cocobean 6 years ago.
Tears of Steel on Haiku hrev 52012
h265testing-haiku.jpeg (570.7 KB ) - added by cocobean 6 years ago.
H.265 test on Haiku hrev 52012
screenshot1.png (75.5 KB ) - added by vidrep 6 years ago.

Download all attachments as: .zip

Change History (23)

comment:1 by pulkomandy, 9 years ago

do you have a link to a sample file for testing?

comment:3 by vidrep, 9 years ago

While it would be "nice" to see this added, getting YouTube working with ffmpeg is probably a better investment of developer time.

comment:4 by waddlesplash, 8 years ago

Priority: normallow
Type: bugenhancement

comment:5 by vidrep, 7 years ago

This would be a nice enhancement for 64 bit Haiku. Tested with mplayer on 64 bit, which plays video perfectly, but without any audio.

https://launchpad.net/ffmpeg/+announcement/12062

https://trac.ffmpeg.org/wiki/Encode/H.265

Last edited 7 years ago by vidrep (previous) (diff)

by cocobean, 6 years ago

Attachment: tearsofsteel-haiku.jpeg added

Tears of Steel on Haiku hrev 52012

by cocobean, 6 years ago

Attachment: h265testing-haiku.jpeg added

H.265 test on Haiku hrev 52012

comment:6 by cocobean, 6 years ago

Resolved. Tested on hrev52012 x86_64. Grab several videos from links above. Tested Austrian Alps and Tears of Steel H.265 videos as well as a few others and playback through MediaPlayer up to 4K video resolution.

Last edited 6 years ago by cocobean (previous) (diff)

comment:7 by waddlesplash, 6 years ago

Resolution: fixed
Status: newclosed

comment:8 by vidrep, 6 years ago

Resolution: fixed
Status: closedreopened

This is not fixed! HEVC is a particular type of H265 that is supported in ffmpeg but not yet on Haiku.

by vidrep, 6 years ago

Attachment: screenshot1.png added

comment:9 by waddlesplash, 6 years ago

Um, HEVC *is* H265, they are the same thing. That is probably a MPEG-4 container, try renaming it to .mp4 and see if it plays.

comment:10 by vidrep, 6 years ago

If you rename to .mkv then it plays.

comment:11 by vidrep, 6 years ago

We need to set the .hevc file association for instances where that extension is used. We can't expect everybody to change file names all the time. Click and play.

Last edited 6 years ago by vidrep (previous) (diff)

comment:12 by waddlesplash, 6 years ago

If it's really a .mkv, then we should be detecting this via sniffer, not depending on filename.

comment:13 by vidrep, 6 years ago

I'm not sure if that's what PulkoMandy did to enable AVCHD files, which can use either M2TS, MTS or M2T.

comment:14 by cocobean, 6 years ago

Ah, you want *.hevc file association to a specific program. I read the ticket as we couldn't playback/decode HEVC videos in Haiku (at all).

@vidrep - I did this by select file -> right click on file -> Select 'Get Info' on file _> Select Default application {Mediaplayer, MPlayer, etc) Then when I click on file it works with the app/tool selected.

The 'better' global way is to go: Desktop->System->Preferences->FileTypes You'll see the FileTypea panel for selecting your application and a 'file recognition' window for the adding your file extensions. You can select 'MediaPlayer playlist' and then add '.hevc' and '.h265' extension to file recognition window. Go to top menu 'File' and Quit (it will save info when added).

comment:15 by pulkomandy, 6 years ago

File extensions should not be used anywhere, but MediaPlayer will reject files if there is no media/* type assigned to them, IIRC. We should just add the appropriate sniffing rules if we're missing some, then.

We don't use the filename ourselves, however we do forward it to ffmpeg as it helps in some corner cases (eg. detecting Amiga MOD files, which don't really have any useful header).

comment:16 by mmlr, 6 years ago

Indeed sniffer rules should be used instead of file extensions. In either case, HEVC is a video codec, not a container format. So HEVC data does not come as a standalone file but the bitstream is put in a specific container (Matroska, WebM, MP4) to hold additional metadata and other streams (i.e. audio, subtitles, timecodes, ...). An actual file then gets the extension from the container. So adding blank hevc or h265 extensions doesn't make much sense to me. For these initial samples there may be a variety of extensions used, but when HEVC use becomes more common this will probably go away. Afterall you don't usually see files with an h264 extension either.

comment:17 by vidrep, 6 years ago

Summary: Add support for HEVC/H.265 Decoding (enhancement)HEVC/H.265 file extensions not recognized

MediaPlayer does indeed play these files, but only after manually changing the file extension to one that is recognized. I have changed the ticket description to better reflect the real issue.

comment:18 by vidrep, 6 years ago

Type: enhancementbug

comment:19 by cocobean, 6 years ago

@vidrep - Tested on hrev52064 x86_64. Confirmed MediaPlayer works with HVEC/10-bit color video files w/FFmpeg 4.0.1. I tested it without any file extension and runs smoothly @1080p and @2160p with some minor stuttering/frame drops at UHD/4K (impressive). I renamed the file extensions to something obscure (*.new) and MediaPlayer still handled the H.265/HVEC files correctly.

I was using mplayer/mpv but now MediaPlayer seems to handle the files much better than before. Minor issues with 'out of memory' and audio issues on backend with certain files - but still plays.

Tested on hrev52073 x86 w/MediaPlayer - A mangled video appears and plays - there is a decoder error and video is scrambled. NOTE: H.265 can play some HVEC videos, but does not seem optimized for x86 platform (plays sound OK, but drops video frames heavily).

UPDATE: Test video files now work with mpv 0.28.2-1 playback on hrev52084+ on x86_gcc2 and x86_64.

Haiku hrev52073 x86 w/MediaPlayer and HVEC 10-bit video (has issues)

MediaTrackVideoSupplier::_SwitchFormat() - fVideoTrack->DecodedFormat(): General system error - retrying with B_RGB32
[hevc @ 0x19203800] Could not find ref with POC 2
[hevc @ 0x19203800] Could not find ref with POC 0
[hevc @ 0x19203800] Could not find ref with POC 4
should skip -1 lines at bottom!

Haiku hrev52064 x86_64 w/MediaPlayer and HVEC 10-bit video (works)
MediaTrackVideoSupplier::_SwitchFormat() -  codec changed colorspace of decoded format (B_YCbCr422 -> B_RGB32)!
should skip -1 lines at bottom!


=== Below, this part happens on both Haiku x86 and x86_64 w/MediaPlayer and HVEC 10-bit video

VideoConsumer::CreateBuffers - ERROR CREATING VIDEO RING BUFFER (Index 0 Width 1920 Height 1080 Colorspace 8: Out of memory
VideoConsumer::Connected - COULDN'T CREATE BUFFERS
BMediaRoster::Connect: aborting after BBufferConsumer::Connected, status = 0x80000000
VideoProducer::Connect() - consumer error: Out of memory
BMediaRoster::Connect: aborted
Can't connect the video source to the video window... trying without overlays, error: Out of memory
running without audio node
Version 5, edited 6 years ago by cocobean (previous) (next) (diff)

comment:20 by waddlesplash, 6 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in hrev52329.

Note: See TracTickets for help on using tickets.