Ed -- Please read the .txt file that I provide in the hd2sd.zip file. There are plently of script examples. In your case (frameserving to ProCoder, BFF), a script like this should do the trick:
hd2sd("c:/path_to/signpost.avi", OutputColorSpace="YUY2", OutputBFF=true)
That's it. Use one line and pass the parameters you want to the hd2sd() function, as documented in the .txt file. And as for...
> Can I make various selections ... WITHIN the hd2sd.avsi file versus doing so in the premiere.avs file?
The file hd2sd.avsi defines the function. It's a "script", but it acts more like a plugin. Don't edit it. Just create a new .avs file in the same folder as your "signpost.avi" and paste the line above into it.
> interlaced or progressive, TFF or BFF, etc.
If you are going to DVD then chances are you want interlaced (unless it is 24p). You can choose TFF or BFF at will. DVD supports both. Just make sure that your settings in ProCoder reflect this choice.
Thanks Dan - your last post gets me over that hump. Although I had read the txt file, it just didn't click with me about passing the different parameters into that one line.
Just to post a minor variation of this workflow for folks with Cineform or Matrox systems... a little background first:
As I documented in another thread, PPro fails to make a distiction between BT.709 (the HD color standard) and BT.601 (SD). The long-and-short of it is that PPro "pretends" that everything is 601.
My script(s) fix this problem for HDV footage by performing a 709->601 matrix conversion. However, there is still the problem of RGB graphics being converted to YUV using the 601 coefficients. So... outputting via DebugMode in YUY2 will output the video colors correctly, but not RGB graphics. Outputting as RGB will screw up the colors of the video, but the graphics will be correct!
It seems to me that the first option is better and that is why I suggest frameserving as YUY2.
Cineform and Matrox have a way around this problem by performing their own YUV->RGB conversion on the HD video footage (so long as the captures are in their .AVI containers anyway).
If you are using a Cineform or Matrox project you should be able to get better color representation (and faster performance?) by bypassing the DebugMode FrameServer and outputting to an HD AVI file. You can then open that file through AviSynth just as you would the frameserver "signpost.avi" and passing it thorugh my script for downconversion.
Dan quick question, I have a project that I'm shooting on the HVX at 720p/30fps. I'm editing in PP and will go out to DVD. I guess since it's not interlaced I don't need to deinterlace but I still need to resize and convert for DVD. Would the above steps still work for that?
Hi Chr --
How are your results using AME for 720p->DVD? Chances are they're fairly good, but I've never tried it.
You can likely increase the quality a bit with AviSynth, however (more accurate color, sharper scaling, etc.). Try this (instead of my "basic" script) on the frameserver's YUY2 output:
# uncomment the next line for HC Encoder or QuEnc
Long-time followers of these threads will recall that I used SmoothDeinterlacer in earlier versions of the workflow. After I became aware of a few issues, I switched to LeakKernel.
I've now realized this was a bad choice -- both because LeakKernel has its own issues and that I found a workaround for most of the problems I was having with SmoothDeinterlacer.
The "basic" workflow page and the "advanced" hd2sd.zip have both been updated, so please (re)visit the link in the original post.
hello Dan and thanx for the workflow.
I got a cannon xlh1 captured footage to premier under this specs;
Image Size: 1440 x 1080
Pixel Depth: 1440
Frame Rate: 29.97
Pixel Aspect Ratio: HD Anamorphic 1080 (1.333)
Fields order : upper field first
Display format : 30 fps drop frame TC
Then exported video to frameserver-->Virtual dub--> save as uncompressed AVI --> imported into encore.
I noticed some (bugs) concerning the border added to the video when viewed on Encore or exported to DVD ; is it normal? or should I remove out from script the line that says;
Thank you anyway.
another bug with avisynth file when opened in virtual dub;
ther's no function named (colormatrix)
this happens even i copied the dll's to appropriate directory.. I have to try several times befor it works !!
Hi Abdessamad --
I don't understand... In your first message it seems that everything worked fine and THEN you got an error about ColorMatrix?
> noticed some (bugs) concerning the border added to the video
It's no bug. 1440x1080 -> 704x480 (or 704x576) is a very accurate conversion of the apsect ratio. AddBorders pads this to 720. PPro's "native" export adds 5 pixel borders to each side (1440 -> 710), but this is not so precise. If you want to fill the screen (at expense of slight stretching), change the resize line to 720x480 (or 720x576 for PAL) and comment-out the AddBorders line.
I just copied/pasted the script I posted and it works fine. Be sure that the colormatrix.dll file is in the root of your AviSynth plugins folder.
> I have to try several times befor it works !!
No idea. I've never heard of that issue before. The only thing I can think of to make sure the plugin folder is referenced in your registry. More info here: http://avisynth.org/AviSynthPlugins
Well, I tried reinstall/install/uninstall the tools used with this superb script, but the problem always remains the same;
Avisynth refuses to load the dll's I put on it's plug in directory..
Then I decided to make a system restore and re-install the tools pack provided; it works !
S5trange but this is how I got ride of the problems with Avisynth/VirtualDub
I changed the folowing on the script;
thank you for support Dan.
Glad it now works for you, Abdessamad.
> I changed the folowing on the script
That's fine. Have you tried the "advanced" version of the workflow referenced on the bottom of my page? (It's actually a lot easier to use, but it requires a bunch of plugins.) There is a parameter that controls this scaling. The default is WidescreenType=1, which fills the screen while maintaining an accurate aspect ratio by slightly cropping off the top and bottom.
You can duplicate this method in the basic script like such:
Lanczos4Resize(720,492).Crop(0,6,-0,-6) # NTSC
# Lanczos4Resize(720,588).Crop(0,6,-0,-6) # PAL
Just a quick question in relation to Matrox.
I have used your excellent script but after reading your message about Matrox I want to try this. I presume the workflow would be:-
Export the timeline as a Matrox HD Avi
Alter the .avs script to reference the Matrox HD Avi file
Open Virtualdub and open the .avs file
File save as uncompressed Avi file
Import the Avi file in Encore and burn the DVD
Do I need to change the YUV / RGB setting in the script?
If I have misunderstood anything or missed anything out I would be grateful for your input.
Yes, Ian. That's the gist of it... So that I can answer you correctly, are you using my basic workflow or the hd2sd() function?
In answer to: Valera, "HDV --> SD DVD Workflow?" #237, 14 Jul 2008 4:21 pm
> interlaced 16:9 to SD 16:9
That's what the "basic" script does. My "advanced" hd2sd() function also does this by default.
> progressive 16:9 to SD 16:9
I answered another user in the other thread with regard to 720p. 1080p should be the same. The basic script is here:
As for the "advanced version" using hd2sd():
Please read the text file in my hd2sd.zip file for more information about other settings, etc.
> no 16:9 in avisynth
AviSynth has no concept of "16:9" or any other PAR/DAR but that does not matter. Just tell your MPEG2 encoder that the input is 16x9 and you'll be all set.
I'm using the advanced script (hd2sd)
(using Matrox, edited footage in 1440*1080i and want to out put good quality PAL widescreen DVD)
Well, using the advanced script, you should be able to use the Matrox .AVI without any real modifications... However, I think may have found a problem with the way RGB input (such as the Matrox codec delivers) is handled in my script. This gets confusing, as the Matrox codec has options for its YUV->RGB conversion (Standard, Expanded).
Try it like this...
... and if it looks to contrasty, this this instead:
The first example corresponds to the Matrox "Expanded" mode, while the second is for "Standard" mode. Got me?
I need to test a few things and if there is irregular handling of RGB input (for non-Matrox files) I'll modify the function. It's due for an update anyway, as I've made a few adjustments over the last few weeks.
Thanks for that Dan. I'll try these out tonight and let you know how I got on.
When using Adobe Encore as the final SD encoder for the rendred avi, it doesn't recognize that the footage is 16:9 (HD Anamorphic 1080 1.333) strange?
does this happens to you too, or I missed something?
PS : when I play the rendred file on WM player, it appears as a 16:9 footage but not after making a DVD using Encore.
I don't encode with Encore much, but try this: In Encore, right click on the .AVI... "Interpret Footage..." and select SD NTSC Widescreen (or SD PAL Widescreen, depending on where you live).
I think the Adobe Encore is still away from it's final shape (like the successful Adobe softs; PS, AI..) why?;
Before asking the aspect ratio question here, I tried interpreting footage as you said but when i import it to a 16:9 timeline, this timeline becomes 4:3 and the radio buttons (that allow you to switch timeline's aspect ration) are grayed out and 4:3 is selected by default.
I tried several times changing the aspect ratio by interpreting footage and didn't work, then I decided to delete this Encore project and create a new one , then, first import the rendred avi (before creating any timeline) then interpret the avi as 16:9 (1.333) and finally create a timeline with aspect ratio set to 16:9 .. and it WORKS !!!!
Strange, strange .. Encore needs more development before becoming a functional product.
> then interpret the avi as 16:9 (1.333)
But it is not, right? If it is a 720x480 (or PAL 720x576) file, then the aspect ratio should be set to NTSC or PAL widescreen and not 1.333, I would imagine.
> Strange, strange .. Encore needs more development before becoming a functional product.
I agree with that completely.
One other question guys didn't talk about is rendring for PAL SD;
I know that I have to set update
on the script so as it meets with pal standards, but what about the line;
PAL is progressive so we don't need lower/upper-field first output?
should I leave it or comment it out
and what is general HDV --> SD PAL recommendations
I checked the page (a guide for this workflow) and didn't show up, is everything okay?
Thank you DAN
> PAL is progressive so we don't need lower/upper-field first output?
Incorrect. PAL is interlaced. I don't know any PAL camera that is native progressive and anyway they all record to 50i format on tape.
@ C. David Young
> haven't you told me that [30p -- or 25p] is not DVD compliant?
Well, there is a grey area here. The MPEG2 and DVD standards have been revised a bunch of times, so who can say. I am certainly not an expert here. You can read about the ATSC standards, but I'm not exactly sure how these relate to DVD and how they're implemented by DVD player manufacturers. There can actually be per-frame interlaced/progressive flags (such as in telecined signals)... It does get confusing.
In any case there are several possibilities for creating a 30p disc using progressive sources or deinterlaced video:
1.) progressive YV12 sampling, flagged as progressive (possibly non-compliant ??)
2.) progressive YV12 sampling, flagged as interlaced (certainly compliant but may exhibit chroma upsampling errors and be redundantly deinterlaced on progressive HDTVs)
3.) interlaced YV12 sampling, flagged as interlaced (also compliant but may be accidentally deinterlaced)
See this page: http://avisynth.org/Sampling
#1 will give maximum quality on DVD players that support it, which is probably most newer players, while #3 is probably the best "fully compliant" option. This is also (from what I've seen) the way commercial 25p PAL DVDs seem to be created. Maybe there are others who can shed more light on this.
Personally, I don't care what is "compliant" so long as DVD players play it properly. Even my ancient NAD DVD player has no problem playing "true" 30p discs. Whether it handles the chroma properly or not I have not investigated.
Using my hd2sd script, the output is YV12 by default. It is sampled as interlaced when OutputFieldRate > 30, and progressive when it is less (creating output like #1 above.)
You can get whatever you want out of it, however, by setting OutputColorSpace="YUY2" and then letting Encore, CCE, etc. handle the conversion for you. If you are using HC Encoder (which required YV12 input) you can do something like:
hd2sd("file.avi", OutputFieldRate=30, OutputColorSpace="YUY2")
Then you can "flag" it as interlaced or progressive in HC Encoder as you like.
Congratulations to Dan for your Workflow.
I have a HV30 Canon (PAL) and last weekend I recorded a lot during a 3 days trek in the Pirineos Mountains (Spain). Yesterday I followed the wokflow and the result was fantastic. Thanks Dan.
I would like you to know why do you recomend resizing to 704x576 for PAL SD video edition.
In my opinion, I could understand the resizing from 1440x1080 to 704x480 for NTSC video edition, because the ratio
"Vertical Transformation" / "Horizontal Transformation" is equal to 1.1, good for good transformation. (the ratio is not so good if you were transforming to 720x480 (1.125).
But, when you are resizing from 1440x1080 to 704x576 as you propose for PAL SD edition, the ratio is equal to 0,91666666. If the resizing is to 720x576 the transformation ratio is 0,9375, which is better and there is no proportional transformation in the SD image (16:9).
Is there any reason to choose 704x576 for PAL edition instead of 720x576, when you are having worse transformation ratio and you are loosing the original proportion (16:9)?
I'm quite new at HDV.
Following the HDV to SD DVD workflow, I get 3:4 aspect ratio instead of 16 : 9.
Below please find the copy of export settings summary from Export Movie window:
Video and audio
Frame size: 1440h 1080v (1,333)
Frame rate: 25,00 frames/second
Pixel Aspect Ratio: HD Anamorphic 1080 (1.333)
Fields: Lower Field First
Sample rate: 48000 samples/second
Sample type: 16-bit"
What did I wrong?
Thanks for your help
Hi Peter --
That should be Upper Field First for HDV. Other than that, you've done nothing wrong.
VirtualDub and AviSynth have no concept of 4:3 or 16:9. If you importing the SD AVI into Encore or Premiere for encoding, be sure to go to Interpret Footage and choose the appropriate aspect ratio (PAL widescreen in your case).
Other encoders (like CCE and HC) also allow you to select the aspect ratio.
Yes, the aspect ratio issue is solved. I corrected the premiere.avs for upper field, as follows:
Limiter(16, 235, 16, 240)"
but in the Export Movie window the summary shows always lower field, and, of course, the movie jitters on the TV.
I changed several times between 4,0,3 and 4,1,2, but the summary did not changed!
Could you help?
I meant to change it in Premiere's export options, not in the script. The deinterlacer assumes Upper, so any other export setting will cause problems.
So... change Export Movie Settings/Keyframes and Rendering/Fields -> upper field first.
If you are using PPro or Encore to encode the MPEG2, use SelectEvery(4,1,2) in the script.
If you are using CCE, Procoder, HC, etc. you can set whichever output field order you want in the script (4,1,2 ... or 4,0,3) so long as your MPEG2 encoding settings reflect this.
Ive used your workflow myself and as much as Id like to think this can be done natively in Adobe; it just cant. Your workflow is a very useful workaround for this shortcoming from adobe.
I suggest you change one thing in the ppro export settings. uncheck "Optimize stills". The feature has been known to cause problems with exports played outside Pr. Ive seen wacky timing problems (stills played back incorrect length) when this feature is checked under certain conditions.
Great job on this script and your support of the adobe community. There is not a single HD job I shoot where SD DVDs are not also required as a deliverable. I was working around by shooting progressive, but your workflow provides a better solution. Hopefully adobe is paying attention that their Pr user forum is filling up with 3rd party workarounds to their shortcomings.
I'm very glad it's useful, Curt. Thank You. I should be releasing a new version of the advanced workflow very soon. I've made a bunch of changes/adjustments to the script over the past few weeks but I need to test it all out again. Jim S. and Jeff B. have had me pretty tied up on the DV60i -> 24p thing. :)
> I suggest you change one thing in the ppro export settings. uncheck "Optimize stills".
I know what you mean, but it seems to have no effect on DebugMode... safer to leave it off, I suppose. I'll replace the screen cap when I get a chance.
EDIT: Also, Curt... Assuming you're using the hd2sd() function (and you should be... many more options) Please post the settings you are using. I am curious what seems to work best for people, and it may help me set better defaults in later releases.
Dan, thank you for this information it is very useful. I am in the middle of my first HDV/SD project about a 45 min wedding and the video looks great coming out of Virtual Dub 16:9 and all but when it is imported into Encore it becomes 4:3. Project settings in Encore are 16:9. I used your basic script and like I said I pulled the saved file back into Virtual Dub and it is still 16:9. Any suggestions?
> but when it is imported into Encore it becomes 4:3
Use Interpret Footage in Encore and set it to NTSC widescreen (or PAL widescreen if the source is PAL).
Thanks, I appreciate it.
I am having another issue; I brought the uncompressed AVI into Encore I saved from VirtualDub (43min 82GB) I did use upper field first because I thought I was supposed to. Encore acts like it is transcoding, goes through the video then audio but then never finishes. All day it just says transcoding now. I reset encoding perameters in Encore to Upper Field First and I am trying again. Any suggestions?
Sorry, Larry... I have no idea. I've certainly run tests like this through Encore with no issues. If the problem persists you may want to consider using a different encoder (CCE, ProCoder, HC Encoder, etc. -- or encode the MPEG2 in Premiere) and just import the .m2v file into Encore for authoring.
I tried your method after getting undesirable results export my HDV timeline from Premiere Pro to a DVD compatible Mpeg2 directly from Premier Pro, importing into Encore and burning without any transcoding in Encore.
I had a couple of issues. The first was that it changed my 16:9 image into a 4:3 image.
Once I got to your step of going out from VirtualDub I went up to File-->Save as AVI and brought this uncompressed AVI file into Encore, which automatically transcoded it from there. When I checked, that AVI file was 4:3, so it's being converted to 4:3 by VirtualDub. What do I need to do to fix this problem?
The other issue, and maybe this is just how it is, was that my footage already looked really good when viewed on our 4:3 CRT Triniton monitor, or any 4:3 CRT TV for that matter. The biggest problem is when played back on an HDTV. You see the interlacing lines and the quality just drops significantly. If you go to the store and purchase a DVD movie it will look very good on either source.
Is there a way to get that same consistent quality across both playback platforms?