don't write non-frames
This commit is contained in:
parent
f2efc80f22
commit
84c901a01b
|
@ -429,8 +429,8 @@ void Event::AddFramesInternal( int n_frames, int start_frame, Image **images, st
|
|||
|
||||
void Event::AddPacket( ZMPacket *packet, int score, Image *alarm_image ) {
|
||||
|
||||
if ( videoStore ) {
|
||||
have_video_keyframe = have_video_keyframe || ( packet->codec_type == AVMEDIA_TYPE_VIDEO && ( packet->packet.flags & AV_PKT_FLAG_KEY ) );
|
||||
if ( videoStore ) {
|
||||
if ( have_video_keyframe ) {
|
||||
videoStore->writePacket( packet );
|
||||
} else {
|
||||
|
@ -438,7 +438,7 @@ void Event::AddPacket( ZMPacket *packet, int score, Image *alarm_image ) {
|
|||
}
|
||||
//FIXME if it fails, we should write a jpeg
|
||||
}
|
||||
if ( packet->codec_type == AVMEDIA_TYPE_VIDEO ) {
|
||||
if ( have_video_keyframe && ( packet->codec_type == AVMEDIA_TYPE_VIDEO ) ) {
|
||||
AddFrame( packet->image, *packet->timestamp, score, alarm_image );
|
||||
} // end if is video
|
||||
return;
|
||||
|
|
|
@ -786,6 +786,7 @@ bool VideoStore::setup_resampler() {
|
|||
return false;
|
||||
}
|
||||
#endif
|
||||
audio_out_stream->time_base = (AVRational){1, audio_out_ctx->sample_rate};
|
||||
|
||||
AVDictionary *opts = NULL;
|
||||
av_dict_set(&opts, "strict", "experimental", 0); // Needed to allow AAC
|
||||
|
|
Loading…
Reference in New Issue