[Back to main] [Printable version] [Leave a comment]

Convert 4:3 DV AVI files to 16:9 in Windows [Leave a comment]

Written by Jarno Elonen <elonen@iki.fi>, jan 2010, released into the Public Domain

The following VB script uses the Enosoft DV Processor (on Windows) to convert/reset the aspect ratio flag of all .AVI files from 4:3 to 16:9 in the directory where the script is executed (losslessly, without any recompression). It writes the modified files to a subdirectory "out/", which must exist.

' Batch VB script to change aspect ratio of AVI DV files to 16:9
' using Enosoft DV Processor (in Windows).
' The script processes all .AVI files in the execution directory
' and makes 16:9 copies into folder ".\out" (that must exist).
'
' Written by Jarno Elonen <elonen@iki.fi>, 20010-01.
' Released into the Public Domain.

Set fso = CreateObject("Scripting.FileSystemObject")

Set folder = fso.GetFolder(".")
Set files = folder.Files
For each folderIdx In files
  If InStr(folderIdx.Name, ".avi") > 0 Then

    Dim App
    Set App = CreateObject("EnoDVProcessor.EnoDV2DVApplication.1")
    App.Visible = True
    App.Caption = "Setting AR 16:9 for " & folderIdx.Name

    App.AVIInputDisableSeeking = True
    App.EmbeddedEnable = True

    App.InputAsFile = fso.GetAbsolutePathName(folderIdx.Name)
    App.SetOutputAsFile fso.GetAbsolutePathName("out\" + folderIdx.Name), False, True

    App.EmbeddedAspectRatioEnable = True
    App.SetEmbeddedAspectRatioConfig False, 2 ' IEC16x9FullFormat

    App.AVIInputDisableSeeking = True
    App.EmbeddedEnable = True

    ' start processing
    App.RunProcessor
    ' wait for the processor to stop by polling the graph state every few seconds
    Do Until App.ProcessorGraphState = 0
      WScript.Sleep 1000
    Loop

    App.Quit

  End If
Next

Comments on page '/code/misc-notes/enosoft-16-9-avi'

Name:
Email (opt):
Message (no HTML support):
Comment type: Public Private (for page author only)
Spam check: + 2 = 8
Email is optional, not visible to other users, and only used for possible replies.
Please note that the comments are not guaranteed to stay on-line. Trivial questions may be removed after answering them. Corrective and additional notes are sometimes integrated into the main article. Thanks and critisicm are welcome, but are pruned away from time to time. Offensive, abusive, distasteful or aggressive messages are of course removed without a second thougt. Messages sometimes disappear for technical reasons and sometimes just because the administrator felt like removing them.