Log in

View Full Version : Question about TMPG's merge&cut tool


Chainmax
6th February 2006, 18:36
I am currently trying to make a DVD and due to lack of space and a slow CPU I had to divide the encoding in two steps. To that effect, I added Trim(0,n) and Trim(n+1,0) to my Avisynth script and made a lossless encode with one, encoded it to MPEG2 and proceeded with the other.
I then fired up TMPG, went to the MPEG Tools, selected MPEG2 Super VideoCD (VBR) as type, loaded the first half, then the second and hit the "Run" button.
Here's the weird thing though: the MPEG2 of the first half consists of 80090 frames and lasts 55:40, the MPEG2 of the second half consists of 79236 frames and lasts 55:08. The merged MPEG2, however, consists of 159326 frames and lasts 1:50:49, what did I do wrong? What other tools for merging the two MPEG2s would you recommend me?

Guest
6th February 2006, 18:50
Here's the weird thing though: the MPEG2 of the first half consists of 80090 frames and lasts 55:40, the MPEG2 of the second half consists of 79236 frames and lasts 55:08. The merged MPEG2, however, consists of 159326 frames and lasts 1:50:49 Why do you say that is weird?

80090 + 79236 = 159326.

Chainmax
6th February 2006, 19:30
Yes, but 55:40 + 55:08 = 1:50:48 != 1:50:49

Chainmax
6th February 2006, 21:18
Besides, the video will have an SVCD header, won't it? Is there any tool that can let me merge while having a proper header and not displaying this length discrepancy?

Guest
6th February 2006, 21:47
The 1 second discrepancy is probably a rounding issue. The right number of frames is there, so I wouldn't worry about it.

I don't know what you mean by "the video will have an SVCD header". There is no such thing.

Are you actually having a problem, or are you just seeing ghosts?

setarip_old
6th February 2006, 21:48
The difference may be due to "rounding off" (e.g. 55:40.04 + 55:08.03 = 1:50:49)...

Chainmax
6th February 2006, 21:59
I guess I'm just seeing ghosts :o. I assumed the video would get a different header because what I did seems very similar to the SVCD header trick.

[edit]Mmmm....DGPulldown doesn't accept the merged file :(. It does accept each half though.

Guest
6th February 2006, 22:09
[edit]Mmmm....DGPulldown doesn't accept the merged file :(. It does accept each half though. What do you mean by "DGPulldown doesn't accept the merged file"?

Did you try a simple binary concatenation of the M2V files?

Chainmax
7th February 2006, 01:28
DGPulldown says the TMPG merged file is not an elementary stream which it should be as it's video only.

I didn't try binary concatenation (something like copy Half1.m2v + Half2.m2v, right?), is it a better alternative than using a dedicated tool?

setarip_old
7th February 2006, 02:44
Actually, it would be:

copy /b file(1).mpg+file(2).mpg joinedfile.mpg

(Be mindful of the one blank space between "file(2).mpg" and "joinedfile.mpg")

foxyshadis
7th February 2006, 06:03
Video only doesn't necessarily mean elementary stream, esp. if it tried to give it an .mpg extension originally; perhaps you could load both into dgindex and demux, see if that actually spits out usable m2vs. (Assuming copy /b doesn't work.)

Chainmax
7th February 2006, 13:47
The file merged with binary concatenation shows up as having 159417 frames :confused:. It does lasts 1:50:49 though, and DGPulldown is currently flagging it.

Chainmax
7th February 2006, 14:25
Flagging complete. Both WMP6.4's statistics window and VDubMod report the result as 23.976fps, only zoomplayer's Player Information says Listed FPS = 29.97, but it also says Actual FPS=23.976. All files I've use DGPulldown on appeared in WMP6.4 and VDubMod as being 29.97fps, what's going on?

Chainmax
9th February 2006, 12:26
Anyone?

midnightsun
10th February 2006, 01:26
Binary concatenation alone won't work in this case because you end up having GOP timestamps wrong in the second part of the merged file (when the 2nd file you appended starts, the timestamps go back to 0:00:00.000, that's why the length reported by most tools is incorrect). However you can run the file through (for example) Womble mpegvcr and it will fix it for you. It's not free though. Tmpegenc seems to produce only program streams if you merge files, so you should demux the output in order to have a clean elementary stream.

As for the framerate thing, I don't have a clue!

Abond
10th February 2006, 09:42
If you want to merge elementary video only, I would suggest to use Cuttermaran.

Chainmax
11th February 2006, 14:54
Thanks for the tip, I'll try it if I need it again. Is it freeware?

Someone told me on a related thread that TMPG merges into a program stream and told me to demux the result. Apparently it worked, and the merged+demuxed stream has the correct duration but a higher number of frames than the sum of the two halves :confused:. DGPulldown had no effect. I tried the custom pulldown setting the values to 23.976-->29.97 and it seems to be working now. I am using DGPulldown v1.0.6b3 (which appears as b2 when executed :confused:).

Chainmax
13th February 2006, 13:14
The file merged and demuxed with TMPG also has 159418 frames but it too also displays the correct length, so I won't give much thought to that. About the DGPulldown issue, I found that it didn't work if I used the defaults. If I instead chose Custom mode and set the start and end fps manually it worked.