Jump to content
allanlee

AVS2 video codec support

Recommended Posts

allanlee

Last year there was UHD channels (namely CCTV4K) started broadcasting in AVS2 codec (ref).

I understand that there has been some discussions about AVS+ support before but it ended with some unpleasant issues.

However AVS2 is a brand-new open-souce codec, with similar compression efficiency as HEVC, mainly used by broadcasters in China.

 

Existing code examples could be found here:

Encoder xavs2 and decoder davs2.

There is not much available documents in English, I only found this one. However if necessay I may be able to help translate.

 

Attached are UHD and FHD ts samples, as well as a transponder dump from 125.0E 3970 H 15950 8PSK.

 

Hope support of AVS2 could be added to TransEdit and DMS (to recognize and correctly label the video stream); and if possible - HTTP/RTSP live streaming with DMS? As far as I know there no DirectShow decoder at this moment, only hardware-based decoder (HiSillicon Hi3798MV310 based players) could play m3u inputs.

 

Thank you very much in advance!

 

Share this post


Link to post
Griga
4 hours ago, allanlee said:

Attached are UHD and FHD ts samples, as well as a transponder dump from 125.0E 3970 H 15950 8PSK.

 

I can't download from this hoster. Firefox shows nothing at all,.Chrome shows the page and translates parts of it to German, but clicking "common download" prompts me to create an account for some chat facility, which i will not do, of course. Please choose a hoster whose page I can read (I will not click on something that I don't understand) and that does not try to push me to something in such an obtrusive way.

 

The TransEdit Analyzer is already able to detect AVS. However, there is still no way to read the video headers, due to te lack of suitable specifications, and no way to play this video format due to the lack of a suitable DirectShow decoder.

 

So the only thing that could be done with some efforts is to let the DMS send a (untranscoded) live stream to a client that knows how to handle it (not DVBViewer). I doubt that it is worth the hassle, though.

 

Share this post


Link to post
allanlee
1 hour ago, Griga said:

I can't download from this hoster.

 

My apologize, here they are.

https://drive.google.com/open?id=1qNYthdrvyl2TKvrgV9fS6KN38x99agFb

Do let me know if there's still difficulty downloading the samples.

 

If it's too troublesome to implement the streaming in DMS, will it be possible to get it done in TransEdit Analyzer?

 

Sorry again for the inconvenience caused by the file hosting.

  • Like 1

Share this post


Link to post
Griga
2 minutes ago, allanlee said:

will it be possible to get it done in TransEdit Analyzer?

 

It's already done. You can stream any selection of PIDs, regardless of the content and whether it is identified or not. Do you have a client that is able to play a TS containing AVS?

 

TransEdit is not able to detect AVS in your samples because  the stream type in the PMT is different compared to the AsiaSat sample that I got in 2013. They used 0x42, now it's 0xD2. It's from the range of stream types that is supposed to be used for private (proprietary) purpose. However, here someone mentions the usage  for AVS2.

 

It would be good to have a list of consistent stream type values that have been defined for AVS up to now. The usage of random values by broadcasters/developers because they are not specified clearly would make it very difficult for TransEdit.

 

Share this post


Link to post
allanlee
5 minutes ago, Griga said:

Do you have a client that is able to play a TS containing AVS?

 

Yes but not now - I have ordered a Hi3798MV310 based player which should be capable to decode both AVS+ and AVS2 video, as well as DRA audio, expected to recive it in... maybe 4-5 weeks.

 

AVS+ and AVS2 are 2 different encodings, just like H264 and HEVC, so it's not surprising to  have another stream type indicator. I tried to find specification documents but didn't manage to make any progress so far.

 

A more pratical way -- in my view -- would be to check through available samples, most terrestrial broadcastings (DTMB) in China use AVS+ and DRA for HDTV and AVS for SD; and most HDTV channels in 125C and 115.5C (ChinaSat 6A/6B) use AVS+ and AC3. If it helps, I can dump some samples for you to verify if they're using the same stream type indicator.

 

A side question - will it be possible for DMS to record and stream the channels with AVS+ & DRA?

 

 

Share this post


Link to post
Griga

I've used one the samples and made it a source for live simulation, so that DVBViewer assumes the input is a channel. After some changes in the code I managed to play the stuff (AC3 audio only) and to record it (video and audio). Hence recording will be possible with the DVBViewer Media Server. Streaming of the original TS will also work, I guess. However, transcoded streaming (e.g. with WebM or HLS as target format for playback in the browser) will require a ffmpeg.exe that supports AVS as input.

 

DRA Audio is another chapter. Never heard of it before. Samples are required.

 

Share this post


Link to post
lastcameleon
Posted (edited)

https://github.com/tianyigeng/DRA-Audio-System

 

RTP Payload Format for DRA Audio:
  https://tools.ietf.org/html/draft-xu-avt-dra-00
 

According to this page (Or what I can see of it) https://wenku.baidu.com/view/0733a4ef19e8b8f67c1cb9bc.html

   descriptor_tag = 0x05, descriptor_length = 0x04, format_identifier = 0x44524131 ('DRA1')

Edited by lastcameleon

Share this post


Link to post
Griga

The last link seems to provide some information about how DRA audio is encapsulated in a TS. That's what we need. Nevertheless samples are required so I can see how it looks like in practice.

 

If the Chinese way of using AVS and DRA for TV/Radio is supposed to become an international standard and to be supported by a wide variety of software, specifications should be published in English. I haven't seen it up to now. Maybe the Chinese government rather wants people to use Chinese software...

 

Share this post


Link to post
allanlee
16 minutes ago, Griga said:

Nevertheless samples are required so I can see how it looks like in practice.

 

Just a moment, I set up a DTMB device and Terrestrial anntena to get a sample for you.

 

17 minutes ago, Griga said:

specifications should be published in English

 

Will have to request here (as a company - maybe DVBViewer qualifies?): http://www.avs.org.cn/english/EnglishSpec.asp

 

22 minutes ago, Griga said:

Maybe the Chinese government rather wants people to use Chinese software...

 

Actually... most people use DVBViewer as PC software afaik. In contrast, the broadcasters always promotes their STB or other customized hardware players / boxes, whose picture quality are in general not as good.

Share this post


Link to post
Griga

Thanks for your efforts. Recording and (untranscoded) streaming of a TS containing AVS video and DRA audio is working now, and you can get TransEdit & DVBViewer & DMS test versions, if needed. I will post more details as soon as I find time for it.

 

Share this post


Link to post
Griga

Here is a more detailed list of what will work:

  • The TransEdit Analyzer detects AVS+ / AVS2 video and DRA audio in the PMT. The same applies to the TransEdit scanner and the DVBViewer scanner.
  • New video/audio format values for AVS video / DRA audio have been introduced in TransEdit, DVBViewer Pro and the DMS, so that they can be stored in scan results and channel lists.

Zwischenablage01.png

  • DVBViewer and DMS are able to record a TS containing AVS video / DRA audio, as well as  pure DRA audio as .dra file in case of radio or TV with the "audio only" recorder setting. However, due to lack of information about the DRA frame headers .dra files will only start in a "clean" way if the DRA frames are aligned with the PES packets.
  • DVBViewer as network client is able to receive HTTP and RTSP (Sat>IP) streams containing AVS video and/or DRA audio.
  • The DMS is able to stream an original TS containing AVS video and/or DRA audio via HTTP and RTSP (Sat>IP).

The following things won't work:

  • Playback of AVS video / DRA audio in TransEdit and DVBViewer, mainly due to the lack of suitable DirectShow decoders and missing knowledge about how format details can be retrieved from the video/audio headers (video resolution, aspect ratio, audio sample rate etc.).
  • Complete AVS video/DRA audio header information by  the TransEdit Analyzer -> Header Info function. Reason see above.
  • Transcoded streaming with DMS (particularly for playback in the browser) and transcoding recordings to other video/audio formats because FFmpeg.exe doesn't accept AVS video / DRA Audio input.
  • Including files with another container format than TS in the DMS media database, if the file contains AVS video, because MediaInfo.dll doesn't recognize it.

Regarding the fact that AVS was already introduced 14 years ago it is a quite poor result that the format is still unsupported by popular open source software like MediaInfo, FFmpeg, LAV Filters and VLC. VLC is at least able to detect AVS video (it is displayed in the Codec information), but the picture remains black. So I guess there is either AVS promotion missing (or specifications readable by Non-Chinese developers or code contributions by Chinese developers), or it is unwanted.

 

At least there is a book that contains a description of the DRA bitstream format (see here), but Google Books only provides parts of it. Particularly the frame header description ist missing.

 

Share this post


Link to post
allanlee

Thank you very much for the great efforts! :thumbsup:

I'll be more than happy to help test out with the "real life" networks, if necessary.

Share this post


Link to post
allanlee

Tested with DMS 2.1.5.1, everything works as expected.

A big thank you to the great work!

Share this post


Link to post
love727

Thanks very much!!!

 

sshot-2019-09-09-[00-38-16].jpg

sshot-2019-09-09-[01-05-37].jpg

Edited by love727

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...