View Full Version :
Converting a tmpgenc .tpr to an avs script
ritmo2k
8th January 2002, 07:37
Can this be done?
Thanks,
TactX
8th January 2002, 08:16
LoadVFAPIplugin("c:\somewhere\TMPGenc.vfp","TMPGsource")
TMPGsource("c:\anywhere\stuff.tpr")
ritmo2k
8th January 2002, 08:40
Also another q!
Is there a way to pass an avs to CCE without writing the ecl manually?
Thats a real PITA!
Thanks Again!
ritmo2k
8th January 2002, 08:46
I ran it, of course correcting the paths etc, and it instantly created a few megs, and crashed?
Any hints?
western shinma
8th January 2002, 08:55
Try adding this to your avs file, even if you aren't using any other filters:
ConvertToYUY2.FlipVertical
ritmo2k
8th January 2002, 09:02
Appreciate your help!
But it didnt work? As soon as I hit encode, it beeps, hangs for a bit, and crashes?
I am going crazy!
All I wanna do is run dvd2avi on a few vobs, encode the audio seperatly(no touble!) pass a few commands and the d2v file in an avs script, and run it through cce2.5?
WTF am I missing?
Thanks again guys!
TactX
8th January 2002, 10:20
Can you open it with VirtualDub ?
Do you have audio in your script ?
CCE has problems if source is without audio.
btw, you could post your script, maybe we can help you more then...
ritmo2k
8th January 2002, 21:11
OK, your right, I am using tmpg to do the audio, everyone says ce sux at audio, so tmpg can do it minutes, so WTF i thought. But it is encoding, just not right!
DVD is 720x480, 16x9, no borders, not anamorphic.(Godfather series)
processed in dvd2avi, avs so far is:
LoadPlugin("C:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
mpeg2source("D:\GODFAT~2\Test-FF_Off.d2v")
BiCubicResize(352,192,0.00,0.75)
AddBorders(0,24,0,24)
But the aspect ratio of the final image is wrong. I mean the actual movie part, not the movie with black bars. Its still stretched!
Some people are saying I need to crop first, but how can I crop first, there is nothing but movie, if I crop, ill cut away movie!
If you can only move in blocks of 16, I am trying to use dvtool to calc the new aspect ratio, but whats the diff between between 16x9, and dvd16x9? Iether doesnt help!!!
Hope this enough...
western shinma
8th January 2002, 21:41
OK, now it makes more sense. We thought you were trying to use a TMPGEnc project file.
Try this instead for your resizing:
BiCubicResize(352,180,0,0.75)
AddBorders(0,30,0,30)
ritmo2k
9th January 2002, 05:32
Actually, I was! I am trying both!
What I started doing, cuz i cant get the resize right, and I cant get cce to read the tpr, I am making a project in tmpg, running it through vfapi, and running the avi through cce. Perfect, but a PITA!
I wanna run the damn d2v through cce without the hastle, and I know I can, I just cant ge the resize right.
How do you come up with those figures? I really wanna understand the logic!
Thank you very much for your help!
I will now try the figures!
ritmo2k
9th January 2002, 06:17
Sweet, that was perfect!!!
BUT HOW!!! WHY!!!
I just dont see the correlation for those figures!
Also, what is the right way to clip, and then resize, say I wanna clip of 3 on the left, 2 on the right, and only 1 on the top of the orig vid(for what ever reason). I would "think" since its a dvd, 720x480, Crop(3,1,715,479)
Then do i use your resize ignorring its been cropped? Does it just throw out the aspect ratio very slightly after using your perfect BiCubicResize(352,180,0,0.75)
AddBorders(0,30,0,30)
But the guide at the avs page says...
Crop / CropBottom
Crop(clip,left,top,width,height)
CropBottom(clip,count)
Crop crops excess pixels off of each frame. If your source video has 720x480 resolution, and you want to reduce it to 352x240 for VideoCD, here's the correct way to do it:
# Convert CCIR601 to VCD, preserving the correct aspect ratio
ReduceBy2
Crop(4,0,352,240)
YUY2 format only stores color information for every two pixels horizontally, so if you're processing in YUY2 mode, left and width must be even.
So, is that a better way? The same way? Whats the diff? That actually "deletes" off 4 on both sides right? Your way wouldnt do that would it? What does the YUY2 format mean? Would I need to add borders to this after like you did?
The command I use
LoadPlugin("E:\DVD\AVSGEN\bin\MPEG2DEC.dll")
needs the YUV2 colorspace, what is that referring to?
This is starting to make more sence...
ritmo2k
9th January 2002, 11:20
OK, so in reading here, I see there is a bug in cce, if I add the resample audio command, it loads the avs script directly!
Cool
I sure hope western shinma reads these lasts posts of mine, you have been such a wonderfull help for me, its great! I am encoding a vcd right now at 1.2:1, hahaha
Sweet!!!
thanks,
western shinma
9th January 2002, 11:50
I don't personally think it is necessary to crop the sides for VCD/SVCD. As for resize calculations, you might try thinking of the horizontal resolution as 320 to make things easier. Of course you will still be encoding at 352x240, but this works because of VCD's nonsquare pixels.
Here's what I might do with your cropping example: (just make sure you have an even number of horizontal and vertical pixels when you do this for real)
715/720*640=636
479/480*360=359
359/636*320=181
So in this case you could resize to 352x181 and crop 30 and 29 off the top and bottom. You might get better quality from using 352x176 in either case, since then you won't have a black border in the middle of a macroblock. If you want to try this you might consider simply cropping a couple rows rather than resizing so your aspect ratio is the same.
Update: Oh, I hope this doesn't throw off your encode. ;)
And for anyone else reading this, I didn't really truncate the decimals in those calculations, I just posted it like this for the sake of simplicity.
spudboy
18th January 2002, 21:04
I too am trying to load a .tpr file in an avisynth script and run this in CCE. However, whenever I hit "Encode", I get this message:
"cce_encoding_init() failed: Unknown error". I can load the .avs file in VirtualDub and it works fine. My .tpr does contain both audio and video. My .avs script is:
LoadVFAPIplugin("C:\TMPGEnc.vfp","TMPGsource")
TMPGsource("C:\ivtc.tpr")
FlipVertical
Anyone have any hints? What I am trying to do is use TMPGEnc to perform IVTC, then run the resulting frames through Avisynth and into CCE.
- spudboy
western shinma
18th January 2002, 23:45
Hmm, you seem to be getting further than me, I can't even get CCE to load an avs with a TMPGEnc project source. If you're not doing any additional processing you might be better off just using VFAPIConv instead of avisynth.
spudboy
19th January 2002, 00:06
Well, I wanted to use DVD2SVCD to drive my ripping, encoding, etc., but use TMPGEnc for the IVTC. I check the "edit avisynth after dvd2avi", and then I can run TMPGEnc IVTC on the .d2v file, and edit the avisynth script to use my tpr file for further processing. None of the IVTC methods normally available through Avisynth seem to really work.
- spudboy
western shinma
19th January 2002, 09:14
The only way this seems to work for me is by running the TMPGEnc project file through VFAPIConv and then using AVISource to open that in Avisynth. It might be a bit slower, but using the project file directly is not very fast either so it might not be too bad.
The other problem is that it will make a huge file if you have audio, so you might want to do audio separately.
spudboy
19th January 2002, 11:52
Hmmm...I guess I'm not really willing to take that much of a speed hit. All I really wanted to do anyway was use TMPGEnc's IVTC capability. I wonder if I could run IVTC in TMPGEnc, extract the information from the .tpr file, and write my own Avisynth filter that uses it. You wouldn't happen to know of any source for finding out how to parse an .tpr file would you?
- spudboy
western shinma
19th January 2002, 12:14
A filter like that would be interesting, although I remember some particularly messed up dvds needed its auto deinterlace option after inverse telecining. Still, on many movies this would be useful especially for multipass encoding in CCE since you would only have to IVTC once.
I really don't know anything about the tpr file format though, sorry.
spudboy
24th January 2002, 14:21
Well, my first version of the avisynth filter seems to work, although it is still rather unrefined at this point (little error checking, etc.). It only does ivtc though--it won't deinterlace frames or anything like that. I am going to try it with several more DVDs, look for ways to make it more sophisticated, and try to find more info on some of the stuff in the .tpr file.
- spudboy
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.