Tag Archives: MPEG4Modifier

Packed Bitstream in Win7

The Windows 7 ‘SuperCodec’ does not like Packed Bitstream xVids and DivX’s. It shows itself by looking like the playback is at 15-20fps instead of 23.997/25/29.997. Not a problem though, we can fix that with a little PowerShell and MPEG4ModifierCL (see below).

The script is as below, just save this into a UpdateVideoPacking.ps1

# Enumerate through avi files in directory
# and run MMCL to uncompress them if required

foreach ($file in get-childitem *.avi)
{
  $FileTrim = $file.name.TrimEnd(".avi")
  $FileNew = $fileTrim + ".up.avi"
  write-host "Working on " $FileTrim "Output To " $FileNew
  mmcl –unpack $file.name $FileNew
  if($LASTEXITCODE -eq 0)
    {
      if (Test-Path $FileNew)
       {   
         write-host "Would delete "$file
         del $file
       }
    }
   write-host "Completed Folder"
}

Make sure that the MPEG4Modifier executable (mmcl.exe) is in the path, or the same folder as the script/video’s.

Now pull down and install PowerShell if you have not, launch it and type set-ExecutionPolicy unrestricted (will allow the PS1 to run)

Now change folder to the video folder you want to process and type fullpathtoscript\UpdateVideoPacking.ps1 this will run the script in the folder, I put both the script and the mmcl.exe in my c:\utils folder, which is in my path.

The script will read the file in, determine if the file needs unpacking, if it does it will create a file with the same name as the original but put .up before the .avi. It will then make sure the unpack worked without error, and delete the original, if you don’t want it to delete the file put a # in front of the line del $file this will then just echo the file’s name out to the screen that would have been deleted.

Yes I know the code is a little clunky, and this version only does one folder at a time, I do have a version that will traverse the tree, and will post it if anyone wants it.

MPEG4ModifierCL Download