@@ -125,6 +125,23 @@ impl MP4Encoder {
125125 . as_id_ref ( ) ,
126126 ) ;
127127
128+ output_settings. insert (
129+ av:: video_settings_keys:: color_props ( ) ,
130+ ns:: Dictionary :: with_keys_values (
131+ & [
132+ unsafe { AVVideoTransferFunctionKey } ,
133+ unsafe { AVVideoColorPrimariesKey } ,
134+ unsafe { AVVideoYCbCrMatrixKey } ,
135+ ] ,
136+ & [
137+ unsafe { AVVideoTransferFunction_ITU_R_709_2 } ,
138+ unsafe { AVVideoColorPrimaries_ITU_R_709_2 } ,
139+ unsafe { AVVideoYCbCrMatrix_ITU_R_709_2 } ,
140+ ] ,
141+ )
142+ . as_id_ref ( ) ,
143+ ) ;
144+
128145 let mut video_input = av:: AssetWriterInput :: with_media_type_and_output_settings (
129146 av:: MediaType :: video ( ) ,
130147 Some ( output_settings. as_ref ( ) ) ,
@@ -370,7 +387,14 @@ impl Drop for MP4Encoder {
370387
371388#[ link( name = "AVFoundation" , kind = "framework" ) ]
372389unsafe extern "C" {
373- static AVVideoAverageBitRateKey : & ' static cidre:: ns:: String ;
390+ static AVVideoAverageBitRateKey : & ' static ns:: String ;
391+ static AVVideoTransferFunctionKey : & ' static ns:: String ;
392+ static AVVideoColorPrimariesKey : & ' static ns:: String ;
393+ static AVVideoYCbCrMatrixKey : & ' static ns:: String ;
394+
395+ static AVVideoTransferFunction_ITU_R_709_2 : & ' static cidre:: ns:: String ;
396+ static AVVideoColorPrimaries_ITU_R_709_2 : & ' static cidre:: ns:: String ;
397+ static AVVideoYCbCrMatrix_ITU_R_709_2 : & ' static cidre:: ns:: String ;
374398}
375399
376400unsafe fn result_unchecked < T , R > ( op : impl FnOnce ( & mut Option < T > ) -> R ) -> cidre:: os:: Result < T >
0 commit comments