Log in

View Full Version : VobBlanker to cut part of cell - Duration of video is wrong when demuxing


pascalwil
25th January 2010, 11:35
Hi there,

I have successfully edited a DVD with VobBlanker to remove part of a cell by cutting it.

The resulting DVD created by VobBlanker seems OK when played on my PC (duration is right).

But when I demux the DVD with PgcDemux I get a M2V video file which has the duration of the original DVD (before the cut).
The audio file is fine.

Is there something I'm doing wrong with VobBlanker?
Whatever I do, cutting with or without splitting (and creating a new chapter), I get the same result. DVD has right duration but demuxed M2V is wrong.

I wonder how come the M2V has kept the original duration when the edited DVD is shortened. Is there something in the IFOs or is it in the VOBs?

Someone can help me sort out this problem and find a solution?
Thanks.

Ghitulescu
25th January 2010, 13:37
Did you use FixVTS? I don't think so :p

pascalwil
25th January 2010, 14:02
Sorry I forgot to mention I did use FixVTS (on the entire DVD)

Ghitulescu
25th January 2010, 16:35
Have you only checked the duration or you did indeed played that file for the whole duration?

pascalwil
25th January 2010, 16:41
Yes I played the file with KMPlayer and the duration mentionned by the player is fine, ie new one after cut.
It's the demuxed M2V file which has a wrong duration (original instead of new).
MediaInfo reports original duration. So does TMPGENc when importing file.

blutach
25th January 2010, 23:11
Did you fix the pointers when cutting?

Regards

pascalwil
25th January 2010, 23:29
Thanks for your support.
blutach I'm not sure I understand what you mean by fixing the pointers. It doesn't ring a bell.
What are you refering to? Is that an option I missed in VobBlanker?

Cheers

blutach
26th January 2010, 00:20
It's a VobBlanker option and on reflection, it wouldn't matter. Sounds like there a time code error in the MPEG stream (caused by cutting). Something like Womble MPEG DVD (not free) can fix these errors.

Regards

bigotti5
26th January 2010, 02:09
Use Restream (http://www.videohelp.com/tools/Restream) to fix GOPheader-timecode

pascalwil
26th January 2010, 12:24
Thanks for the tip bigotti5.
I'm working on Restream. Looks promising!

Cheers

pascalwil
26th January 2010, 17:19
bigotti5

Can you help with Restream? Not sure which options to use.

So far I've managed to change the duration but doesn't seem to be a good M2V since error when muxing with IfoEdit.

bigotti5
26th January 2010, 20:47
Check "reset timestamps" as shown in the image, check destination file - dont alter anything else

http://members.aon.at/video.digital/ssh.png

pascalwil
26th January 2010, 21:05
Thanks a lot.

Was kind of afraid to read this. Was the obvious choice! Was expecting something else a bit more tricky.
Have done as instructed and as I said the new M2V has the right duration but is still not good enough to be remuxed with IfoEdit.

Don't know what else to do. If someone comes up with a new idea. You're welcome.

Thank you all for your help.

Cheers

bigotti5
26th January 2010, 21:59
...but is still not good enough to be remuxed with IfoEdit.

Due to your precise error report it is very easy to answer...

pascalwil
26th January 2010, 22:37
You've got a point biggoti5. Sorry!
I've worked on this problem since.

Here are some details.
IfoEdit message says: INTERNAL ERROR: additional data required but no free space in input buffer
When I click OK it carries on. In log window it says Stream 0x80 completed, Frames: 3032 and it goes fine until the end.

Log reports 3033 syncwords and 3033 frames for audio
I get a DVD with the right duration. Video is fine but audio is missing after the cut (but not right after it) for the rest of the DVD.

Sounds like an audio problem now. Right? But the audio file plays OK for the full length. Haven't got a clue what it is.
Any tool to fix the audio in case it got also corrupted by the cutting?

Cheers

pascalwil
26th January 2010, 22:58
I got the idea of running audio file through eac3to to create a new audio file.
eac3to reports track is not clean. There is something wrong with audio!
New audio file seems OK. No more message when muxing with IfoEdit.

I'm getting there!

Thanks again for your help.

Cheers

pascalwil
27th January 2010, 12:09
Hi there,

Seems I got a remuxed DVD from ifoEdit that is OK for both audio and video.

But is there an audio tool around able to fix bad streams without re-encoding? Actually I'm not sure eac3to has re-encoded the audio, I'm just guessing.
For DTS though, re-encoding seems obvious since DTS is demuxed in WAV files and then remuxed.

Assuming the cutting in VobBlanker is the source of the problem, is there any other tool that can do the same, ie cut part of a cell? It doesn't look like VobBlanker is likely to be updated!

Thanks for pointing me to the right direction.

pascalwil
28th January 2010, 17:38
Another idea!
I've noticed a window displaying more settings for VobBlanker. I don't understand what they are about.
Can someone explain the options displayed and if/how they could fix the cutting within one cell problem I've reported?
blutach do you know what these options are?

Thanks

bigotti5
28th January 2010, 22:41
There is no option in "more settings" to fix your problem.
Vobblanker creates an invalid audio frame at split point.
E.g
For an 256 Kbps AC3 stream each audio frame has to be 1024 bytes long, AC3 sync word (0B 77) should appear every 1024th byte.
After splitting and blanking (splitting only does not affect audio stream) with Vobblanker there is an irregularity at split point, e.g next AC3 sync word will be found after 1152 bytes...
You can fix these errors using e.g Delaycut or eac3to without reencoding.

btw - Muxman does not complain such files...

pascalwil
28th January 2010, 23:20
Thank you so much bigotti5. I do appreciate your help.

I'll try Delaycut. I've tried eac3to already and noticed it was quite fast. Because it does not re-encode I assume. Just fix the stream.

I'll try also to split without blanking and create a new chapter at split point with VobBlanker. There shouldn't be any audio problem with this if I'm following. Right?
Then I sould be able to delete the chapter with PgcEdit. I hope PgcEdit doesn't introduce some kind of irregularity unlike VobBlanker.
Has anyone ever tried that?

Cheers

r0lZ
29th January 2010, 01:36
Hum, if the split is not made correctly with VobBlanker, the fact that you will remove the useless cell with PgcEdit will probably not help. PgcEdit doesn't modify the VOB files at all: it deletes only the reference to the cell in the IFOs. To get rid of the VOB cell, you have to use FixVTS or... VobBlanker!

I suppose that FixVTS simply drops the cell, and doesn't fix the problem neither. But I'm not sure. Try it!

pascalwil
30th January 2010, 11:37
Thanks r0lZ for your inputs.

It seems PgcEdit comes in handy to modify the IFOs to make PgcDemux get rid of the unwanted cell(s).

Using PgcDemux with the new DVD created by PgcEdit, I've managed to get elementary files which don't contain the unwanted part(s).
I selected demuxing by PGC and I got audio and video files with only the cells I've kept in PgcEdit.

They were not fully OK though and I had to have the audio file go through delaycut and the video through Restream in order to fix them.

At the end remuxing with IfoEdit produced a DVD with the right duration and the right parts.
Remuxing with MuxMan produced the same good result.

So it didn't really matter that PgcEdit didn't cut the VOBs as long as it created IFOs which made PgcDemux cut the unwanted part(s).
PgCEdit did help!

Again thanks a lot to everyone for your help.

Cheers

r0lZ
30th January 2010, 13:05
Great! I'm glad PgcEdit helped. Indeed, since PgcDemux, as its name implies, demuxes the content of a single PGC, it must drop the unreferenced cells. But, as you have noticed, that doesn't mean that it fixes the wrong cut point. Luckily, there are good tools to fix the elementary streams. :-)

BTW, I strongly suggest to use Muxman instead of IfoEdit to remux, as IfoEdit has some bugs, especially with NTSC material.

pascalwil
30th January 2010, 16:53
Thanks r0lZ for replying even before I asked this time.
Yes I was wondering what tool to use between IfoEdit and MuxMan. You gave the answer.

Another point now for everyone.

Playing around with Restream, I had one case where setting up a new time stamp for M2V didn't produce the expected result but gave always the same duration for the new M2V whatever time stamp I put in.

Anyone knows about this issue? Any other tool to replace Restream?

Thanks

bigotti5
30th January 2010, 19:47
Restream does never give a new duration. Restream writes a continuous gop time code to your m2v.
All you can put in is a time code offset.
Gaps in gop time code forces other tools to calculate and present wrong m2v durations.

pascalwil
30th January 2010, 22:35
What do you mean by offset and where/how do you do this?
Furthermore how do you compute the offset in order to get duration for M2V as given by PgcEdit?

I must admit I'm a bit lost with GOP stuff. Any help welcome. Thanks

bigotti5
30th January 2010, 23:37
The duration of a m2v file is given by the number of frames and the frame duration (PAL 40 ms, NTSC ~33.37 ms).
Mpeg2 frames are organised in groups of pictures (GOP).
Each GOP header has a timecode entry written by the encoder. This entry is edited by Restream, nothing else.
Usually this code does not start at 00:00:00:00 (among others to avoid negative TC on tape recorder preroll).
TC start code is meant by TC offset - you can specify in "First GOP-timestamp" in Restream.
After cutting with Vobblanker these timestamps are not rewritten (neither by Vobblanker nor by Pgcdemux) and so there is a gap in time stamp continuity.
Tools like Mediainfo use this TC to calculate video duration (last TC entry minus first TC entry) - and fail in such a case.
Restream modifies the timestamps in GOP headers to be continuous.
No need to compute offset, you can use any start timecode, continuity is important.

r0lZ
31st January 2010, 00:19
bigotti5, I wonder one thing. Usually, when the VOB ID changes, the time codes are reset anyway. Right? So, if the stream contains several VOBs, the idea to compute the total duration by subtracting the starting time code to the end time code should fail. Right? So, is that method compatible with the DVD VOBs, or only with the elementary mpa stream?
Also, is it still useful to specify a non-zero start time code in streams designed to be used only on DVDs? Luckily, the DVD players do not need to preroll!

bigotti5
31st January 2010, 01:02
Usually, when the VOB ID changes, the time codes are reset anyway. Right? So, if the stream contains several VOBs, the idea to compute the total duration by subtracting the starting time code to the end time code should fail
At least Mediainfo fails in such a case (just tested).
Also, is it still useful to specify a non-zero start time code in streams designed to be used only on DVDs? Luckily, the DVD players do not need to preroll!
Imho you wont find a zero start code on commercial DVDs.
Useful - dont know - e.g. CCE manual warns to use zero timecode on pulldown files
When you apply 3:2 pulldown, do not set 00:00:00:00 as a timecode
for the first frame.

r0lZ
31st January 2010, 01:12
OK, thanks for the information. I'm not sure I understand why pulldown material needs a non-sero timecode, but it's good to know.

blutach
31st January 2010, 02:41
Along the lines of r0lZ's thoughts, one thing the OP could try is at the cut to make a new VID: VIDChanger might be the tool here. Set the flags at 10. No need to de/remux at all then.

Regards

pascalwil
31st January 2010, 16:34
Thanks a lot everyone for your inputs.
But this is getting too far for my poor knowledge about video stuff.

I think I'll stick with splitting the unwanted part(s) with VobBlanker and deleting the unwanted cell(s) with PgcEdit.
If I've followed I'll still have the unwanted part(s) in the VOBs but the edited IFOs will prevent me from seeing them when I play the DVD. Right?

This way there won't be any issue with video and audio I hope.

That's it for me, for the time being at least.
You can carry on if you wish. I'm very interested in your discussion but I feel like I've got so much to catch up with.

Again thank you very much for making me do some progress in this area.

Cheers

r0lZ
31st January 2010, 17:05
I think I'll stick with splitting the unwanted part(s) with VobBlanker and deleting the unwanted cell(s) with PgcEdit.
If I've followed I'll still have the unwanted part(s) in the VOBs but the edited IFOs will prevent me from seeing them when I play the DVD. Right?
Right. But when you delete the useless cell, PgcEdit will clear the seamless flag automatically. If you leave the "hidden" cell in place, you cannot theoretically set the seamless flag again, and your player may pause during one or two seconds at the cut point, like at the layer break position. It's perhaps a problem for you.

This way there won't be any issue with video and audio I hope.
I hope so, but I'm not sure.


We have discussed here the problem of the VOB ID change.

Each DVD title is (usually) made of several cells. Each cell is identified with an unique VOB/Cell ID (also known as VCID). Most of the time, the whole title has the same VOB ID, and different Cell IDs, but that's not a rule. In particular, the VOB ID changes often at the layer break point, or when the title has several angles. When several cells share the same VOB ID, the cells are in the same VOB (Video OBject, not to be confused with the .VOB files.)

The interesting thing is that the time stamps stored in the cells MUST be reset when the VOB ID changes. In other words, the time stamp is reset at the beginning of each VOB (but not at the beginning of a new cell in a VOB). Therefore, when a title is made of several VOBs, its total duration cannot be computed simply by subtracting the start time from the end time, as the end time is only the end time of the last VOB. To compute the total time by that method, the program has to compute the total time of each individual VOB and add them together.

Blutach has suggested to rename the VOB IDs of the VOB file (with VIDChanger) so that the first cell after the cut point starts a new VOB. This will force the time stamps to reset, and that might be a good solution for you. VIDChanger can work on the original VOB files, and you don't have to demux and remux them to have a clean cut. But honestly, I'm not sure that will be sufficient to solve your problem, as the original cut, made with VobBlanker, will still split the audio at an illegal point.

If you don't care to have an unused cell in your DVD, the best solution is probably what you have suggested. The cut will still be illegal, but the information will stay in the file, and I guess most players will be happy!

pascalwil
2nd February 2010, 10:34
It works fine on my PC.
Haven't tried yet on the standalone player though.

r0lZ, when I delete the unwanted cell the seamless joint of the next cell in unset.
I could set it manually but I get the advice no to do so because it comes after a gap. So i leave it unset, trusting the beautiful tool of yours!
What's the impact of setting/unsetting the seamless joint on the playing and the jump to the cell? Thanks.

Cheers

blutach
2nd February 2010, 12:33
Do not set it unless the cells are contiguous. The player will try to play the cells seamlessly but may not have the time to find the next cell and you could get improper playback. If you want it to be seamless, you must demux and remux - but now we come full circle.

Regards

pascalwil
2nd February 2010, 13:45
Thank you very much blutach.

Regards