Cypheros Transportstream Forum

English-speaking Support => TS-Doctor 1.2 => Thema gestartet von: freebits am September 15, 2015, 18:29:04

Titel: Fixing HEVC based TS file
Beitrag von: freebits am September 15, 2015, 18:29:04
Hi,

I'm new to this TS-Doctor but saw some potentials in handling HEVC TS files.

My recordings are always messed up with incorrect bitrate and time stamp because of partially encrypted signals so I'd like to fix it using TSDoctor trial but it does not. The result of timestamp is also incorrect.

Can you improve TS-Doctor to fix my problem of HEVC based TS files?

You can download my sample file from the following link.

Thanks in advance,
Nam
Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 15, 2015, 21:11:36
Hi, thanks for the sample. HEVC is still rare.

There is a PCR jump at the point where commercials starting. TS-Doctor is misinterpreting this as PCR wrap and tries to fix that. It's not working with the detected timer offsets but it helps TS-Doctor to detect the real offset.

Open the fixed file again with TS-Doctor and the PCR jump will be detected and you get a dialog to fix the problem. After the second fix, PCR should be fine.
Titel: Re: Fixing HEVC based TS file
Beitrag von: freebits am September 16, 2015, 02:57:35
Thank you for the reply.

But unfortunately, the main recording (22gb) was not fixed via two time fix. The duration and bitrate info was not correct after 2nd fix and the TS-Doctor didn't ask for the fix of invalid PCR info at 2nd fix different from the sample. The previous sample was cut via Raw cutter in TS-Doctor btw.

Pls check the attached logs of main recording. Dunno if you need larger samples to investigate this.

Thanks.



Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 16, 2015, 08:38:42
Looks like there are much more jumps in the stream. It looks like the stream was glued together without regard of the timers.
I could try to make TS-Doctor aware of such a situation and scan not just for one but for multiple PCR jumps and remove the problems.

Interesting is the area of packet 43051028 to packet 49201466 because there are 3 "Strange PCR Jump" events in the log. If you use the raw cutter to give me a copy of this area, this would help me to find a cure for this case.

Lets round the positions to 43000000 for the start and 49210000 for the end, what would result in a file size of 1,2 GByte.
Titel: Re: Fixing HEVC based TS file
Beitrag von: freebits am September 16, 2015, 08:56:20
Thanks for the quick reply :)

Here's the link of the cut file as you instructed.

Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 16, 2015, 21:03:06
Great, download is in progress. I'll check it ASAP.
Titel: Re: Fixing HEVC based TS file
Beitrag von: freebits am September 17, 2015, 09:13:10
Zitat von: Cypheros am September 16, 2015, 21:03:06
Great, download is in progress. I'll check it ASAP.

Thank you. Do you think if it's possible to fix?
Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 17, 2015, 10:10:46
I guess it should be possible to fix the PCR problems.
Titel: Re: Fixing HEVC based TS file
Beitrag von: freebits am September 17, 2015, 10:26:57
Zitat von: Cypheros am September 17, 2015, 10:10:46
I guess it should be possible to fix the PCR problems.

Great. Will it take some more time?
Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 17, 2015, 17:30:20
I'm working on it.
Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 18, 2015, 01:56:49
OK, inplemented a new timer check and correction to fix this jumps. Next Beta is comming soon and will fix your UHD recording.
As you can see, duration of the file is OK now and it's fully playable.
[attachimg=1]

The problem with this file is not HEVC but the stupid timer jumps. I guess they have no the tools yet to assemble UHD content the right way.
Titel: Re: Fixing HEVC based TS file
Beitrag von: freebits am September 18, 2015, 02:57:07
Looks fantastic! Can't wait until new beta is out.   :D
Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 18, 2015, 02:58:53
Just wait some minutes more  ;D
Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 18, 2015, 03:09:33
OK, new Beta 1.2.174 (http://forum.cypheros.de/index.php?topic=9.0) is online and should fix your problems. It could be that you get an error message during garbage scan, that a PCR error is detected and you can "Virtually cut and reopen". Just ignore this error message, select "NO" and wait until you get this message:
[attachimg=1]

Select "Yes" and save the new file to a folder of your liking. This new file should be fixed now.
Titel: Re: Fixing HEVC based TS file
Beitrag von: freebits am September 18, 2015, 03:40:20
Thank you. Will test right away :)
Titel: Re: Fixing HEVC based TS file
Beitrag von: freebits am September 18, 2015, 07:45:41
Thank you so much, Cypheros. It's been working great for several large recording files.

But I have additional questions about TS-Doctor before buying it.

1. Can I skip audio detail scan? It takes very long time to scan PCR switching position and audio scan adds additional time to get the final fix if the recording is very long? It would be best if another option to on/off the audio detail scan is added so I can save some time fixing the recordings.

2. Auto cut does not work? We have some midprogram advertisings in the UHD channel but TS-Doctor doesn't ask if I'd like to cut them automatically or not. I think the problematic TS sample I shared had also the commercial for your test.

Thanks!
Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 18, 2015, 21:00:28
Hi, audio scan is needed to find changes in the format to detect commercials.

Commercials are detected with different methodes like audio or video format changes. Not every channel has such format changes. But we are working on a new version using video analysis to detect video changes and channel logos to distinguish movies from commercials.
Titel: Re: Fixing HEVC based TS file
Beitrag von: Djfe am September 18, 2015, 22:12:15
is it desired behaviour, that a dialogue is shown, that has to be ignored?

or is this case unlikely in comparison and there is no other way to show the right dialogue first?
Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 18, 2015, 22:23:37
That would break other fixes. Sometimes streams are so scrambled or damaged, it's better to stop processing such files in an early stage.
Titel: Re: Fixing HEVC based TS file
Beitrag von: freebits am September 19, 2015, 13:56:41
Thank you.

Understood your point.

Btw, I see some recordings fixed by TS-Doctor have slight audio sync issue (Audio is slightly faster than video) and some are good in sync.

This fix does not touch anything regarding to Audio sync stuff and is it purely because of recording error or signal strength when audio is out of sync?
Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 19, 2015, 19:15:39
The fix doesn't change the synch because all timers (audio, video, subtitles, etc. ) are changed with the same value. Most sync problems are caused by errors during remuxing to other container formats like MKV, MP4, ...
If you have a transport stream with lost packets due to reception problems, remuxers tend to ignore missing audio parts and you'll get an audio stream that is shorter that the video stream. That causes the sync problems. As you stay with transport stream format, any part of the stream has it's own timers to keep audio and video in sync, even if some audio or video packets get lost during transmission.
Titel: Re: Fixing HEVC based TS file
Beitrag von: freebits am September 19, 2015, 19:23:43
Zitat von: Cypheros am September 19, 2015, 19:15:39
The fix doesn't change the synch because all timers (audio, video, subtitles, etc. ) are changed with the same value. Most sync problems are caused by errors during remuxing to other container formats like MKV, MP4, ...
If you have a transport stream with lost packets due to reception problems, remuxers tend to ignore missing audio parts and you'll get an audio stream that is shorter that the video stream. That causes the sync problems. As you stay with transport stream format, any part of the stream has it's own timers to keep audio and video in sync, even if some audio or video packets get lost during transmission.

Thank you.

I meant the fixed TS stream not the remuxed mkv or mp4.
I thought the attached log is from the relative very clean TS recording and I saw audio is slight ahead of video during the whole play.

Can the delay below found in the log affect the audio/video sync?

Video PCR to PTS difference -912 ms
$01A1: Delay to video stream = -494ms

Can I add audio delay in millisecond when cutting/fixing the file to have better sync?
Titel: Re: Fixing HEVC based TS file
Beitrag von: Mam am September 19, 2015, 19:28:27
Zitat von: Cypheros am September 19, 2015, 19:15:39
any part of the stream has it's own timers to keep audio and video in sync, even if some audio or video packets get lost during transmission.
It would not a too bad idea for the Doctor to insert dummy (silence) audio packets as fillers during the "repair run"... Many many reported problems would have been vaporized instantly. This is not too complicated for MPEG and Dolby tracks, AAC and MP3 are not so easy to handle because they are compressed.
But for the people it would be enough to be able to keep an MPEG track in synch whiles losing an AAC one. Better ANY working track than NONE...
Titel: Re: Fixing HEVC based TS file
Beitrag von: Derrick am September 20, 2015, 00:10:52
ZitatThis is not too complicated for MPEG and Dolby tracks, AAC and MP3 are not so easy to handle because they are compressed.
All types you've enumerated are compressed  8)
Titel: Re: Fixing HEVC based TS file
Beitrag von: freebits am September 20, 2015, 04:36:43
Cypheros,

Another observation is I don't get message like 'PCR error is detected and you can "Virtually cut and reopen' in a larger recordings.

The only files that I got such message was rather smaller recordings like 1gb or so.

When I get the message?
Titel: Re: Fixing HEVC based TS file
Beitrag von: Mam am September 20, 2015, 06:48:32
Zitat von: Derrick am September 20, 2015, 00:10:52
All types you've enumerated are compressed  8)
Sometimes people mix up "multiplexed" or "encoded" with "compressed"...

Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 20, 2015, 14:38:11
Zitat von: freebits am September 20, 2015, 04:36:43
Another observation is I don't get message like 'PCR error is detected and you can "Virtually cut and reopen' in a larger recordings.
When I get the message?

At the beginning of the analysis the start an the end of the file is checked for PCR erratic fluctuations. I guess the problem file has commercials at the start or end, where many PCR jumps are detected.
Titel: Re: Fixing HEVC based TS file
Beitrag von: freebits am September 21, 2015, 13:38:50
Okay. Then can I adjust the audio delay from the fixed recording?
Titel: Re: Fixing HEVC based TS file
Beitrag von: Cypheros am September 21, 2015, 14:27:40
The delay between audio and video you can find in the log is no error, that's OK for transport streams. It will be automatically corrected during playback.

I checked your samples and audio video sync is OK. Please be aware that playback of UHD will bring your computer to the limits. If CPU usage is at maximum, the system is not able to keep audio and video in perfect sync.
Try to playback with a H.265 capable hardware decoder like Samsung UHD TV and you'll see that audio and video is in sync.
Titel: Re: Fixing HEVC based TS file
Beitrag von: freebits am September 21, 2015, 15:24:42
Zitat von: Cypheros am September 21, 2015, 14:27:40
The delay between audio and video you can find in the log is no error, that's OK for transport streams. It will be automatically corrected during playback.

I checked your samples and audio video sync is OK. Please be aware that playback of UHD will bring your computer to the limits. If CPU usage is at maximum, the system is not able to keep audio and video in perfect sync.
Try to playback with a H.265 capable hardware decoder like Samsung UHD TV and you'll see that audio and video is in sync.

I test those clips via 4K UHD media player supporting hw acceleration of HEVC stream and saw the audio sync issue from it. Anyway, will test it again after remuxing it with some delay using ffmpeg or so..