From: John F. <jo...@us...> - 2010-08-23 16:52:50
|
Update of /cvsroot/ingex/ingex/studio/common In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15304 Modified Files: ffmpeg_encoder_av.cpp Log Message: Fix mov timecode track in some formats. Index: ffmpeg_encoder_av.cpp =================================================================== RCS file: /cvsroot/ingex/ingex/studio/common/ffmpeg_encoder_av.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ffmpeg_encoder_av.cpp 12 Aug 2010 16:32:44 -0000 1.5 --- ffmpeg_encoder_av.cpp 23 Aug 2010 16:52:42 -0000 1.6 *************** *** 31,34 **** --- 31,35 ---- #define __STDC_CONSTANT_MACROS + #define __STDC_FORMAT_MACROS #include <inttypes.h> *************** *** 107,111 **** { ! int init_video_xdcam(internal_ffmpeg_encoder_t * enc) { AVCodecContext * codec_context; --- 108,112 ---- { ! int init_video_xdcam(internal_ffmpeg_encoder_t * enc, int64_t start_tc) { AVCodecContext * codec_context; *************** *** 152,156 **** ! avcodec_set_dimensions(codec_context,width,height); // some formats want stream headers to be seperate --- 153,160 ---- ! avcodec_set_dimensions(codec_context,width,height); ! ! /* Setting this non-zero gives us a timecode track in MOV format */ ! codec_context->timecode_frame_start = start_tc; // some formats want stream headers to be seperate *************** *** 274,278 **** /* initialise video stream for MPEG-4 encoding */ ! int init_video_mpeg4(internal_ffmpeg_encoder_t * enc) { AVCodecContext * codec_context = enc->video_st->codec; --- 278,282 ---- /* initialise video stream for MPEG-4 encoding */ ! int init_video_mpeg4(internal_ffmpeg_encoder_t * enc, int64_t start_tc) { AVCodecContext * codec_context = enc->video_st->codec; *************** *** 292,295 **** --- 296,302 ---- codec_context->bit_rate = kbit_rate * 1000; + /* Setting this non-zero gives us a timecode track in MOV format */ + codec_context->timecode_frame_start = start_tc; + // some formats want stream headers to be seperate *************** *** 381,385 **** avcodec_set_dimensions(codec_context, width, height); ! /* Setting this gives us a timecode track in MOV format */ codec_context->timecode_frame_start = start_tc; --- 388,392 ---- avcodec_set_dimensions(codec_context, width, height); ! /* Setting this non-zero gives us a timecode track in MOV format */ codec_context->timecode_frame_start = start_tc; *************** *** 904,908 **** break; case MaterialResolution::MPEG4_MOV: ! init_video_mpeg4(enc); break; case MaterialResolution::DV25_MOV: --- 911,915 ---- break; case MaterialResolution::MPEG4_MOV: ! init_video_mpeg4(enc, start_tc); break; case MaterialResolution::DV25_MOV: *************** *** 912,916 **** break; case MaterialResolution::XDCAMHD422_MOV: ! init_video_xdcam(enc); break; default: --- 919,923 ---- break; case MaterialResolution::XDCAMHD422_MOV: ! init_video_xdcam(enc, start_tc); break; default: |