Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th December 2011, 20:48   #1  |  Link
vdcrim
Registered User
 
Join Date: Dec 2011
Posts: 191
AvsP macro - Encode with x264

This is an AvsP macro to encode the Avisynth script in the current tab with x264. It prompts for the encoding settings and pipes the video data to x264 using avs4x264. It started as a quick and dirty script, now it has become kind of a poor man's GUI.


Features:
  • CRF and 2-pass ABR encoding mode, progressive and interlaced.
  • Use x264 64-bit with Avisynth 32-bit.
  • Check consistency between avs output color depth and x264 input-depth parameter.
  • Read x264 parameters from commentaries on the script.
  • Calculate an adequate SAR from MeGUI DAR info or a specific comment in the script, if present.
  • Add zones parameter based on commentaries on lines with Trims.
  • Search for an existing QP and timecode file in the script directory with the same name as the avs.
  • Alias feature for setting the YCbCr to RGB flags.
  • Set "start" shell command options (process priority, start minimized).
  • Not display any window while encoding and notify at the end.
  • Save the x264 logs and a copy of the Avisynth script.
  • Close the current tab and/or preview tabs on its right.
AvsP macro (check for latest version)

In order to use it, you need to place the script in the "AvsPmod\macros" directory, and avs4x264mod and x264 in "AvsPmod\tools" or set a custom path. Be sure to open the script with your text editor to check the complete documentation.

Changelog:
Code:
- minor changes and some cleanup
- fix "Additional parameters" field. It needed to start with a space
- improved interface with recent updates in AvsPmod
- default values can be set now from the prompt
- add 2-pass ABR mode
- add scan type option
- add DAR to the prompt. It can also be read from the avs now, like "# DAR 16:9" or "# DAR 1.85"
- add Blu-ray compatible and open-GOP switches to the prompt
- x264 parameters can now be read from the avs, like "# x264 parameters --crf 17 --aq-strength 1.2"
- zones can now be read from lines with Trims in the avs, like "Trim(0,100) # zones crf=20"
- improve RGB / YCbCr flags alias feature
- add option to archive the encoding log and a copy of the avs
- add option to run the encoding without a window and notify at the end
- add option to close the current tab and/or preview tabs on its right
- fix Python 2.6 compatibility
- add support for Dither_out (Dither v1.22.0+)
Attached Files
File Type: zip AvsP macro - Encode with x264.zip (14.1 KB, 181 views)

Last edited by vdcrim; 11th March 2013 at 17:51.
vdcrim is offline   Reply With Quote
Old 13th December 2011, 17:01   #2  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 288
That's quite the nice idea
mastrboy is offline   Reply With Quote
Old 22nd January 2012, 22:37   #3  |  Link
Floatingshed
Registered User
 
Join Date: Nov 2008
Posts: 295
I just get the error... "return outside function" line 113
Any ideas?
Floatingshed is offline   Reply With Quote
Old 22nd January 2012, 23:24   #4  |  Link
vdcrim
Registered User
 
Join Date: Dec 2011
Posts: 191
Quote:
Originally Posted by Floatingshed View Post
I just get the error... "return outside function" line 113
Any ideas?
You are probably starting the script directly with your local Python interpreter. Instead, you have to select it from the macro menu in AvsPmod.
vdcrim is offline   Reply With Quote
Old 23rd January 2012, 00:35   #5  |  Link
ANGEL_SU
Registered User
 
Join Date: May 2007
Posts: 109
@Floatingshed
You need to update to AvsPmod 2.2.0 or later. In previous version, you can not use 'return' outside function but use nested if-else statement.
ANGEL_SU is offline   Reply With Quote
Old 23rd January 2012, 15:35   #6  |  Link
Floatingshed
Registered User
 
Join Date: Nov 2008
Posts: 295
Thanks. My mistake, not using the correct version of AvsPmod. How do I set the interlaced tff/bff flags?

Oh, another error... Missing "Dither_convey_yuv4xxp16_on_yvxx()" or incorrect input color depth..

Last edited by Floatingshed; 23rd January 2012 at 15:41.
Floatingshed is offline   Reply With Quote
Old 23rd January 2012, 16:33   #7  |  Link
vdcrim
Registered User
 
Join Date: Dec 2011
Posts: 191
Quote:
Originally Posted by Floatingshed View Post
How do I set the interlaced tff/bff flags?
Just use the "Additional parameters" field (--tff or --bff). I didn't include a specific field for these flags because I don't encode interlaced myself. I just fixed a minor bug with this field btw, see first post.

Quote:
Originally Posted by Floatingshed View Post
Missing "Dither_convey_yuv4xxp16_on_yvxx()" or incorrect input color depth..
That means that you left the "Input color depth" as 16 bit (the default), but didn't call the Dither_convey_yuv4xxp16_on_yvxx() function from the Dither package.

So, if what you really wanted was to output 8 bit video, set that field to 8. If you want to output high bit depth video, but with other solution than the Dither package, set check_depth = False in the macro preferences (first lines of the script).

Last edited by vdcrim; 23rd January 2012 at 16:38.
vdcrim is offline   Reply With Quote
Old 27th January 2012, 08:53   #8  |  Link
dadix
Registered User
 
Join Date: Aug 2011
Posts: 44
Exactly what I was looking, thank you.

How to change input format from 640x720 to 1280x720? (--input-res 1280x720 not works)
My source is mp4.

Last edited by dadix; 28th January 2012 at 15:12. Reason: supplement
dadix is offline   Reply With Quote
Old 29th January 2012, 20:18   #9  |  Link
vdcrim
Registered User
 
Join Date: Dec 2011
Posts: 191
Quote:
Originally Posted by dadix View Post
How to change input format from 640x720 to 1280x720? (--input-res 1280x720 not works)
My source is mp4.
What do you mean? avs4x264mod takes care by itself of passing the correct --input-res value to x264 regardless of input bit depth, so just make sure that you're using the latest avs4x264mod and not the original avs4x264.
vdcrim is offline   Reply With Quote
Old 30th January 2012, 18:16   #10  |  Link
dadix
Registered User
 
Join Date: Aug 2011
Posts: 44
Thanks for the kind reply, vdcrim . I will do.
dadix is offline   Reply With Quote
Old 8th June 2012, 20:24   #11  |  Link
vdcrim
Registered User
 
Join Date: Dec 2011
Posts: 191
New version (see first post). It finally does all I need it to, so this will probably be the last update. AvsPmod 2.3.0+ is required now.
vdcrim is offline   Reply With Quote
Old 24th August 2013, 20:27   #12  |  Link
DrZine
Registered User
 
Join Date: May 2012
Posts: 7
I am trying out the Dither_out support you added to the git hub, but the macro doesn't seem to work for me. AvsPmod is throwing an error, Error in macro: invalid syntax (<string>, line 2). I would try to fix this myself, except: 1) I don't know the first thing about python and 2) Looking at the code it doesn't look like there was a single change to the code at line 2. The older v4 of the macro still works fine for me when I revert the changes. For now I'll just use the older way of passing a 16 bit stacked clip instead of using Dither_out.
DrZine is offline   Reply With Quote
Old 25th August 2013, 02:01   #13  |  Link
aldix
Registered User
 
Join Date: Sep 2012
Posts: 127
Very nice job. Have you had any thoughts of building in distributed encoding as e.g. RipBot?
aldix is offline   Reply With Quote
Reply

Tags
avisynth, avs4x264, avsp, avspmod, x264

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.