Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#5356 closed Feature Request (fixed)

Add support for DVB HEVC services

Reported by: Robert Schlabbach Owned by: Underground78
Priority: normal Milestone: 1.7.9
Component: General Version: 1.7.8
Severity: normal Keywords: DVB HEVC
Cc: Evaluation:

Description

Germany is switching to DVB-T2/HEVC and pilot broadcasts are already running in Berlin. MPC-HC's DVB-T/T2 device support finds the mux and would have the decoders to play the programs, but unfortunately the parser is lacking the definitions to recognize HEVC services via DVB.

First off, this file needs to be updated:
https://github.com/mpc-hc/mpc-hc/blob/develop/src/DSUtil/Mpeg2Def.h

The enum PES_STREAM_TYPE needs the new types added in H.222.0 2014-10 (actually it only needs one, but why not do it nicely):

VIDEO_STREAM_JPEG2000 = 0x21, / / ITU-T Rec. T.800 | ISO/IEC 15444-1
ADDITIONAL_VIEW_MPEG2 = 0x22, / / ITU-T Rec. H.262 | ISO/IEC 13818-2 Additional view for compatible 3D
ADDITIONAL_VIEW_H264 = 0x23, / / ITU-T Rec. H.264 | ISO/IEC 14496-10 Additional view for compatible 3D
VIDEO_STREAM_H265 = 0x24, / / ITU-T Rec. H.265 | ISO/IEC 23008-2 video stream
VIDEO_SUBSET_H265 = 0x25, / / ITU-T Rec. H.265 | ISO/IEC 23008-2 Annex A temporal video subset
MVCD_H264 = 0x26, / / ITU-T Rec. H.264 | ISO/IEC 14496-10 Annex I MVCD video sub-bitstream

The enum SERVICE_TYPE needs the new DVB service type for HEVC services due to be added in ETSI EN 300 468, currently published in bluebook a38 (https://www.dvb.org/resources/public/standards/a38_dvb-si_specification.pdf), page 97:

HEVC_TV = 0x1F

Then add a name for the HEVC stream type here:
https://github.com/mpc-hc/mpc-hc/blob/develop/src/DSUtil/DSUtil.cpp

In method StreamTypeToName(PES_STREAM_TYPE _Type) add the switch case:

case VIDEO_STREAM_H265:

return L"H265";

The we need a new DVB_STREAM_TYPE in this file:
https://github.com/mpc-hc/mpc-hc/blob/develop/src/mpc-hc/DVBChannel.h

Assuming this is an MPC-private enum, I'll just pick an available number:

DVB_H265 = 0x05,

Now add translation from the H.222.0 PES stream_type to the MPC stream type here:
https://github.com/mpc-hc/mpc-hc/blob/develop/src/mpc-hc/Mpeg2SectionData.cpp

In method CMpeg2DataParser::ConvertToDVBType add the switch case:

case VIDEO_STREAM_H265:

return DVB_H265;

In method CMpeg2DataParser::ParseSDT(ULONG ulFreq) in the switch (serviceType) just add one case line to the existing ones:

case HEVC_TV:

In method CMpeg2DataParser::ParsePMT(CDVBChannel& Channel) add near the end:

} else if ((Channel.GetVideoType() == DVB_H265) && (Channel.GetVideoPID())) {

if (Channel.GetVideoFps() == DVB_FPS_NONE) {

Channel.SetVideoFps(DVB_FPS_25_0);

}

Add recognition of HEVC video streams here:
https://github.com/mpc-hc/mpc-hc/blob/develop/src/mpc-hc/DVBChannel.cpp

In method CDVBChannel::AddStreamInfo in the switch (nType) just add one case line to the existing DVB_MPV/DVB_H264:

case DVB_H265:

Now add another name for the HEVC stream type in the tuner scan dialog:
https://github.com/mpc-hc/mpc-hc/blob/develop/src/mpc-hc/TunerScanDlg.cpp

In method CTunerScanDlg::OnNewChannel(WPARAM wParam, LPARAM lParam) add before or after the "if (channel.GetVideoType() == DVB_H264)":

if (channel.GetVideoType() == DVB_H265) {

strTemp = _T(" H.265");

And finally, the BDA filter graph needs additions:
https://github.com/mpc-hc/mpc-hc/blob/develop/src/mpc-hc/FGManagerBDA.cpp

If needed, I can try to provide details here, but I hope copying all the 264 stuff and changing it to 265 will do the trick...

Attachments (3)

MPC-5356-1.png (86.4 KB) - added by Robert Schlabbach 5 years ago.
MPC-5356-2.png (997.5 KB) - added by Robert Schlabbach 5 years ago.
MPC-5356-3.png (1.3 MB) - added by Robert Schlabbach 5 years ago.

Change History (10)

comment:1 Changed 5 years ago by Underground78

Milestone: next release
Owner: set to Underground78
Status: newaccepted

comment:2 Changed 5 years ago by Underground78

Here is a first test build. I would be surprised if it worked at first try to be honest.

Changed 5 years ago by Robert Schlabbach

Attachment: MPC-5356-1.png added

Changed 5 years ago by Robert Schlabbach

Attachment: MPC-5356-2.png added

Changed 5 years ago by Robert Schlabbach

Attachment: MPC-5356-3.png added

comment:3 Changed 5 years ago by Robert Schlabbach

Sorry to "disappoint" but this indeed worked at first try. Please see the attached screenshots. The test channels play nicely, with HEVC video and Enhanced-AC3 audio. Only the 1080i test service is not correctly detected, but that's already known (ffmpeg ticket #4141).

The properties window is a bit off in the list at the bottom, but I found it's just as off on DVB-T/MPEG-2 services.

So the patch looks good to me. Thank you very, very much for your prompt action!

comment:4 Changed 5 years ago by Underground78

Well that's certainly good to know. Thanks for the pointers!

comment:5 Changed 5 years ago by Underground78 <underground78@…

Resolution: fixed
Status: acceptedclosed

In 41e7c5:

DVB: Support HEVC broadcasts.

Based on changes suggested by robert_s.

Fixes #5356.

comment:6 Changed 5 years ago by Underground78

Milestone: next release

Will be in the nightly builds as of version 1.7.8.140.

comment:7 Changed 5 years ago by thevbm

Milestone: next release1.7.9

Milestone renamed

Note: See TracTickets for help on using tickets.