diff --git a/encoder/encoder.c b/encoder/encoder.c index 08a28bd..b88a2ca 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -1316,13 +1316,6 @@ int x264_encoder_headers( x264_t *h, x264_nal_t **pp_nal, int *pi_nal ) if( x264_nal_end( h ) ) return -1; - /* identify ourselves */ - x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE ); - if( x264_sei_version_write( h, &h->out.bs ) ) - return -1; - if( x264_nal_end( h ) ) - return -1; - frame_size = x264_encoder_encapsulate_nals( h, 0 ); /* now set output*/ @@ -2464,7 +2457,7 @@ int x264_encoder_encode( x264_t *h, /* buffering period sei is written in x264_encoder_frame_end */ - if( h->param.b_repeat_headers && h->fenc->i_frame == 0 ) + if( h->fenc->i_frame == 0 ) { /* identify ourself */ x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE ); diff --git a/output/flv.c b/output/flv.c index e441b6d..2a1ecb5 100644 --- a/output/flv.c +++ b/output/flv.c @@ -31,9 +31,6 @@ typedef struct { flv_buffer *c; - uint8_t *sei; - int sei_len; - int64_t i_fps_num; int64_t i_fps_den; int64_t i_framenum; @@ -156,18 +153,6 @@ static int write_headers( hnd_t handle, x264_nal_t *p_nal ) int sps_size = p_nal[0].i_payload; int pps_size = p_nal[1].i_payload; - int sei_size = p_nal[2].i_payload; - - // SEI - /* It is within the spec to write this as-is but for - * mplayer/ffmpeg playback this is deferred until before the first frame */ - - p_flv->sei = malloc( sei_size ); - if( !p_flv->sei ) - return -1; - p_flv->sei_len = sei_size; - - memcpy( p_flv->sei, p_nal[2].p_payload, sei_size ); // SPS uint8_t *sps = p_nal[0].p_payload + 4; @@ -204,7 +189,7 @@ static int write_headers( hnd_t handle, x264_nal_t *p_nal ) x264_put_be32( c, length + 11 ); // Last tag size CHECK( flv_flush_data( c ) ); - return sei_size + sps_size + pps_size; + return sps_size + pps_size; } static int write_frame( hnd_t handle, uint8_t *p_nalu, int i_size, x264_picture_t *p_picture ) @@ -248,12 +233,6 @@ static int write_frame( hnd_t handle, uint8_t *p_nalu, int i_size, x264_picture_ x264_put_byte( c, 1 ); // AVC NALU x264_put_be24( c, offset ); - if( p_flv->sei ) - { - flv_append_data( c, p_flv->sei, p_flv->sei_len ); - free( p_flv->sei ); - p_flv->sei = NULL; - } flv_append_data( c, p_nalu, i_size ); unsigned length = c->d_cur - p_flv->start; diff --git a/output/matroska.c b/output/matroska.c index 0304c84..10a5b08 100644 --- a/output/matroska.c +++ b/output/matroska.c @@ -109,11 +109,9 @@ static int write_headers( hnd_t handle, x264_nal_t *p_nal ) int sps_size = p_nal[0].i_payload - 4; int pps_size = p_nal[1].i_payload - 4; - int sei_size = p_nal[2].i_payload; uint8_t *sps = p_nal[0].p_payload + 4; uint8_t *pps = p_nal[1].p_payload + 4; - uint8_t *sei = p_nal[2].p_payload; int ret; uint8_t *avcC; @@ -155,18 +153,7 @@ static int write_headers( hnd_t handle, x264_nal_t *p_nal ) free( avcC ); - // SEI - - if( !p_mkv->b_writing_frame ) - { - if( mk_start_frame( p_mkv->w ) < 0 ) - return -1; - p_mkv->b_writing_frame = 1; - } - if( mk_add_frame_data( p_mkv->w, sei, sei_size ) < 0 ) - return -1; - - return sei_size + sps_size + pps_size; + return sps_size + pps_size; } static int write_frame( hnd_t handle, uint8_t *p_nalu, int i_size, x264_picture_t *p_picture ) diff --git a/output/mp4.c b/output/mp4.c index 0e3c2fc..0b3744b 100644 --- a/output/mp4.c +++ b/output/mp4.c @@ -235,11 +235,9 @@ static int write_headers( hnd_t handle, x264_nal_t *p_nal ) int sps_size = p_nal[0].i_payload - 4; int pps_size = p_nal[1].i_payload - 4; - int sei_size = p_nal[2].i_payload; uint8_t *sps = p_nal[0].p_payload + 4; uint8_t *pps = p_nal[1].p_payload + 4; - uint8_t *sei = p_nal[2].p_payload; // SPS @@ -270,12 +268,7 @@ static int write_headers( hnd_t handle, x264_nal_t *p_nal ) gf_list_add( p_mp4->p_config->pictureParameterSets, p_slot ); gf_isom_avc_config_update( p_mp4->p_file, p_mp4->i_track, 1, p_mp4->p_config ); - // SEI - - memcpy( p_mp4->p_sample->data + p_mp4->p_sample->dataLength, sei, sei_size ); - p_mp4->p_sample->dataLength += sei_size; - - return sei_size + sps_size + pps_size; + return sps_size + pps_size; } static int write_frame( hnd_t handle, uint8_t *p_nalu, int i_size, x264_picture_t *p_picture ) { diff --git a/output/raw.c b/output/raw.c index 02e4c56..5df93c5 100644 --- a/output/raw.c +++ b/output/raw.c @@ -40,7 +40,7 @@ static int set_param( hnd_t handle, x264_param_t *p_param ) static int write_headers( hnd_t handle, x264_nal_t *p_nal ) { - int size = p_nal[0].i_payload + p_nal[1].i_payload + p_nal[2].i_payload; + int size = p_nal[0].i_payload + p_nal[1].i_payload; if( fwrite( p_nal[0].p_payload, size, 1, (FILE*)handle ) ) return size;