mirror of
				https://github.com/nyanmisaka/ffmpeg-rockchip.git
				synced 2025-10-31 12:36:41 +08:00 
			
		
		
		
	ffmpeg: Support preserving the source key frame timings
Added option "source" to force_key_frames
This commit is contained in:
		 anatolschwarz
					anatolschwarz
				
			
				
					committed by
					
						 Michael Niedermayer
						Michael Niedermayer
					
				
			
			
				
	
			
			
			 Michael Niedermayer
						Michael Niedermayer
					
				
			
						parent
						
							3a91a07f15
						
					
				
				
					commit
					77cc0d5b59
				
			
							
								
								
									
										9
									
								
								ffmpeg.c
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								ffmpeg.c
									
									
									
									
									
								
							| @@ -1104,6 +1104,10 @@ static void do_video_out(AVFormatContext *s, | ||||
|             } | ||||
|  | ||||
|             ost->forced_keyframes_expr_const_values[FKF_N] += 1; | ||||
|         } else if (   ost->forced_keyframes | ||||
|                    && !strncmp(ost->forced_keyframes, "source", 6) | ||||
|                    && in_picture->key_frame==1) { | ||||
|             forced_keyframe = 1; | ||||
|         } | ||||
|  | ||||
|         if (forced_keyframe) { | ||||
| @@ -2942,7 +2946,10 @@ static int transcode_init(void) | ||||
|                         ost->forced_keyframes_expr_const_values[FKF_N_FORCED] = 0; | ||||
|                         ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N] = NAN; | ||||
|                         ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T] = NAN; | ||||
|                     } else { | ||||
|  | ||||
|                         // Don't parse the 'forced_keyframes' in case of 'keep-source-keyframes', | ||||
|                         // parse it only for static kf timings | ||||
|                     } else if(strncmp(ost->forced_keyframes, "source", 6)) { | ||||
|                         parse_forced_key_frames(ost->forced_keyframes, ost, ost->enc_ctx); | ||||
|                     } | ||||
|                 } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user