Canon offers optional 24p support on their HDV consumer camcorders: this mode officially is called “PF24″. Unfortunately, PF24 doesn’t record on the tape a “pure” 24 frame progressive stream but instead it records 18 progressive frames and 12 interlaced ones — inside a 60i stream. Even worse, Canon does not include “flags” in that video stream to guide applications as to how to extract the 24 progressive frames out of this 60i stream. So in order to get a real 24p stream out of this bastardized 24p/60i mess, you need to perform what is called a “removal of pulldown” (aka “inverse telecine” and “pullup”). PAL users do not need to do this because their PAL cameras don’t have a PF24 mode — this burden is only for NTSC users who manually chose to shoot in the PF24 mode. Finally, HV40 users can select the “24p” mode instead of the “PF24″ mode, and in that case, pulldown removal is not required either.
If your videos are destined to only be played back on a TV-set via a DVD player, or as .m2t files via the HV20/HV30 tape, then you do not need to remove pulldown (you edit/export as 60i, and the TV will take care of the pulldown removal automatically, it was designed for it). But if the TV-set is not your (only) final destination for your video, then the pulldown removal must be performed the right way before you start editing your footage. Here’s how fast motion 24p footage looks like when you leave it inside the 60i stream, and how it looks when you removed pulldown properly. Obviously, there is a major quality hit that you will get on non-TV playback devices if you don’t remove pulldown. Here’s another example showing the problem.
Adobe After Effects (tutorial) is the only editor that will perform the pulldown removal easily (Premiere on the other hand does not do it the right way and it requires a special workflow), while Final Cut Pro is reportedly able to manage it too (tutorials here and here). There are also three commercial utilities that will perform the pulldown removal for you (TMPGEnc 4.0 XPress costs $99, DVFilm Maker costs $150, while Cineform’s NeoSCENE costs $129 and it has the advantage of doing it during tape capture). If your video editor doesn’t have the ability to do pulldown removal by itself, I *highly* recommend you buy Cineform NeoSCENE. It’s the best there is.
However, if you don’t have the money for it, you can find below the FREE ways on how to deal with the inverse telecine HV20/30 annoyance. Please note that if you are a consumer and you don’t have a “pro” editor, Sony Vegas Movie Studio 9 Platinum Edition is the only consumer-priced NLE that (unofficially) supports 24p timelines — so if you want to work with 24p (after you have removed pulldown), make sure you have bought the right video editor. The Windows methods below look too involved at first glance, but after you have it all setup, it’s a piece of cake to use it with your footage from then on.
After you are done with your selected method, make sure you scroll towards the end of this article to read the “important notes”.
If you don’t own the recent versions of Final Cut Studio or After Effects there are a couple of freeware methods to get your pulldown removed. Please note that iMovie and Final Cut Express do not support 24p, so on the Mac side you will need either Final Cut Studio, After Effects or Avid tools to do true 24p editing (and honestly, it’s cheaper to buy a dedicated PC video station with Sony Vegas Platinum 8+ than any of these professional Mac NLEs).
1. Install the Firewire SDK package and load the DVHSCap application that is part of that package. Using that application you will capture PF24 footage in .m2t format.
2. Unzip and drop Mencoder on the same folder as your captured .m2t files. Mencoder will be used to re-encode your .m2t files into the lossless Huffyuv codec.
3. Open the Mac OS X Terminal and navigate to the .m2t capture folder. Run the following command for each of your .m2t 24p files to remove pulldown and encode in Huffyuv. If you are proficient with Unix or AppleScript, you can write an executable script to automatically read and re-encode all .m2t files in the folder without requiring user intervention.
./mencoder INPUT_FILENAME.m2t -mc 0 -noskip -fps 30000/1001 -delay -0.222 -oac pcm -vf pullup,softskip,harddup,scale=1920:1080 -ofps 24000/1001 -ovc lavc -lavcopts vcodec=huffyuv:pred=2:format=422P:vstrict=-1 -o OUTPUT_FILENAME.avi
(Note: the same command line can be used under Linux/BSD too, as long as your Unix video editor supports HD and Huffyuv — one such editor is KDEnLive)
4. Install Perian for Quicktime. This component will let all Quicktime-enabled applications to read Huffyuv files on the Mac.
Now, using these newly created .avi Huffyuv 1920×1080/24p files you can edit on the Mac Quicktime-enabled video editor of your choice, as long as it supports 24p. You can also use these files with Linux video editors, but if you want to use them with Windows editors you might need to change the “pred=2″ to “pred=0″ in the above command line.
Optionally, if you are having problems with reading Huffyuv on Adobe’s, Avid’s or older Final Cut Pro versions, or if you prefer smaller file sizes and faster editing, you can transform the Huffyuv files to the Apple Intermediate Codec (AIC), which is the default lossless Apple format. There won’t be quality loss as both codecs are lossless. Here’s how:
[5.] Install JES Deinterlacer (any version). In the “Input” tab click “progressive”, “video range”, and choose the first Huffyuv .avi file to convert. In the “Project” tab select “Bare Project”. In the “Output” tab select the filename/folder to save the .mov file that JES will create, and select “progressive out” and “Direct Apple Intermediate Codec” and “Copy Sound” for sound export. Then, press “ok” and the re-encoding to AIC will start (it will be a real fast encoding). Then do it for the next .avi file in the line, and so on.
You will need Mac OS X 10.4.x and above to use the latest version of JES that actually supports inverse telecine. The utility automatically detects the cadence too (select its checkbox) and this means that you don’t personally have to go through every clip to figure out which frames are AA and which are BC. Again, you must use DVHSCap as the capture utility (comes in the Firewire SDK package) and then buy the Quicktime Pro mpeg2 plugin for $20 or use the MpegStreamClip utility to export in .mov (lossy export), so JES can read the .m2t file. When all the correct settings are used on JES, save by using an appropriate lossless format of your choice and then import to your NLE for editing (e.g. PhotoJPEG if platform independence is important for you, or Apple Intermediate Codec for Macintosh-only editing). I won’t get into much detail using this utility, check this thread if you need more help with it. Honestly, this is not a great method as it requires either lossy exports or payware plugins.
Generally speaking, the Linux support for PF24 and HDV is not very good. Even if you manage to remove pulldown properly using an acceptable codec, the Linux NLEs are not that great handling 24p or HD editing. Crashes occur quite a lot, so brace yourself.
HDV support on Linux is currently spotty, but check out this thread for mencoder-based solutions (make sure you read all the comments on that thread).
The application Avidemux v2.4+ is close to getting it “right” and allow HV20 users to remove pulldown the right way, but it’s not “there” yet. Load your .m2t file, and then apply the following filters to it:
- Decomb Telecide – Use “3:2 pulldown” option for the Strategy setting
- Decomb Decimate – Use “Pulldown dupe removal” for the Mode setting
After removing pulldown, you want to save your video in a lossless format to use in your video editor. Avidemux2 only offers the Huffyuv codec as a lossless option and MJPEG as “visually lossless”. Finally, there is a major A/V sync issue in the files that Avidemux produces after removing pulldown (even after you adjust for the necessary -0.222sec audio delay), so you must manually fix that later on your NLE — if your NLE supports that.
Method 0 (for Vegas users only)
Read about it here. Come back to this article to use another method if this one is not good enough for you.
Method 1 (faster and easier)
1. Install Avisynth.
2. Download and unzip the TIVTC v1.05 plugin. Inside that zipped folder, you will find a file called TIVTC.dll. Drag-n-drop that .dll file on the C:\Program Files\AviSynth 2.5\plugins\ folder. Vista/XP 64bit uses a different path.
3. Unzip ffmpeg somewhere.
4. Install Avid’s DNxHD PC codecs at the bottom of this page, (or Huffyuv).
5. Download and install the latest ffdshow version.
6. Unzip the Batch Intermediate Creator somewhere (thanks goes to Khaver, read discussion in that link).
7. Load its ffmpeg-bic.exe application and fill up what it needs to know, like in my screenshot here.
8. Click the “ffdshow video decoder configuration” and make sure the “deinterlacing” checkbox is checked. Also, make sure that ffdshow is the default mpeg2 decoder in your system (you can set that in the ffdshow configuration panel). Otherwise, it won’t work correctly.
9. Add some PF24 files, and start the process. This will create either Avid DNxHD .mov files, or Huffyuv .avi files at 23.976 fps, progressive. I would suggest you go with the Avid DNxHD codec.
The setup as shown in the screenshot also creates proxy files — smaller versions of these big 24p intermediate files that are too slow to edit. Here’s how to use proxy files with Vegas. It is possible to tweak that proxy editing tutorial for other 24p-capable editors too. You can uncheck the proxy-related checkboxes to not create any proxy files.
The following guide is based on Farnsworth’s and Steve SZudzik’s scripts and guidelines (1, 2), but it clears up a few more installation problems that are not discussed on Steve’s pages. Yes, it’s a rather involved procedure but after the following initial setup it’s really easy to use, and it can save you some cash.
1. Create a new folder on your C:\, called “Tools”. Inside that “Tools” folder, create the following new folders: “Working”, “DGIndex”, “VirtualDubMod” and “Pulldown”. Keep the C:\Tools\ folder open in your Windows Explorer, as we will be using it below.
2. Download and install the XVid library support (required). Once it’s installed, you can safely delete that downloaded installation file.
3. Install the stable 2.5.7 version of the AVISynth application. Follow the default options during installation. Once it’s installed, you can safely delete its downloaded installation file.
4. Download the DGIndex application. Unzip that downloaded .zip file, select all files and folders in it, and drag-n-drop them on C:\Tools\DGIndex\. From within that last folder, copy the file called “DGDecode.dll” and paste it on the C:\Program Files\AviSynth 2.5\plugins\ folder (make sure you do a “copy” and not a “move”). You can delete that downloaded .zip file now.
5. Download and install the VirtualDubMod application (make sure it’s the VirtualDubMod application, not VirtualDub — these are two different apps). Unzip that downloaded .zip file, select all files and folders in it, and drag-n-drop them on the C:\Tools\VirtualDubMod\ folder. You can delete that downloaded .zip file now.
6. Download and unzip the TIVTC v1.05 plugin. Inside that zipped folder, you will find a file called TIVTC.dll. Drag-n-drop that .dll file on the C:\Program Files\AviSynth 2.5\plugins\ folder. You can delete that downloaded .zip file now.
7. Download and unzip the MPASource plugin. Inside that zipped folder, you will find a file called mpasource.dll. Drag-n-drop that .dll file on the C:\Program Files\AviSynth 2.5\plugins\ folder. You can safely delete that downloaded .zip file now.
8. Download the HV20Pulldown application (this is Steve’s handy application). This application requires the .NET Framework to be installed, which usually comes by default with recent Windows versions. Unzip that downloaded .zip file, select all files in it and drag-n-drop them on C:\Tools\Pulldown\. You can delete that downloaded .zip file now.
9. (Optional, but recommended). Download the Lagarith lossless codec (it creates files that are ideal for video editing). Unzip that downloaded .zip file, and drag-n-drop on your desktop the two files that their names are starting with the word “lagarith” (these are: lagarith.inf and lagarith.dll). Right-click on the file that’s called either plainly “lagarith” or “lagarith.inf”. From that right-click menu select “Install”. After about 10-15 seconds, the Lagarith codec will be installed. Delete the two lagarith files from your Desktop and their downloaded .zip file.
10. Download this small .mpg video file (61 KB) (select “save link as” on your browser, or similar). This .mpg file will only be used on step #11, and then it can be safely deleted. Also, download this 14 MB .m2t file (select “save link as” on your browser, or similar). This second file, named PF24.m2t, will serve as our testing video in this tutorial. It is a 24p-in-60i .m2t file, which we will perform the pulldown removal and transform it to a true 24p file in step #13, just so we can make sure that everything got installed ok.
11. Open the application C:\Tools\VirtualDubMod\VirtualDubMod.exe by double-clicking it. There will be some pop-up windows the first time you run the application, that’s ok, just press “ok” to them to discard them. Through the VirtualDubMod application, open the traian.mpg video file you downloaded above (actually, any .mpg file you might have around will do). Once the small video is open in the VirtualDubMod application, click on “File”, then “Save as”. From that dialog, make sure that the “Audio-Video Interleave (*.avi)” option is selected next to the “Save as type:”. Then, click the last button on that dialog, called “Change”. A new dialog comes up called “select video compression”. In that dialog, select the “Lagarith lossless codec” from the list. Once that’s selected, click the button on the right called “Configure”. A yet another dialog comes up. If you don’t mind huge video files after the pulldown removal, you can leave the default “Mode” to “RGB”. However, by changing the “Mode” to “YUY2″, you can cut the file sizes to half while loss of quality remains minimal, so it’s recommended to use “YUY2″. If your computer has more than one real or virtual CPUs (e.g. it’s a multi-processor machine, Hyperthreading, Dual Cores etc), also check the “Use multithreading” checkbox, but leave unchecked if unsure. After all that is done, click “Ok”, and then “Ok” again at the dialog below that. On the “save as” dialog click “Cancel”. Then, close down VirtualDubMod. Lagarith is now configured in the system. Warning: Adobe’s apps have a bug on their YUY2 reader, so you might want to select a different “mode” (select different modes and then decide which one works with AE/Premiere and at the same time the filesizes are not too huge).
12. Open the application C:\Tools\Pulldown\HV20Pulldown.exe by double-clicking it. Click the little […] button on the right side of “Working Directory”, navigate and select the folder C:\Tools\Working\. For the DGIndex’s path, click its button on the right again, navigate and select C:\Tools\DGIndex\DGIndex.exe. For VirtualDubMod’s path, click its button again, navigate and select C:\Tools\VirtualDubMod\VirtualDubMod.exe. For the AVS Template path, click its button on the right, navigate and select C:\Tools\Pulldown\Template.avs. Make sure that the two checkboxes below are checked. From the compression drop-down selection box, select “Lagarith Lossless”. Here is how the application looks on my PC (only unimportant difference is that my main folder is called “Video tools” while yours is called just “tools” — that’s ok):
13. In the “Video Files” section of the HV20Pulldown application, click “Add”, navigate and select the PF24.m2t video file that you downloaded on step #10. Then, from the application’s menu, select “Processing” and then “Run”. Some windows will be opened up, don’t worry about that. Depending on the speed of your PC, about 2-3 minutes later you should be having an .avi file on your C:\Tools\Working\ folder (which is the output folder). That .avi file is the resulted 24p progressive file, with pulldown removed and it’s what you will use to edit on your NLE video editor. If that file is about 68 MBs, congratulations, everything worked perfectly, and you are now ready to tell the HV20Pulldown.exe application where your own 24p-in-60i captured .m2t footage is stored so it can perform the pulldown removal on your own clips too. If it didn’t work as expected, check all the steps again to make sure you did everything correctly or seek help below.
Important: If you are getting Avisynth errors that some plugins are missing, try editing the C:\Tools\Pulldown\template.avs file by using a text editor (e.g. notepad.exe) and add this at the beginning of that file:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mpasource.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TIVTC.dll")
If you get a “AVI Import filter error”, download and install FFDShow‘s “generic build (stable)” version, and retry the process.
Now that you are done setting this up, don’t forget to read the “Important Notes” below!
Method 3 (NOT recommended)
This method requires some basic knowledge of the DOS prompt (if you know how to navigate with it, you are good to go). However, I would discourage you to use this method, because it creates some A/V sync issues overtime, and sometime it crashes on big .m2t files. I would suggest you use the Method 1, and if you can’t, buy Cineform NeoSCENE instead. It would save you from the misery of things not being 100% right. Anyways, here it is:
1. Download the plain version of Mplayer for Windows and unzip it somewhere that you can find back easily, e.g. c:\mplayer\. Inside that unzipped mplayer folder, create a folder named “input”, and a folder named “output”. This action only needs to be done once for your system.
2. Capture the files in .m2t format using Vegas or HDVSplit or Premiere/AE. Copy (or move) the .m2t files on the mplayer’s “input” folder.
3. Download the Lagarith lossless codec. Unzip the .zip file on your desktop, right click on the lagarith.inf file and select “Install” (note: Vista might not give you that option, in which case manual registration of the codec’s DLL file must happen via the DOS prompt, google it). After about 15 seconds, you can delete these files from your desktop, as the Lagarith lossless codec is now installed on your system. Open a DOS prompt and navigate to the mplayer folder (if it’s not open already at that folder). There, run this command:
vfw2menc -f laga -d lagarith.dll -s settings.mcf and on the new dialog that pops up select: “YUY2″ from the “Mode” menu, and “Use Multithreading” if your CPU is hyperthreaded/multi-CPU or it has more than one Core (leave unchecked if you don’t know). Then click “ok” to discard the Lagarith configuration dialog. This action only needs to be done once for your system.
4. Open a DOS prompt, navigate to the Mplayer folder that has the mencoder.exe file in it, and then run the following command, substituting each time the right input/output filenames with your own video filenames:
mencoder input/INPUT_FILENAME.m2t -aspect 16:9 -mc 0 -noskip -fps 30000/1001 -delay -0.222 -oac pcm -vf pullup,softskip,harddup,scale=1440:1080 -ofps 24000/1001 -ovc vfw -xvfwopts codec=lagarith.dll -o output/OUTPUT_FILENAME.avi
If you are proficient with DOS scripting, you can even write a script that will automatically read all the files on the “input” folder and export them one by one without requiring your attendance. Here is an automation script, donated by Nathan Pesin. Save it in a .bat text file, and run it. It assumes your mplayer folder is on c:\mplayer\ but you can edit that if you put mplayer somewhere else in your drive.
for %%I in (%input%\*.m2t) do (
echo Encoding %%I…
mencoder %input%\%%~nI.m2t -aspect 16:9 -mc 0 -noskip -fps 30000/1001 -delay -0.222 -oac pcm -vf pullup,softskip,harddup,scale=1440:1080 -ofps 24000/1001 -ovc vfw -xvfwopts codec=lagarith.dll -o %output%\%%~nI.avi
5. After MEncoder is done re-encoding all your files, you can choose to delete or move away the .m2t files on the “input” folder (so they don’t mix with video files you will place there in the future), while all the .avi files found on the “output” folder are now ready to edit! Windows Media Player won’t recognize these files as widescreen, but don’t worry, they are widescreen: Vegas will recognize them as such (if not, just set manually the clips’ aspect ratio to 1.3333). Create a new project in Vegas (or any other 24p-enabled video editor), select the HDV 1080/60i template, but change the following this time: Field Order should be “progressive scan”, frame rate should be “23.976″ (type it if it’s not in the list), rendering quality “Best”, and de-interlacing method “none”. Then, load the .avi files on your editor, edit as usual and enjoy true 24p!
There is a third party graphical utility for this method, check it here.
1. After performing the pulldown, the aspect ratio of the Lagarith .avi file will be reset to 4:3 instead of widescreen 16:9. Do not panic. After you import the 24p resulted .avi file to your editor’s “project media”, modify the properties of that clip to tell your video editor that the file has 1.3333 aspect ratio. Premiere and Vegas can do that on per clip basis.
2. The Lagarith and Huffyuv .avi files are big and they will stutter & drop frames when trying to play them back on a media player or on your video editor. That’s normal and to be expected, because they are what are called “intermediate formats” that are meant for editing and archiving, not for casual viewing. If the slowness bothers you while editing, create proxy video files or export in Cineform if you are using Vegas: Select “custom” in the .avi exporting option of Vegas and select the Cineform codec, 1440×1080, aspect ratio 1.3333, 23.976 fps, progressive scan). The Cineform files are smaller and faster to edit than Lagarith/Huffyuv, and there won’t be any quality loss when re-encoding to it because they are all visually lossless codecs. However, re-encoding might take a bit of time, so it’s up to you if you want to edit directly in Huffyuv/Lagarith or in Cineform (or in any other intermediate HD format).
3. To force Vegas Movie Studio 8/9 Platinum to change its timeline timecode to 24p (there is no preset for that you see), you create a new project and you tell it to use the properties of a specific video file instead of selecting from Vegas’ limited project templates. Open the “project properties” dialog and use its yellow “match media” icon. Navigate to one of your Lagarith .avi 24p files, and voila! Vegas Movie Studio Platinum will now configure the project as 24p IVTC. I have put together for you a visual guide for the correct Vegas workflow with these kinds of files.
4. HDVsplit is a popular HDV capture freeware utility. While it generally works ok, unfortunately it occasionally crashes Vegas. So, if you will use HDVSplit with anything but Vegas, that’s ok. Otherwise, use Vegas’ own HDV capture facility (which is one big continuous .m2t file for Vegas version 7 or earlier, and with scene detection support, in smaller .m2t files in version 8+). Obviously, version 8+ is recommended over other Vegas versions for that reason alone. The Pro versions of Vegas 7/8 support scene detection too after you install its official updates from Sony’s site.
5. Vegas Movie Studio Platinum 7/8 won’t let you save your pulldown’ed 1440×1080/24p anamorphic video as 1920×1080/24p because it’s supposed to be a “consumer-level” NLE (it errors out when you try to save as 1920×1080, but it will work for 1440×1080). What you can do to go around this limitation is make sure that the anamorphic bit of the edited video is set correctly, and under the export settings, export your final edited video using a lossless codec. I have written a tutorial here which will guide you on how to export in h.264, XViD, Flash and other formats in various resolutions that Vegas Movie Studio and Premiere LE don’t support out of the box. Vegas Platinum 9+ does not have this limitation.
6. The recommended method of pulldown removal for Windows above might exhibit some small audio/video sync issues. It has been observed in some few installations, but not in most others. Some speculate that the problem is either with localized versions of the .NET framework, others that different PC clocks create different numbers during calculations performed by the utilities. There is not much we can do to fix that with this method, but maybe you can fix it later while editing. As long as your clips/scenes are not longer than 5 minutes each, you shouldn’t see any A/V sync issues.