Processing + muxing of MPEG2 elementary video stream

Started by poutnik, January 08, 2015, 07:22:51 AM

Previous topic - Next topic

poutnik

I use current Win64 ADM 2.6.8  beta from DEC 4., aside of alternative processing chain of MeGUI/Avisynth.

I process exclusively DVB-T PAL SD MPEG2-PS material, with occasional PS corruptions.
They usually lead to slight audio shifts only, what ADM2.6 can usually managed by its fortunate timestamp approach. 
But sometimes ADM fails. being more picky than ProjectX, so I go via ProjectX + MeGUI ways.

Recently, I have tried ADM to process and remux ProjectX outputs MPEG2 M2V elementary stream + WAV audio stream.
As there is said ADM can read MPEG2 elementary stream

http://www.avidemux.org/admWiki/doku.php?id=using:cutting_mpeg_files.

But the opening trial of elementary stream has lead to ADM refuting, with message it cannot find demuxer for it ( like if could be demuxed ).
ES was correct, processed later fine by MeGUI DGindexer and OneClick procedure.

Is anything related corrupted in current ADM Win64 public compilations, or have I chosen incorrect procedure ?

BTW, what I like on ADM, compared to MeGUI, is convenience of the cutting.
I often choose batch  MPEG2 PS processing by MeGUI Oneclick.
Often even without PX, as documentaries are less critical than direct speech.
Then I do commercials cutting in final MP4/AVC/AAC in ADM on I-frames ( I do not insist of frame precission ).


AQUAR

I don't think elementary streams are supported by ADM 2.6.
ADM 2.5 supports these and is usually a better option for working with MPEG2.

poutnik

Hmmm, good to know, it would not come to my mind that the feature could be removed (or rather not re-implemented yet ? )

I prefer ADM 2.6 due timestamp approach versus frame approach of ADM2.5 - what is  not needed anymore after ProjectX  A/V shift out-of-sync fixing.


poutnik

As ADM 2.5 alone, with frame approach,  is unusable for MPEG2 PS with occasional stepwise A/V out-of sync  issues .


AQUAR

Yes - that is probably due to transmission errors causing frame drops.
ADM 2.5 won't do continuous resyncing.

I think You will need to use ProjectX.

poutnik

Yes, that is true.  But it is rather audio frame dropping, as audio content comes too soon, not too late.
But ADM 2.5 does not support - at least I was told so once - synchronized cutting of separated V and audio streams.

It is more handy to do All processing in MeGUI, or to make batch OneClick unattended MeGUI processing,
and then to do ADM MP4/AVC/AAV cutting at I-frames.

AQUAR

I think it depends on what is being dropped as a result of packet losses/errors during transmission of the mpeg2-TS.
Since you mentioned you were processing mpeg2-PS, I presume that is by way of recording/remuxing that DVB.

Hence dropped video frames (GOP's) or audio samples.

Have you tried just remuxing the m2v + wav into MKV with bitstream timing correction (MKV toolnix) and see if ADM 2.6 is a usable option then? 
(don't know if it will help but I always try MKV toolnix as a fixit option).

poutnik


It seems the audio frames are dropped, as PX fixes of videoframes are rare, but inserting of 5 audio frames  ( 120 ms ) is frequent.
As my first step is MPEG2 PS --> PX --> fixed M2V +WAV, I suppose mixing to MKV could help.

Jan Gruuthuse

#8
If you have the option? Try your recording in mpeg-2.ts instead of mpeg-2.ps. The same would go for mpeg-4.ps/mpeg-4.ts.

Other won't agree: do simple basic explanation is found here:
QuoteThe two major features of the Transport Stream are error checking/correction and stream synchronization. When they designed this system, they knew that data will be transmitted over wide distances over many kinds of cables, technologies and boxes. This exponentially increases the chances of error and corruption, not to mention signal degradation (loss of signal strength).

So, if program stream is a bull pen for domesticated animals, the Transport Stream is an iron cage for wild animals. It is far stricter, and stronger, overall. What do I mean by ââ,¬Ëœstrongerââ,¬â,,¢? To put it jokingly, if Program Stream faced Transport Stream in a boxing match, TS would win in the first round via knockout. That tough.

This robustness of the transport stream is one reason why it is widely used in terrestrial and satellite broadcast, even today. The MPEG TS is the container of choice for 90% of the worldââ,¬â,,¢s broadcast. No matter what you shoot in: RAW, H.264, HDCAM SR or film, your beloved content is converted and broadcast as MPEG-TS.
source: http://wolfcrow.com/blog/program-stream-vs-transport-stream-the-simple-difference/

If the audio shift is happening with AC3 audio track on computer? See if the audio shift is happening to, on other hardware media players like from usb stick on dvd player/flatscreen tv, STB, home serve DLNA capable?
Processing ac3 on computers does require more processing time/processor power: so it could happen this is a cause.

poutnik

@Jan Gruuthuse>  Hm, my understanding was, that my USB DVB-T  Leadtek DONGLE GOLD extract from VF signal TS anyway. I use SmartDVB for recording, offering both PS ( like mpg) and TS. I suppose the difference will be only, what is doing during TS-PS conversion SmartDVB, and what could eventually do ADM, if it can read it. Should I understand it as if I record to PS, ADM should read and decode it better, without need of fixing of damaged streams and A/V sync ?

Note that my MPEG2 PS SD recordings have exclusively MP2 audio.

I have not experimented with TS for a long time.
When I used original Leadtek application WinfastPVR2, it used to record to TS all the channels of the frequency, what I did not  like, and processing it was very inconvenient, as available tools were limited

AQUAR> , I can conveniently mux PX fixed MPEG ( m2v) + WAV into MKV vian MeGUI-mkvmerge mixing. BUT, while cutting in ADM is more convenitent for me than in MeGUI, batch processing is more convenient in MeGUI - dealing with job manager is less than optimal.

I agree it is looking for a Holy Graal to have an application, optimal in all aspects.   ;D

Jan Gruuthuse

Quote from: poutnik on January 12, 2015, 07:20:57 AM
@Jan Gruuthuse>  Hm, my understanding was, that my USB DVB-T  Leadtek DONGLE GOLD extract from VF signal TS anyway. I use SmartDVB for recording, offering both PS ( like mpg) and TS. I suppose the difference will be only, what is doing during TS-PS conversion SmartDVB, and what could eventually do ADM, if it can read it. Should I understand it as if I record to PS, ADM should read and decode it better, without need of fixing of damaged streams and A/V sync ?

Note that my MPEG2 PS SD recordings have exclusively MP2 audio.

I have not experimented with TS for a long time.
When I used original Leadtek application WinfastPVR2, it used to record to TS all the channels of the frequency, what I did not  like, and processing it was very inconvenient, as available tools were limited

TS recording should be the raw stream as it comes from DVB-T transmitter and TS recording would probably be the preferred way of doing so. ADM 2.6.8 win64 should be able to deal with these correctly. Make a test recording and see how it handles for you.
If there are issues with the mpeg-ts recording: not loading, not indexing correctly, ....
-Make a 1 minute recording of the channel(s) posing the problem. Upload it to publicly accessible website (like dropbox, ...)
- Post a new thread describing the issue(s) and include output from terminal window and provide a link to the uploaded file.
Time permitting the developer(s) could have a look at that issue, currently time is not abundant, so it could take a while.

poutnik

Generally, ProjectX is usually able to fix MPEG2 PS recordings, even if ADM2.6 breaks it teeth on that.
Should I suppose ADM reading transport stream will be as good as PX reading program stream .

Note that I did try/remember trying way of PX fixing TS.
I do it calling CMD batch ( MPG --> PX --> M2V + WAV

Jan Gruuthuse

#12
It gets very confusing:
Quote from: poutnik on January 12, 2015, 01:06:07 PMI do it calling CMD batch ( MPG --> PX --> M2V + WAV
recording .mpg or mpeg-ps -> projectx -> m2v + wav?
Most likely:
Recording mpeg-ts -> ADM 2.6.8 (win64 from 2015-jan-11) -> cut commercials -> wanted container (probably mkv) keep video and audio codec.
Moving video between different programs probably causes issues, and developer(s) probably don't going to spend much time looking in to this.

DVB-T is already prone to interference. Weakening the available content by storing in .ps container is not much of a big help either.

So I provided you with all the available info from my side and leave you recording in mpeg-ps.


poutnik

Sorry to confuse you. 

My current recording until now was SmartDVB to MPG PS, as I was bad experience from past in TS processing.
Now I decided to switch to TS, as I realized it is easy in ADM - thanks for valuable info.

Processing mpeg-ps -> projectx -> m2v + wav was my way, if I used MeGUI path, or if ADM refuted to process MPG PS.

>> Recording mpeg-ts -> ADM 2.6.8 (win64 from 2015-jan-11) -> cut commercials -> wanted container (probably mkv) keep video and audio codec.

I resize and reencode on the purpose from MPEG2/MP2  to AVC/AAC to use Smartphone screen and fit its limited storage.

In my experience, moving video between programs does not cause issues. Issues are caused by data quality of DVB-T and of ADM itself.
As it was and is always easy to crash Win32/64 ADM 2.6. But I like ADM in spite of that.

I have always thought is is just matter if data are stored before TS2PS decoding  as TS, or after TS2PS decoding, as PS. As DVB-T is broadcast always as TS.  But perhaps not and I was wrong. I hope ADM can process any MPEG2 TS I will feed to it.

Anyway, thank you for your help.

hinterwaeldler

Hi,

afaik DVB-? is always transmitted in MPEG2TS, at least as long as SD material is considered. ProjectX is able to restore the sync problems quiet well, as long as there is no change in the amount of audio channels within the stream. The later can be seen when take a look at streams containing ac3 sound. A good indicator is the switch between the regular program and the commercial in between. As long as the cutting only within these boundaries, projectX seems to works quite well.

A point which confuses me a little is the audio stream of your records. At least I've only seen mp2 and ac3 sound in my DVB-S2 records, but not sure, if DVB-T/T2 behaves different.

From my current experience working with TS in avidemux 2.6 works quite well (haven't tested ac3 sound for a while). If there should be some problems a prestep with projectx should help out, as it seems to be more robust
>> Recording mpeg-ts (direct stream to disk should fit) -> (projectX (optional step)) -> ADM -> cut/... -> wanted container/codec