- /* get a pointer to the codec context for the video stream */
- input_codec_ctx = input_format_ctx->streams[video_index]->codec;
- if (input_codec_ctx == NULL) {
- fprintf(stderr, "input codec context is not valid\n");
- ret = -ENOTSUP;
- goto cleanup;
- }
+ /* get a pointer to the codec parameters for the video stream */
+ input_codec_params = input_format_ctx->streams[video_index]->codecpar;