goto cleanup;
}
/* get a pointer to the codec context for the video stream */
input_codec_ctx = input_format_ctx->streams[video_index]->codec;
goto cleanup;
}
/* get a pointer to the codec context for the video stream */
input_codec_ctx = input_format_ctx->streams[video_index]->codec;
/* find the decoder for the video stream */
input_codec = avcodec_find_decoder(input_codec_ctx->codec_id);
if (input_codec == NULL) {
fprintf(stderr, "input_codec is NULL!\n");
/* find the decoder for the video stream */
input_codec = avcodec_find_decoder(input_codec_ctx->codec_id);
if (input_codec == NULL) {
fprintf(stderr, "input_codec is NULL!\n");
ret = avcodec_open2(input_codec_ctx, input_codec, NULL);
if (ret < 0) {
fprintf(stderr, "cannot open input codec\n");
ret = avcodec_open2(input_codec_ctx, input_codec, NULL);
if (ret < 0) {
fprintf(stderr, "cannot open input codec\n");
output_codec = avcodec_find_encoder(output_codec_ctx->codec_id);
if (output_codec == NULL) {
fprintf(stderr, "cannot find output codec!\n");
output_codec = avcodec_find_encoder(output_codec_ctx->codec_id);
if (output_codec == NULL) {
fprintf(stderr, "cannot find output codec!\n");