On Thursday 05 October 2006 01:10, Matt Pfingsten wrote:
> I recently shot a film on a Panasonic AG-DV100B miniDV camera at 24p.
> Since NTSC (I'm in the U.S.) is 29.97fps, it is my understanding that
> the DVX100 uses a pulldown of 2:3:3:2 in order to make it possible to
> revert to the native 24p frames and edit that in post. The fourth
> paragraph of this Wikipedia article explains it better than I can: <
> http://en.wikipedia.org/wiki/24p>.

Just to be clear, you shot it in 24P advanced, not regular 24P, right? 
That's what gives you the 2:3:3:2 pulldown.

> My questions are:
>
> 1) Can I convert back to the native 24p frames using Cinelerra?

Not in any way that will be useful, AFAIK.

> 2) Will Inverse Telecine work for this even though it is a
> non-standard pull down scheme?

Don't think so.

> 3) Can I take something, say 3D animation, that has been rendered at
> 24fps, and covert it to this pull-down scheme?

Don't know of a way to do this either. The 2:3:3:2 pulldown scheme just 
isn't considered in Cinelerra.

What I do is just remove the 2:3:3:2 when downloading the video from the 
camera, and then edit in Cinelerra at 24P. I do this using dvgrab, 
which I have patched to discard the interlaced "C" frame.

Attached is a patch to dvgrab 1.8 which will let you do this. It only 
works if you write the video to a Quicktime (mov) container, since the 
native DV format can't handle 24fps as a frame rate. Use it with the 
following options:

dvgrab --remove2332 --filmrate --format qt

Apply --autosplit and other options as usual.

I've used it pretty successfully, but my clips are only around 5 minutes 
in length, so testing has not been extensive. AV seems to be in sync 
and you should not see any interlacing at all. Let me know how it works 
for you.

-Joe





diff -Pru dvgrab-1.8/dvgrab.cc dvgrab-1.8.new/dvgrab.cc
--- dvgrab-1.8/dvgrab.cc	2005-02-07 15:59:26.000000000 -0500
+++ dvgrab-1.8.new/dvgrab.cc	2006-01-01 19:38:09.000000000 -0500
@@ -56,7 +56,8 @@
 
 DVgrab::DVgrab( int argc, char *argv[] ) :
 		m_port( -1 ), m_node( -1 ), m_reader_active( false ), m_autosplit( false ),
-		m_timestamp( false ), m_channel( 63 ), m_frame_count( 0 ), m_max_file_size( 1000 ),
+		m_timestamp( false ), m_channel( 63 ), m_frame_count( 0 ), m_remove2332( false ), 
+		m_max_file_size( 1000 ), m_filmrate( false ),
                 m_sizesplitmode ( 0 ), m_collection_size( 0 ), m_collection_min_cut_file_size( 1 ), 
 		m_file_format( AVI_DV2_FORMAT ), m_open_dml( false ), m_frame_every( 1 ),
 		m_dv1394( NULL ), m_jpeg_quality( 75 ),
@@ -165,6 +166,14 @@
 		{
 			m_timestamp = true;
 		}
+		else if ( strcmp( "--remove2332", argv[ i ] ) == 0 )
+		{
+			m_remove2332 = true;
+		}
+		else if ( strcmp( "--filmrate", argv[ i ] ) == 0 )
+		{
+			m_filmrate = true;
+		}
 		else if ( strcmp( "--timesys", argv[ i ] ) == 0 )
 		{
 			m_timesys = true;
@@ -367,6 +376,8 @@
 			fprintf( stderr, "  --noavc           disable use of AV/C VTR control\n" );
 			fprintf( stderr, "  --autosplit       start a new file when a new recording is detected\n" );
 			fprintf( stderr, "  --timestamp       put the date and time of recording into the file name.\n" );
+			fprintf( stderr, "  --remove2332      remove 2:3:3:2 pulldown (QT mode only)\n" );
+			fprintf( stderr, "  --filmrate        use 24 fps as output rate in QT file\n" );
 			fprintf( stderr, "  --timesys         put the system date and time into the file name.\n" );
 			fprintf( stderr, "  --format dv1      save as a 'Type 1' DV AVI file. %s\n", m_file_format == AVI_DV1_FORMAT ? "This is the default." : " " );
 			fprintf( stderr, "           dv2      save as a 'Type 2' DV AVI file. %s\n", m_file_format == AVI_DV2_FORMAT ? "This is the default." : " " );
@@ -471,6 +482,8 @@
 #ifdef HAVE_LIBQUICKTIME
 		case QT_FORMAT:
 			m_writer = new QtHandler();
+			m_writer->SetFilmRate( m_filmrate );
+			m_writer->SetRemove2332( m_remove2332 );
 			break;
 #endif
 
@@ -483,6 +496,7 @@
 
 		}
 		m_writer->SetTimeStamp( m_timestamp );
+		m_writer->SetTimeStamp( m_timestamp );
 		m_writer->SetTimeSys( m_timesys );
 		m_writer->SetBaseName( m_dst_file_name );
 		m_writer->SetMaxFrameCount( m_frame_count );
diff -Pru dvgrab-1.8/dvgrab.h dvgrab-1.8.new/dvgrab.h
--- dvgrab-1.8/dvgrab.h	2004-12-11 01:00:25.000000000 -0500
+++ dvgrab-1.8.new/dvgrab.h	2006-01-01 19:35:34.000000000 -0500
@@ -47,6 +47,8 @@
 	char *m_dst_file_name;
 	int m_autosplit;
 	int m_timestamp;
+	int m_remove2332;
+	int m_filmrate;
 	int m_channel;
 	int m_frame_count;
 	int m_max_file_size;
diff -Pru dvgrab-1.8/filehandler.cc dvgrab-1.8.new/filehandler.cc
--- dvgrab-1.8/filehandler.cc	2005-02-07 15:56:50.000000000 -0500
+++ dvgrab-1.8.new/filehandler.cc	2006-01-01 19:46:59.000000000 -0500
@@ -50,6 +50,8 @@
 #include "frame.h"
 #include "affine.h"
 
+static int frameOffset = 3; // The interlaced "C" frame
+
 FileTracker *FileTracker::instance = NULL;
 
 FileTracker::FileTracker( ) : mode( CAPTURE_MOVIE_APPEND )
@@ -222,6 +224,15 @@
 	timeStamp = flag;
 }
 
+void FileHandler::SetFilmRate( bool flag)
+{
+	filmRate = flag;
+}
+
+void FileHandler::SetRemove2332( bool flag)
+{
+	remove2332 = flag;
+}
 
 void FileHandler::SetTimeSys( bool flag )
 {
@@ -372,7 +383,6 @@
 	}
 
 	/* write frame */
-
 	if ( framesToSkip == 0 )
 	{
 		if ( 0 > Write( frame ) )
@@ -384,7 +394,6 @@
 		++framesWritten;
 	}
 	framesToSkip--;
-
 	/* If the frame count is exceeded, close the current file.
 	   If the autosplit flag is set, a new file will be created in the next iteration.
 	   If the flag is not set, we are done. */
@@ -778,6 +787,9 @@
 
 int QtHandler::Write( Frame& frame )
 {
+	int result;
+	TimeCode tc;
+
 	if ( ! isFullyInitialized )
 	{
 		AudioInfo audio;
@@ -794,9 +806,16 @@
 			channels = 0;
 		}
 
-		quicktime_set_video( fd, 1, 720, frame.IsPAL() ? 576 : 480,
-		                     frame.GetFrameRate(), QUICKTIME_DV );
-
+		if ((filmRate) || (remove2332))
+		{
+			quicktime_set_video( fd, 1, 720, 480,
+		                     24, QUICKTIME_DV );
+		}
+		else
+		{
+			quicktime_set_video( fd, 1, 720, frame.IsPAL() ? 576 : 480,
+				frame.GetFrameRate(), QUICKTIME_DV );
+		}
 		if ( channels > 0 )
 		{
 			audioBuffer = new int16_t[ DV_AUDIO_MAX_SAMPLES * channels ];
@@ -822,8 +841,26 @@
 		isFullyInitialized = true;
 	}
 
-	int result = quicktime_write_frame( fd, const_cast<unsigned char*>( frame.data ),
-	                                    frame.GetFrameSize(), 0 );
+	if (remove2332)
+	{
+        	frame.GetTimeCode(tc);
+	
+		if ((tc.frame+frameOffset) % 5) 
+		{
+			result = quicktime_write_frame( fd, const_cast<unsigned char*>( frame.data ),
+	                                   frame.GetFrameSize(), 0 );
+		}
+		else
+		{
+			result = 1;
+			//fprintf(stderr, "Dropping frame %d\n", tc.frame);
+		}
+	}
+	else
+	{
+		       result = quicktime_write_frame( fd, const_cast<unsigned char*>( frame.data ),
+		                          frame.GetFrameSize(), 0 );
+	}
 
 	if ( channels > 0 )
 	{
diff -Pru dvgrab-1.8/filehandler.h dvgrab-1.8.new/filehandler.h
--- dvgrab-1.8/filehandler.h	2004-07-21 22:25:14.000000000 -0400
+++ dvgrab-1.8.new/filehandler.h	2006-01-01 19:40:12.000000000 -0500
@@ -84,6 +84,8 @@
 
 	virtual void SetAutoSplit( bool );
 	virtual void SetTimeStamp( bool );
+	virtual void SetFilmRate( bool );
+	virtual void SetRemove2332( bool );
 	virtual void SetTimeSys( bool );
 	virtual void SetBaseName( const string& base );
 	virtual void SetMaxFrameCount( int );
@@ -125,6 +127,8 @@
 	bool done;
 	bool autoSplit;
 	bool timeStamp;
+	bool filmRate;
+	bool remove2332;
 	bool timeSys;
 	int maxFrameCount;
 	int framesWritten;

Reply via email to