Log in

View Full Version : How to transcode Xvid and WMV recordings?


Cela
12th May 2009, 21:28
Need startup help for an easy transcoding workflow (with tools and sample avs, etc.) for Xvid and WVC1 streams recorded with Total Recorder Video Add-on 7.1.

I would like to transcode the TRV recordings to
a) 16/9 VOB (mpeg2) for postprocessing with DVD-lab
b) 16/9 h.264 m2ts for postprocessing with tsMuxeR to AVCHD for PS3
In the process I would also like to maintain audio sync and as much as possible of the original audio and video quality.

The recordings have the following stream properties:
Video properties: 844x476 pixels (cropped 16/9), 30fps
(ffdshow Xvid is I-frame only for frame-accurate editing in VirtualDub)
Audio properties: 16 bit 48 kHz; PCM (Xvid recordings) and 192 kbps CBR WMA2 (WVC1 recordings)

Two short example clips can be found in Total_Recordings.zip (http://rapidshare.com/files/232209624/Total_Recordings.zip).

I only seem to find infos for how to transcode starting with VOBs from DVDs but nothing for my source streams.
I tried StaxRip (does not accept my streams) and MeGUI's WIKI guide (Cannot figure out how to define an appropriate avs (cropping, etc.) and how to control quality, etc.)

Please help!

Cela

Inspector.Gadget
12th May 2009, 21:55
Avisynth can take both Xvid and WVC-1 files as input, which puts you then mostly to the same place as you would be starting with a VOB file and DGIndex into Avisynth.

Cela
13th May 2009, 11:39
I hoped so, but could not figure out the avs.

Could you help me with the avs please!
How should the avs look like in order to read the 844x467, 1:1 pixels, progressive, 30 fps input streams and to produuce 640x480 (or 720x576 as Nerovision proposes ???) NTSC pixels, 16/9 output streams?

My best try with MeGUI (manually edited in the AVS Script Creator) was:

DirectShowSource("E:\_ToDo\Test.avi", audio=false)
#deinterlace
#crop
Spline36Resize(640,480) # Spline36 (Neutral)
#denoise
ConvertToYV12()

which produces sort of 4/3 instead of 16/9 output. :confused:

Furthermore, MeGUi insists of generating an avs with
AviSource("E:\_ToDo\Test.avi", audio=false)
which produces a totally distorted output video!
I do not know how to tell MeGUI's AVS Script Creator to use DirectShowSource instead for my Xvid avi streams.

I repeat myself:
Cannot figure out how to define an appropriate avs (cropping, etc.) and how to control quality, etc.) :confused:

That's why I am asking for help!

Cela

Inspector.Gadget
13th May 2009, 16:29
So you have a few problems here. First, MeGUI's AVS Script Creator overwrites your script when you tab away from it. You need to write this script in Notepad, Notepad++, etc. and save as Myscript.AVS. This will solve the DirectShowSource vs. AviSource problem.

If you don't want 4:3 output, don't resize to 640x480, which is 4:3. If you want 16:9 at that width resize to 640x360.

Here's how your script could look:


DirectShowSource("E:\_ToDo\Test.avi", audio=false)
Spline36Resize(640,360) # Spline36 (Neutral)
CoverttoYV12()


BTW, the AVISource problem is probably a known bug with B-frames in ffdshow's VFW decoder.

Cela
14th May 2009, 17:05
...So you have a few problems here... Yes, that's true. Thanks a lot for your infos! I will do what you suggest.

> MeGUI's AVS Script Creator overwrites your script when you tab away from it.
Is there a docu where I could read how the AVS Script Creator works? Generic changes of scripting defaults, etc.? Simple replace AviSource by DirectShowSource but keep on inserting the actual filename...

> If you don't want 4:3 output, don't resize to 640x480, which is 4:3. If you want 16:9 at that width resize to 640x360.
I thought replay takes care of the output DAR and changes PAR on output. Input PAR is 1:1. Must output PAR be the same?

> How should the avs look like in order to read the 844x467, 1:1 pixels, progressive, 30 fps input streams and to produuce 640x480 (or 720x576 as Nerovision proposes ???) NTSC pixels, 16/9 output streams?
That is my fundamental problem!
The recording are 30 fps. If I head for DVD, am I right that I need to transcode to NTSC attributes? That is why I chose 640x...

> Here I get more confused by NeroVision which has only one option for NTSC 16:9 > 720x480 (CCIR-601 D1) !
Is 720x... NTSC compliant?
And if 720... was ok for NTSC should it not be 720x405 for 16:9 instead of 720x480? And 405 would not be mod16, not even mod4? :confused:

> Why do I not stick to NeroVision although it does a transcode keeping audio sync?
Because NeroVision offers only very limited choice for transcoding: i.e. no choice at all for audio bitrate!.

I am shure Inspector.Gadget can help me resolve my confusions. ;)

Inspector.Gadget
14th May 2009, 17:30
Is there a docu where I could read how the AVS Script Creator works? Generic changes of scripting defaults, etc.? Simple replace AviSource by DirectShowSource but keep on inserting the actual filename...

MeGUI always opens AVI files with AVISource. That's all I know about that particular problem.

I thought replay takes care of the output DAR and changes PAR on output. Input PAR is 1:1. Must output PAR be the same?

On playback, assuming your filters work correctly, pixels will be stretched according to PAR or (in the case of an MKV container) the video's display size flags will be respected up to a certsain point. If you want to preserve anamorphic content without resizing, then you should set the output PAR. There's no reason to go to 640x480 and then have it be resized on playback: NTSC DVD content is stored as 720x480, which is 1.5:1. Applying NTSC-dimension PAR stretching to a 640x480 image that has been resized will not make the picture look as it should.

How should the avs look like in order to read the 844x467, 1:1 pixels, progressive, 30 fps input streams and to produuce 640x480 (or 720x576 as Nerovision proposes ???) NTSC pixels, 16/9 output streams?
You'll need to post an unprocessed source sample in order to allow me and other posters to take into account cropping, etc. NTSC content is usually stored at 720x480 and stretched on playback; you shouldn't resize to 640x480, then resize to 720x480, then stretch the pixels on playback. The best solution is to go to 720x480 directly (cropping, resizing, adding borders) and then use the proper NTSC-compliant PAR.

Plenty of people get confused by anamorphic DVD stuff. There are a lot of old threads around here full of good information on that topic. To sum up what you need to do, your goal is to take your source and get it so when encoded at 720x480, flags corresponding to a 16:9 DAR cause it to be displayed at the correct proportions.

Cela
15th May 2009, 15:26
...You'll need to post an unprocessed source sample in order to allow me and other posters to take into account cropping, etc...That was the reason of the Rapidshare link in post #1. There is a short unprocessed mp4 sample stream included.

In the meantime I started to study the extensive MeGUI Reference manual "MeGUI Essentials - v0.1.0 by Salur.pdf" and two very interesting high-res video tutorials by neil v moore
MeGUI Video Tutorial 1 Encode AVI to H.264.flv (250 MB)
MeGUI Video Tutorial 2 MeGUI Continued - Convert Almost Any Video Into H264.mp4 (278 MB)
at Link (http://www.logichaos.com/joomla/). These tutorials seem to cover exactly my beginner's needs.

Inspector.Gadget I thank you very much for your help which encouraged me to carry on with MeGUI. Your help and the above mentioned ignitioned a successful quickstart. :)

Regards

Cela

Edit:
Simple Xvid to multiAVCHD workflow
With extensive help from deank, the author of uncropMKV and multiAVCHD, emerged a very easy to use, quick and elegant workflow (see
here (http://forum.doom9.org/showthread.php?p=1287914#post1287914)).
Thanks Dean!

uncropMKV and multiAVCHD do the job! :)
1. Feed Xvid.avi into uncropMKV, set Resize to 720 x 480 or 1280 x 720. You will get an ...uncropped.mkv
2. Feed this into multiAVCHD, add the chapters, and there you are!
3. With multiAVCHD get menus for your AVCHD for free.

If you have problems running these programs in Vista get your codecs straight!
Follow exactly Dean's checklist!

In case of errors always do a full download of the last build from from deank's first posts in multiAVCHD (http://forum.doom9.org/showthread.php?t=143744) and uncropMKV (http://forum.doom9.org/showthread.php?t=145905) thread and start clean.
NEVER download deank's programs from other sites!
Execute the exe and let it extract all into the root of a drive, D:\ or C:\ for example.

And do not forget to DONATE to keep deank motivated to carry on with his excellent jobs!

Now this milestone of my roadmap is reached.
My next goals will be title menus and chapter menus with multiAVCHD.

Cheers,

Cela