View Full Version : hf100, hf10, hf11 pulldown removal from 29.97 prores after L+T
J Davis
02-14-2009, 05:36 PM
I'm on an editing project where I'm getting .mts media from HF10, HF11
and media is shot at 24 fps (embedded in 60i).
Am using FCS2, version for fcp is 6.0.5, and an intel mac.
I've done many searches and have found the following post designed for
HV30 capture of 1080i60 which describes reverse telecine to 1080p24
post is here --> http://support.apple.com/kb/HT2410
(http://support.apple.com/kb/HT2410)
The problem is that with AVCHD we have to use log and transfer,
not log and capture and we end up with a file that is prores 29.97 interlaced
instead of 60i which is what the camera embeds in.
So far I'm using the same compressor settings from the apple post above
in the hope that it works even though this source media is not 60i.
It seems to be working as far as I can tell.
To check the transcodes I'm stepping through the frames
one at a time looking for pulldown (repeated frames or interlacing).
The first and last frames have the jaggies but all others seem to be fine.
I know that these AVCHD files do not have duplicate frames flagged for
removal. Does compressors' reverse telecine option contain frame matching
to see if they are identical?
Thoughts anyone?
Of note :- Isaac Brody has an interesting post about this same topic where he
mentions a cinetools workflow and JES Deinterlacer
his post is here
--> http://dvxuser.com/V6/showpost.php?p=1505159&postcount=18
Isaac, if your reading this can you share some of your expert knowledge
on cinetools and JES?
J Davis
02-14-2009, 10:51 PM
Its long hours and I'm exhausted.
Correct me if i'm wrong but
Prores 29.97 interlaced that FCP logging format reports
is half the information of 60i that the camera embeds to.
So where is all the missing data?
Additional note: I found a thread on the apple site that talks about cinematools to
remove pulldown manually. For those interested see the 5th reply in this thread
http://discussions.apple.com/thread.jspa?threadID=1518453
If anyone knows settings for JES deinterlacer,
http://www.xs4all.nl/~jeschot/home.html#DEI (http://www.xs4all.nl/%7Ejeschot/home.html#DEI)
please share the knowledge.
I have searched but have found no easy streamlined approach. I double encode using compressor just like the apple document you linked to describes.
I think the footage looks great if you use compressor to get the 23.98 even with the double encode.
If you really want to find out whats best, do the same clip with a double encode and then do it again by finding the cadence manually. Look at the clips and see if theres any loss.
If you do it let us know what you find.
Isaac_Brody
02-15-2009, 02:25 PM
I'm not using Cinematools, just JES.
http://www.xs4all.nl/~jeschot/home.html#DEI (http://www.xs4all.nl/%7Ejeschot/home.html#DEI)
Take your footage that you log and transferred in Final Cut and open it in JES.
1. Under Input make sure Topfield is checked.
2. Under Project select inverse telecine, select detect cadence breaks, and set output framerate to 23.976.
3. Don't mess with color, just leave it on default.
4. Under output put it in a different folder than original materal.
5. Under video output select export and choose quicktime movie. Choose prores.
Under your Prores settings make sure framerate is at 23.976, set to progressive, dimensions 1920X1080
Sound setting is Integer(Big Endian) Sample rate 48.000kHz, 16bit, Stereo
and hit OK.
6. And hit OK to have it run. It should strip the pulldown and get you back to native 23.976.
J Davis
02-15-2009, 05:58 PM
Thanks mico and Isaac.
Its a new day and I have a fresh mind to tackle this problem.
I have run the compressor method and Isaac's JES deinterlacer method on
the same clip and then compared both alongside the original 29.97 that
comes from L+T.
JES and compressor return exactly the same result and I tested this by stepping
though one frame at a time and comparing them.
I also did the same frame step thru test on the L+T output and
I noticed something interesting.
The Log & Transfer 29.97 output file has a pattern that steps thru like this
1. Progressive
2. Progressive
3. Progressive
4. Interlaced
5. Interlaced (then repeat pattern)
Frame 4 always looks like a mix of two images and
is consistantly worse than frame 5.
Also,
both JES and compressor are dumping frame 4 and deinterlacing frame 5.
I don't understand how they know that frame 5 is always better but its
pretty cool that they get it right every time!
End result is 5 frames becomes 4 (and therefore 30 frames becomes 24).
BUT
the really interesting part occurred when I looked at frames 1,2 and 3
between the 29.97 L&T file, the JES 24p output
and the compressor 24p output.
Frames 1,2 and 3 are the same.
The same on 29.97 L+T, Jes output and compressor output.
JES and compressor are not even touching these frames
(and I checked this across several seconds)
now ...
shouldn't the first three frames of the 29.97 L+T file look interlaced?
Especially as FCP format info reports this file as 29.97 interlaced?
What I think might be happening is that Log and Transfer from .mts
is also doing some of the deinterlacing.
L+T is taking the first 6 interlaced frames from the .mts
file and deinteralcing them to output 3 progressive frames.
L+T then takes the next 4 interlaced frames from the .mts
file and outputs 2 interlaced frames.
Thus we see a Prog-Prog-Prog-Int-Int pattern as above.
This would solve the missing information that I mentioned in my original post
as to why FCP reports the L+T output file as 29.97 interlaced when the
input is 60i
uggggh ... why can't post production be simple?
and is this the cost of going solid state?
(shakes head) FCS3 cannot come soon enough.
Anyway,
looking forward to wrapping up this editing project and getting back to
what I do best
... which is writing :)
EDIT
you might want to check the first and last frames of any final transcode as they often contain
jaggies or compression artefacts
Isaac_Brody
02-15-2009, 10:51 PM
That's odd, last time I compared both Compressor and JES, Compressor ignored interlace frames which JES took care of. Might be the settings I'm using. I wrote them from memory but JES looked right to my eyes. JES again is nice for having the droplet feature, basically have your settings set and you drop all files on it and it's automated. Much quicker than Compressor.
Seems like Cineform has solved this issue and created neoscene a program for mac and pc that converts and telecines the avchd footage to cineform avi or pro res for editing.
Makes your footage 23.98. So for $129 it makes the process easy. The mac version is still beta.
J Davis
02-28-2009, 10:47 AM
Here's an update - I have switched up my workflow.
Unlike Final Cuts Log & Transfer, the CS4 media encoder allows direct conversion
from the AVCHD .mts files to any codec, any size. This is extremely useful if you
need low res dailies or preview files to hand off.
Or if your final output is less than 1080p.
But I've noticed that I can deinterlace
but I can't remove pulldown if I'm on 24 fames per second
Still using compressor or JES for that.
FCP's log and transfer also squeezes it to HDV (a 1440 width)
which is another advantage that media encoder has over L&T.
But I'm still editing if FCP as I don't wanna relearn all my hot keys!
h-munster
03-08-2009, 12:38 AM
Hi,
I have a Canon HF11 and I use Linux, so I pretty much run free, open-source software exclusively.
I have found the "detc" filter in mencoder to be the best, open-source pull-down removal filter for my HF11 24P footage. It seems to work perfectly -- when I advance through the video one frame at-a-time, I find no dropped/duplicate/combed frames.
I also need to be able to give files to editors that they can use in Final Cut Pro, so I use ffmpeg to convert to the requested format (often Quicktime).
So, the procedure I am trying now is to remove the 24P pull-down in mencoder, and, then, I use ffmpeg to convert the resulting file to the Quicktime format at the desired bitrate.
Here is the mencoder command:
mencoder canon_24p_footage.mts -fps 60000/1001 -oac pcm -demuxer lavf -vf detc,softskip -ofps 24000/1001 -ovc lavc -lavcopts vcodec=ffvhuff:format=YV12:vstrict=-1:aspect=16/9 -o intermediate_file.avi
And I follow-up with this ffmpeg command:
ffmpeg -i intermediate_file.avi -vcodec mpeg4 -b 35000k -f mov -acodec copy final_quicktime_file.mov
Then I remove the intermediate file.
A test run is posted at http://marks.org/avchd/ The test file is ffmpeg05.mov (The original Canon AVCHD footage is also posted on this page -- 00053.mts).
I am doing this manually. It will probably get tedious and time consuming when there are a lot of files to convert. I know scripts are easy, but I am a complete novice. If someone is good at scripts, I would welcome any help in writing one to automate this procedure for batches of files.
I am still experimenting to get the best quality. For instance, I wonder if it is better/cleaner to use the "raw video" format in mencoder, and, then, pipe that result into ffmpeg.
Also, I'm guessing that should probably make a 2-pass encode in the ffmpeg command stage.
Curiously, I was unable encode more than a 27 Mb/s bitrate in Quicktime -- is that a Quicktime limitation? The Canon HF11 AVCHD footage was recorded at 24Mb/s. I would like to encode at 35Mb/s into a format that can be used in Final Cut Pro.
There are some possible A/V sync problems, apparently due to the Canon/AVCHD use of B-frames and the occasionally resulting glitches/skips in mencoder. I have not yet seen a sync problem nor a glitch/skip with the above mencoder command, but I have not yet encoded any long-running clips with it.
Any opinions and suggestions are appreciated.
By the way, I also made a smaller AVI file with this method and posted it on the same page: "ffmpeg07.avi".
Thanks,
-Dale
J Davis
03-12-2009, 02:36 PM
@Dale
Thats pretty interesting. I don't know of anyone else working on Linux. What machine are you using? What NLE?
- am mad curious
J
h-munster
03-13-2009, 11:39 AM
What machine are you using? What NLE?
J,
I have an AMD64 dual 4000Mhz, with a Gigabyte GA-M57SLI-S4 motherboard, but the open-source software that I use is (or can be) compiled to run on almost any hardware.
I am not an editor, but I happen to have five open-source NLEs on my hard drive. Right now, I am trying to encode files for the Final Cut Pro timeline.
I spoke a little too soon about mencoder's detc pulldown removal filter. It worked perfectly on my first two test files, but it gave duplicate frames on other footage. It seems that not only does Canon omit frame markers, but, also, it appears that my Canon camera doesn't consistently start the footage on the same frame in the 2:3 pulldown sequence. In addition, the first few frames are sometimes "B-frames." I think these latter two conditions sometime throw off the detc filter when the footage starts on an undesirable frame. My first two test files must have started on the ideal frame.
I have tried 3 other files with other mencoder pulldown removal filters and I have managed to get the pulldown cleanly removed. However, this means that I have to manually check each file beforehand to determine which pulldown filter will work. The process could be automated with scripts, but it would be better to tweak a single mencoder pulldown removal filter, to do the job for every Canon variation in the starting frames.
I will try to find the right mencoder filter and adjustements, but there are a lot of complex combinations of settings, and I am just a novice poking around with a trial-and-error method.
Of course, it would be great if Canon could just update the camera's firmware to give frame markers and/or consistently start on the same pulldown frame and/or not start with B-frames.
By the way, if you would like to try Linux, you don't need to install it on your machine -- you can use a Live CD. A Linux live CD runs the whole OS from your CD drive, so it doesn't touch your hard drive (unless you want it to). There are hundreds of distros (versions) you can try, some are geared for multimedia/production.
-Dale
h-munster
03-25-2009, 02:44 PM
Okay. I found a way to remove the 24P pulldown on all the AVCHD files generated by my Canon HF11.
Unfortunately, one has to play each file for about 10-15 seconds to determine on which frame it starts in the 3:2 pulldown cadence. Then one moves the file into a corresponding directory, before it can be batch encoded. Eventually, these two manual steps will probably be eliminated/automated.
The below procedure works for Linux, Unix and probably OSX, as long as the versions of mencoder and ffmpeg are recent. The process is simpler than it looks.
Enjoy!
-Dale
=============
PULLDOWN REMOVAL FOR CANON 24P AVCHD FOOTAGE, USING MENCODER AND FFMPEG IN LINUX/UNIX/OSX
WHEN SHOOTING:
- Upon pressing the camera's start button, swipe your hand side-to-side in front of the lens for one second, or pan back-and-forth for one second. This movement will make it much easier to determine which frame of the 3:2 pulldown cadence starts the file (especially when the subject is standing still).
PREPARE YOUR ENCODING DIRECTORIES:
- Put all of the AVCHD files into the desired directory for your project, and, in that directory, create five sub-directories labeled "0", "1", "2", "3" and "4".
DETERMINE EACH FILE'S STARTING FRAME AND MOVE THE FILES TO THEIR CORRESPONDING DIRECTORY:
- Open a terminal, and "CD" to the directory that contains the AVCHD files.
- To play an AVCHD file one-frame-at-a-time, use the command, "mplayer -demuxer lavf -vc ffh264 your_avchd_file.mts". Press the spacebar immediately after pressing "enter" on this mplayer command, which will pause the video on the first or second frame (you can see on which frame it stops). To advance one-frame-at-a-time, press the period (".") key. This method allows you to count through the cadence and determine on which frame the video starts. Once you get the hang of this procedure, it should take about 10-15 seconds to determine the starting frame.
- Here are the five different pulldown cadence patterns ("P"=progressive frame and "I"=interlaced frame):
PPPII -- starts on frame #0
PPIIP -- starts on frame #1
PIIPP -- starts on frame #2
IIPPP -- starts on frame #3
IPPPI -- starts on frame #4
- When you determine on which frame the file's 3:2 cadence starts, move that file to the corresponding sub-directory.
- Repeat this "starting-frame-discovery" procedure on each file, until all the files are moved to their corresponding directories.
- By the way, you could put all files starting on frames #0, #1 and #2 into one directory, because they use the same pulldown removal filter. However, it is probably good to keep each type of file in a separate directory, so that you can recover easily just in case you uniformly miscount/mis-designate every file in a directory (e.g. all the files you designated to be #1 are actually #3 files).
ENCODE THE FILES:
- Get the three mffpeger scripts: mffpeger012; mffpeger3; and mffpeger4. I have put them here: http://marks.org/avchd/mffpeger/
- In your terminal, "CD" to each subdirectory and use the corresponding mffpeger script (mffpeger012 for sub-directories "0", "1" and "2"; mffpeger3 for sub-directory "3"; and mffpeger4 for sub-directory "4").
- Because the mffpeger script is not interactive (it does not use switches/flags to change settings on the command line), it is probably best to put a copy of the script into each subdirectory and use that script, rather than running the script globally (for instance, from within /usr/local/bin). This way, changes to the settings can be made within the script, and they won't affect the script's use elsewhere. Of course, to use a script in the current directory, one merely types "./name_of_script" at the terminal prompt, and then presses "enter".
TO DO:
1. Find a way to adjust the settings on one of mencoder's fancy, pulldown removal filters, so that a single script can remove the pulldown on all of the files, regardless of the starting frame.
2. Make the script interactive, so that settings (such as frame rate, pulldown removal, file paths, deinterlacing, frame rates, etc.) can be specified on the command line.
3. Explore streaming raw video during encoding. It might be faster/better to pipe a raw video stream out of mencoder and into ffmpeg, but I am not sure how to do that. I have seen scripts that pipe a raw video stream from mplayer into ffmpeg, but this method seems to necessitate that the audio be encoded/copied on a separate pass.
4. Convert the mffpeger script to work in Windows.
I could definitely use some help with these tasks. I am a novice, so it will probably take a lot of time/effort for me to find these command/script settings on my own, merely poking-around by trial-and-error.