Encoding skills... The next step!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skydiver
    Junior Member
    Junior Member
    • Sep 2002
    • 12

    Encoding skills... The next step!

    Hay Lads I started out using flask and now use gordian knot and loving it but what is next? Are there any 'how to' kind of web pages on doing the things that gordian knot does for you? I have so far been unable to load the .vob files into virtual dub for processing the video. I can dub audio and split and add together already. Also I find this stuff very interesting and have been impressed that all of this software is free ware. I am currently studying software engineering and was wondering if there is any free source development going on in these areas I am still beginning (end of 2nd year) in this too but find this area interesting and think the best way to learn is to get your hands dirty!
    Cheers
  • khp
    The Other
    • Nov 2001
    • 2161

    #2
    First of all you can't open vob files in virtualdub.

    What GKnot does is pretty simple. It constructs an avs file and configures the virtualdub.jobs file and calls virtualdub/nandub. For audio encoding it just uses the commandline interface for azid/lame/besweet.

    What do you want to do ? Program your own version GKnot ?
    Or simply try doing every thing manually ?

    Take a look at the avisynth guide

    Last edited by khp; 9 Oct 2002, 03:46 AM.
    Donate your idle CPU time for something usefull.
    http://folding.stanford.edu/

    Comment

    • skydiver
      Junior Member
      Junior Member
      • Sep 2002
      • 12

      #3
      Just learning to do everything manually first will keep me busy for a while. To develp an application I would have to have much more knowledge then I do now. Thanks for the link I now have some understanding of the avs files created. Do you know of any places where I can learn about the format of the virtual dub job files and how to start virtual dub on them?

      Comment

      • khp
        The Other
        • Nov 2001
        • 2161

        #4
        Aside from the virtualdub help files, I don't think there is much documentation for the jobs file format.

        Here is the command line documentation.

        Command line options

        VirtualDub supports limited control via command line options. Allowable switches:

        . /bsource_dir,dest_dir adds a batch of jobs to translate from one directory to another, using the current options. (Note: there are no spaces in the switch.)
        · /c clears all jobs in the job list.
        · /r runs the job list.
        · /sscript_name runs a script.
        · /x forces an exit after the job list has run.

        The order of the switches matters, since switches are run from left-to-right. Because VirtualDub configuration files are simply Sylia scripts, just like the job list, they can be invoked using the /s option to set the dub processing parameters. So to do automated processing of video files, you can set the parameters you want and save them in a configuration file, and then have a scheduling program invoke VirtualDub using a command line like this:

        virtualdub /sparms.vcf /b?f:\ready?,?f:\output? /x /r

        VirtualDub will then run the script to load parameters, scan the f:\ready directory and add job entries to process files there to f:\output, run the job list, and then exit.

        Because VirtualDub is a GUI application, any console it is run from returns immediately, even before VirtualDub has finished processing. This is fine if you want to process in the background, but poses problems in a batch file. The solution is to use the start command to force a wait:

        start /wait virtualdub /s?pack indeo5.vcf? /bin,out /x /r

        This works under both Windows 95/98 and NT4.

        Finally, if you need more specific control, you can always write a program to generate job scripts and append them onto the virtualdub.jobs file, which is simply text. You must be careful about the format, or VirtualDub can get confused, but this allows you much greater freedom in file and mode selection. Then, in a batch file, simply invoke VirtualDub with the /r and /x flags alone to run the job list.
        As for the jobs fileformat, the easiest way to fingure that out is to make some jobs in virtualdub, and check the jobs file that virtualdub create.

        But of course I have already played with this stuff.

        Here is the template I use for divx5 encoding in virtualdub.

        Code:
         
        VirtualDub.Open("$source",0,0);
        VirtualDub.audio.SetSource(1);
        VirtualDub.audio.SetMode(0);
        VirtualDub.audio.SetInterleave(1,500,1,0,0);
        VirtualDub.audio.SetClipMode(1,1);
        VirtualDub.audio.SetConversion(0,0,0,0,0);
        VirtualDub.audio.SetVolume();
        VirtualDub.audio.SetCompression();
        VirtualDub.video.SetDepth(24,24);
        VirtualDub.video.SetMode(1);
        VirtualDub.video.SetFrameRate(0,1);
        VirtualDub.video.SetIVTC(0,0,-1,0);
        VirtualDub.video.SetRange(0,0);
        VirtualDub.video.SetCompression(0x78766964,0,10000,0);
        VirtualDub.video.SetCompData($bufflength,"$codecconfig");
        VirtualDub.video.filters.Clear();
        VirtualDub.subset.Delete();
        VirtualDub.SaveAVI("$destination");
        VirtualDub.Close();
        The line VirtualDub.video.SetCompression(0x78766964,0,10000 ,0); tells virtualdub to use the divx5 codec.
        And the line VirtualDub.video.SetCompData($buflength,"$codeccon fig");
        sets the divx5 configuration.
        Looks easy ehh ?
        Well the Variable $bufflength contains the length of the binary string that defines the codec configuration. And The variable $codecconfig must contain the the MIME base64 encoded binary string that define the codec configuration. I think I'll have to make another post explaining the codeconfiguration.

        And my MP3 muxing template for nandub looks like this.
        Code:
         
        VirtualDub.Open("$videosource",0,0);
        VirtualDub.audio.SetSource("$mp3source");
        VirtualDub.audio.SetMode(0);
        VirtualDub.audio.SetInterleave(1,500,1,0,0);
        VirtualDub.audio.SetClipMode(1,1);
        VirtualDub.audio.SetConversion(0,0,0,0,0);
        VirtualDub.audio.SetVolume();
        VirtualDub.audio.SetCompression();
        VirtualDub.audio2.SetSource(1);
        VirtualDub.audio2.SetMode(0);
        VirtualDub.audio2.SetInterleave(1,500,1,0,0);
        VirtualDub.audio2.SetClipMode(1,1);
        VirtualDub.audio2.SetConversion(0,0,0,0,0);
        VirtualDub.audio2.SetVolume();
        VirtualDub.audio2.SetCompression();
        VirtualDub.video.SetDepth(24,24);
        VirtualDub.video.SetMode(0);
        VirtualDub.video.SetFrameRate(0,1);
        VirtualDub.video.SetIVTC(0,0,-1,0);
        VirtualDub.video.SetRange(0,0);
        VirtualDub.video.SetDivX(910,10);
        VirtualDub.video.SetQualityControl(0,0,0,50);
        VirtualDub.video.SetMotionDetection(8,10,300,300);
        VirtualDub.video.SetCrispness(30,0);
        VirtualDub.video.SpaceKF(24);
        VirtualDub.video.InternalSCD(96);
        VirtualDub.video.SetMinKBPS(460);
        VirtualDub.video.SetCurveFile("");
        VirtualDub.video.SetCurveMcFactor(0);
        VirtualDub.video.SetCurveCompression(25,3);
        VirtualDub.video.SetCurveFilter(270,6000);
        VirtualDub.video.SetCurveCredits(0,350);
        VirtualDub.video.SetLumaCorrectionAmp(0,10,30);
        VirtualDub.video.SetCurveRedist(0);
        // VirtualDub.video.CalcCurveCompression();
        VirtualDub.video.SetCompLevelsMain(2,16);
        VirtualDub.video.SetCompLevelsA(300,3,16);
        VirtualDub.video.SetCompLevelsB(300,4,16);
        VirtualDub.video.SetCompLevelsC(300,5,16);
        VirtualDub.video.SetCompLevelsD(300,6,16);
        VirtualDub.video.SetCompLevelsE(300,7,16);
        VirtualDub.video.SetCompLevelK(4,31);
        VirtualDub.video.SetBitsReservoir(0,35,30,70,45,0);
        VirtualDub.video.SetLowBrCorrection(0,0);
        VirtualDub.video.NoAVIOutput(0);
        VirtualDub.video.GenStats("",0);
        VirtualDub.video.SetEncodingControl("");
        VirtualDub.video.filters.Clear();
        VirtualDub.subset.Delete();
        VirtualDub.brc.Set( 0, 645 );
        VirtualDub.brc.Set( 1, 1 );
        VirtualDub.brc.Set( 2, 128 );
        VirtualDub.brc.Set( 3, 0 );
        VirtualDub.brc.Set( 4, 1 );
        VirtualDub.SaveAVI("$destination");
        VirtualDub.Close();
        Last edited by khp; 9 Oct 2002, 10:58 PM.
        Donate your idle CPU time for something usefull.
        http://folding.stanford.edu/

        Comment

        • khp
          The Other
          • Nov 2001
          • 2161

          #5
          Divx encoder config via vdub jobs file

          As I wrote above, you can configure the divx codec via the virtualdub.jobs file by using the command
          Code:
          VirtualDub.video.SetCompData($bufflength,"$codecconfig");
          The variable $codecconfig must be replaced by a binary string encoded in MIME base 64.

          My knowledge on this subject is not complete, because it's based on a few simple experiments, but the following seems to work.
          All values are little endian. In general I don't have a clue what any of the literal values do.

          Code:
          [byte: 0-3]:      280
          [byte: 4-7]:      Bitrate in bits per second, note not kbits per second
          [byte: 8-11]:     RC averageing period in frames.
          [byte: 12-15]:    RC reaction period in frames
          [byte: 16-19]:    RC up/down reaction
          [byte: 20-23]:    Keyframe interval
          [byte: 24-27]:    max quantizer
          [byte: 28-31]:    min quantizer
          [byte: 32-35]:    motion search, max = 5
          [byte: 36-39]:    encoding mode 0 = quality based, 1 = one pass, 2 = two pass first pass, 3 = two pass second pass.
          [byte: 40-43]:    Quantizer (only used in mode 0)
          [byte: 44-47]:    0
          [byte: 48-51]:    0
          [byte: 52-55]:    31
          [byte: 56-59]:    100
          [byte: 60-63]:    0
          [byte: 64-67]:    0
          [byte: 68-71]:    B-frames, 0 =  disable, 1 = enable.
          [byte: 72-75]:    0
          [byte: 76-79]:    0
          [byte: 80-83]:    0
          [byte: 84-87]:    Q-pel, 0 = disable, 1 = enable.
          [byte: 88-91]:    8192
          [byte: 92-95]:    Scenechange threshold
          [byte: 96-99]:    Psychovisual, 0 = disable, 1 = enable
          [byte: 100-103]:  4096
          [byte: 104-107]:  2576980378
          [byte: 108-111]:  1070176665
          [byte: 112-115]:  2576980378
          [byte: 116-119]:  1070176665
          [byte: 120-123]:  64
          [byte: 124-127]:  GMC, 0 = disable, 1 = enable
          [byte: 128-131]:  128
          [byte: 132-135]:  0
          [byte: 136-139]:  0
          [byte: 140-143]:  0
          [byte: 144-147]:  0
          [byte: 148-151]:  640
          [byte: 152-155]:  480
          [byte: 156-159]:  0
          [byte: 160-163]:  0
          [byte: 164-167]:  0
          [byte: 168-171]:  0
          [byte: 172-175]:  0
          [byte: 176-179]:  0
          [byte: 180-183]:  0
          [byte: 184-187]:  0
          [byte: 188-191]:  1071644672
          [byte: 192-195]:  0
          [byte: 196-199]:  0
          [byte: 200-203]:  0
          [byte: 204-207]:  0
          [byte: 208-211]:  0
          [byte: 212-215]:  0
          [byte: 216-219]:  0
          [byte: 220-223]:  0
          [byte: 224-227]:  1
          [byte: 228-221]:  1
          [byte: 232-235]:  1
          [byte: 236-239]:  1
          [byte: 240-243]:  0
          [byte: 244-247]:  0
          [byte: 248-251]:  0
          [byte: 252-255]:  0
          [byte: 256-259]:  0
          [byte: 260-263]:  use MV-log, 0 = disable, 1 = disable.
          [byte: 264-267]:  0
          [byte: 268-271]:  psychovisual strength (1-3 I think)
          [byte: 272-275]:  4294967296
          [byte: 276-279]:  4
          [byte: 280-n]:    Firstpass log file path
          [byte: n+1]:      0
          [byte: n+2-m]:    Divx mpeg-4 output path
          [byte: m+1]:      0
          [byte: m+2-k]:    MV logfile path
          [byte: k+1]:      0
          [byte: k+2]:     'm'
          If anyone know more about this structure, I would very much like to know about it.
          Last edited by khp; 10 Oct 2002, 05:01 AM.
          Donate your idle CPU time for something usefull.
          http://folding.stanford.edu/

          Comment

          • skydiver
            Junior Member
            Junior Member
            • Sep 2002
            • 12

            #6
            Thanks very much for all the that I am sure that will keep me busy for a while

            Comment

            • g7wap
              Junior Member
              Junior Member
              • Dec 2010
              • 1

              #7
              Originally Posted by khp
              As I wrote above, you can configure the divx codec via the virtualdub.jobs file by using the command
              Code:
              VirtualDub.video.SetCompData($bufflength,"$codecconfig");
              The variable $codecconfig must be replaced by a binary string encoded in MIME base 64.

              My knowledge on this subject is not complete, because it's based on a few simple experiments, but the following seems to work.
              All values are little endian. In general I don't have a clue what any of the literal values do.

              Code:
              [byte: 0-3]:      280
              [byte: 4-7]:      Bitrate in bits per second, note not kbits per second
              [byte: 8-11]:     RC averageing period in frames.
              [byte: 12-15]:    RC reaction period in frames
              [byte: 16-19]:    RC up/down reaction
              [byte: 20-23]:    Keyframe interval
              [byte: 24-27]:    max quantizer
              [byte: 28-31]:    min quantizer
              [byte: 32-35]:    motion search, max = 5
              [byte: 36-39]:    encoding mode 0 = quality based, 1 = one pass, 2 = two pass first pass, 3 = two pass second pass.
              [byte: 40-43]:    Quantizer (only used in mode 0)
              [byte: 44-47]:    0
              [byte: 48-51]:    0
              [byte: 52-55]:    31
              [byte: 56-59]:    100
              [byte: 60-63]:    0
              [byte: 64-67]:    0
              [byte: 68-71]:    B-frames, 0 =  disable, 1 = enable.
              [byte: 72-75]:    0
              [byte: 76-79]:    0
              [byte: 80-83]:    0
              [byte: 84-87]:    Q-pel, 0 = disable, 1 = enable.
              [byte: 88-91]:    8192
              [byte: 92-95]:    Scenechange threshold
              [byte: 96-99]:    Psychovisual, 0 = disable, 1 = enable
              [byte: 100-103]:  4096
              [byte: 104-107]:  2576980378
              [byte: 108-111]:  1070176665
              [byte: 112-115]:  2576980378
              [byte: 116-119]:  1070176665
              [byte: 120-123]:  64
              [byte: 124-127]:  GMC, 0 = disable, 1 = enable
              [byte: 128-131]:  128
              [byte: 132-135]:  0
              [byte: 136-139]:  0
              [byte: 140-143]:  0
              [byte: 144-147]:  0
              [byte: 148-151]:  640
              [byte: 152-155]:  480
              [byte: 156-159]:  0
              [byte: 160-163]:  0
              [byte: 164-167]:  0
              [byte: 168-171]:  0
              [byte: 172-175]:  0
              [byte: 176-179]:  0
              [byte: 180-183]:  0
              [byte: 184-187]:  0
              [byte: 188-191]:  1071644672
              [byte: 192-195]:  0
              [byte: 196-199]:  0
              [byte: 200-203]:  0
              [byte: 204-207]:  0
              [byte: 208-211]:  0
              [byte: 212-215]:  0
              [byte: 216-219]:  0
              [byte: 220-223]:  0
              [byte: 224-227]:  1
              [byte: 228-221]:  1
              [byte: 232-235]:  1
              [byte: 236-239]:  1
              [byte: 240-243]:  0
              [byte: 244-247]:  0
              [byte: 248-251]:  0
              [byte: 252-255]:  0
              [byte: 256-259]:  0
              [byte: 260-263]:  use MV-log, 0 = disable, 1 = disable.
              [byte: 264-267]:  0
              [byte: 268-271]:  psychovisual strength (1-3 I think)
              [byte: 272-275]:  4294967296
              [byte: 276-279]:  4
              [byte: 280-n]:    Firstpass log file path
              [byte: n+1]:      0
              [byte: n+2-m]:    Divx mpeg-4 output path
              [byte: m+1]:      0
              [byte: m+2-k]:    MV logfile path
              [byte: k+1]:      0
              [byte: k+2]:     'm'
              If anyone know more about this structure, I would very much like to know about it.
              I used virtualdubmod to create a template based on the file i was compressing and ir produced "LWJ2MSAxMTAwMDAwIC12YnYgNDg1NDAwMCwzMTQ1NzI4LDMxN DU3MjggLWRpciAiRjpcdGVtcCIg
              LWIgMSAtcHJvZmlsZT0z" as the compression data. I heard mention of mime base 64 so i searched for a decode/ encoder via google
              I passed the above compression data to it and it translated it to
              "-bv1 1100000 -vbv 4854000,3145728,3145728 -dir "F:\temp" -b 1 -profile=3" if that's any help.

              Comment

              Working...