<div dir="ltr">The error is to tell you to set the linesize of input frame/picture, which value is 0 and should be at least 1920 on y plane.<div><br></div><div>btw, your repo link is 404...</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 29, 2017 at 9:12 PM, Leandro Moreira <span dir="ltr"><<a href="mailto:leandro.ribeiro.moreira@gmail.com" target="_blank">leandro.ribeiro.moreira@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello there,</div><div><br></div><div>I'm trying to code a simple transcoder that replicates (almost the same behavior) as this command line:</div><div><br></div><div><font face="monospace">ffmpeg -i input.mp4 -c:v libx264 -x264-params keyint=60:min-keyint=60:no-<wbr>scenecut=1 -c:a copy output.mp4</font></div><div><br></div><div>In order to implement this code I used two examples I found:</div><div><ul><li><a href="https://ffmpeg.org/doxygen/trunk/transcoding_8c-example.html" target="_blank">https://ffmpeg.org/doxygen/<wbr>trunk/transcoding_8c-example.<wbr>html</a><br></li><li><a href="https://ffmpeg.org/doxygen/trunk/encode_video_8c-example.html" target="_blank">https://ffmpeg.org/doxygen/<wbr>trunk/encode_video_8c-example.<wbr>html</a></li></ul></div><div>When I try to run my transcoder it doesn't produce the output and also shows this logging message:</div><div><br></div><div><font face="monospace">[libx264 @ 0x7fd99e801200] Input picture width (1920) is greater than stride (0)</font><br></div><div><br></div><div>Am I missing something?</div><div><br></div><div><div><b>The entire code, how to compile it and run it.</b></div><div><br></div><div><a href="https://github.com/leandromoreira/ffmpeg-libav-tutorial/blob/transcoding/2_transcoding.ccat" target="_blank">https://github.com/<wbr>leandromoreira/ffmpeg-libav-<wbr>tutorial/blob/transcoding/2_<wbr>transcoding.c</a><br></div><div><br></div><div><div><font face="monospace">gcc -g -Wall -o transcoding -lavformat -lavcodec -lswscale -lz 2_transcoding.c \</font></div><div><font face="monospace"><span style="white-space:pre-wrap">     </span>  && ./transcoding small_bunny_1080p_60fps.mp4 bunny_1s_gop.mp4</font></div></div></div><div><br></div><div><b>A summary of my code:</b></div><div><br></div><div>// a simple transcode context</div><div><div>typedef struct TrancodeContext {</div><div>  char *file_name;</div><div>  AVFormatContext *format_context;</div><div><br></div><div>  int audio_stream_index;</div><div>  int video_stream_index;</div><div><br></div><div>  AVStream *stream[2];</div><div>  AVCodec *codec[2];</div><div>  AVCodecContext *codec_context[2];</div><div>} TranscodeContext;</div></div><div><br></div><div>//I use two context</div><div><div>TranscodeContext *decoder = malloc(sizeof(<wbr>TranscodeContext));</div><div>TranscodeContext *encoder = malloc(sizeof(<wbr>TranscodeContext));</div></div><div><br></div><div>prepare_input(decoder);</div><div>prepare_output(decoder, encoder);</div><div><br></div><div>// decoding</div><div><div>while (av_read_frame(decoder-><wbr>format_context, i_packet) >= 0) {</div><div><div>    decode_packet();</div></div><div>    encode_frame();</div><div>}</div></div><div><br></div><div><br></div><div><br></div></div>
<br>______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Shu. Wang @ Bestminr<br><a href="http://halfelf.me" target="_blank">http://halfelf.me</a></div></div>
</div>