Hello there, I'm trying to code a simple transcoder that replicates (almost the same behavior) as this command line:
ffmpeg -i input.mp4 -c:v libx264 -x264-params keyint=60:min-keyint=60:no-scenecut=1 -c:a copy output.mp4 In order to implement this code I used two examples I found: - https://ffmpeg.org/doxygen/trunk/transcoding_8c-example.html - https://ffmpeg.org/doxygen/trunk/encode_video_8c-example.html When I try to run my transcoder it doesn't produce the output and also shows this logging message: [libx264 @ 0x7fd99e801200] Input picture width (1920) is greater than stride (0) Am I missing something? *The entire code, how to compile it and run it.* https://github.com/leandromoreira/ffmpeg-libav-tutorial/blob/transcoding/2_transcoding.c <https://github.com/leandromoreira/ffmpeg-libav-tutorial/blob/transcoding/2_transcoding.ccat> gcc -g -Wall -o transcoding -lavformat -lavcodec -lswscale -lz 2_transcoding.c \ && ./transcoding small_bunny_1080p_60fps.mp4 bunny_1s_gop.mp4 *A summary of my code:* // a simple transcode context typedef struct TrancodeContext { char *file_name; AVFormatContext *format_context; int audio_stream_index; int video_stream_index; AVStream *stream[2]; AVCodec *codec[2]; AVCodecContext *codec_context[2]; } TranscodeContext; //I use two context TranscodeContext *decoder = malloc(sizeof(TranscodeContext)); TranscodeContext *encoder = malloc(sizeof(TranscodeContext)); prepare_input(decoder); prepare_output(decoder, encoder); // decoding while (av_read_frame(decoder->format_context, i_packet) >= 0) { decode_packet(); encode_frame(); }
_______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
