From 2a3683c0721ffd9246155dd8bd1f9c759d9bce30 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 7 Dec 2017 09:27:28 -0500 Subject: [PATCH] add some more debug --- src/zm_videostore.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp index 4685bc3d8..f66cf7e1d 100644 --- a/src/zm_videostore.cpp +++ b/src/zm_videostore.cpp @@ -152,12 +152,21 @@ Debug(2,"Using mjpeg"); video_out_ctx->pix_fmt = AV_PIX_FMT_YUVJ422P; } else if ( monitor->OutputCodec() == "h264" ) { +Debug(2,"Using h264"); video_out_codec = avcodec_find_encoder_by_name("h264_omx"); if ( ! video_out_codec ) { Debug(1, "Didn't find omx"); video_out_codec = avcodec_find_encoder(AV_CODEC_ID_H264); } - video_out_ctx = avcodec_alloc_context3( video_out_codec ); + if ( ! video_out_codec ) { + Error("Didn't find h264 encoder"); + video_out_codec = NULL; + return false; + } + video_out_ctx = avcodec_alloc_context3(video_out_codec); + } else { + Error("No output codec selected"); + return false; } // Copy params from instream to ctx