diff mencoder.c @ 12334:eeddcef4fb08

"hard" frame duplication for mencoder. this finally makes it possible to generate valid mpeg output from avi's that have duplicate frames in them, or when using inverse telecine filters. to use it, put the "harddup" filter at the end of your filter chain.
author rfelker
date Wed, 28 Apr 2004 04:02:46 +0000
parents e7c8200ffdc5
children 6f1b4c989914
line wrap: on
line diff
--- a/mencoder.c	Wed Apr 28 03:19:35 2004 +0000
+++ b/mencoder.c	Wed Apr 28 04:02:46 2004 +0000
@@ -189,6 +189,7 @@
 #endif
 
 int auto_expand=1;
+int encode_duplicates=1;
 
 // infos are empty by default
 char *info_name=NULL;
@@ -1312,7 +1313,8 @@
 	if(file_format != DEMUXER_TYPE_TV && !verbose) printf(MSGTR_DuplicateFrames,-skip_flag);
     while(skip_flag<0){
 	duplicatedframes++;
-	muxer_write_chunk(mux_v,0,0);
+	if (!encode_duplicates || vf_next_control(sh_video->vfilter, VFCTRL_DUPLICATE_FRAME, 0) != CONTROL_TRUE)
+	    muxer_write_chunk(mux_v,0,0);
 	++skip_flag;
     }
 } else