<div dir="ltr"><div><div>Based on the encode_video.c example, I started to work on a new version of the "classic" output-example.c using no deprecated functions. <br></div><div>Here is the source code:<br></div><div><a href="https://github.com/xtingray/ffmpeg/blob/master/output-example.c">https://github.com/xtingray/ffmpeg/blob/master/output-example.c</a></div><div><br></div>This is the compilation line I am using:</div><div><span style="font-family:monospace"> gcc output-example.c -o test -L/usr/local/ffmpeg/lib -lavformat -lavcodec -lavutil</span><br></div><div><br></div><div>Now, when I try to execute it, I use these lines:<br></div><div><span style="font-family:monospace"> export LD_LIBRARY_PATH=/usr/local/ffmpeg/lib:$LD_LIBRARY_PATH<br> ./test test.mp4 libxh264</span><br></div><div><br></div><div>Getting this output:</div><div><span style="font-family:monospace"> create_video_file() - Tracing...<br> create_video_file() - codec id -> 27<br> add_video_stream() - Tracing...<br> Output #0, mp4, to 'test.mp4':<br> Stream #0:0: Unknown: none (libx264)<br> open_video_stream() - Tracing...<br> [libx264 @ 0x55890aeebc00] [IMGUTILS @ 0x7ffd3de293c0] <b>Picture size 0x0 is invalid</b><br> [libx264 @ 0x55890aeebc00] Ignoring invalid width/height values<br> [libx264 @ 0x55890aeebc00] [IMGUTILS @ 0x7ffd3de293a0] <b>Picture size 0x0 is invalid</b><br> [libx264 @ 0x55890aeebc00] Codec type or id mismatches<br> open_video_stream() - <b>Could not open input codec (error 'Invalid argument').</b><br> create_video_file() - <b>Could not initialize video codec.</b></span><br></div><div><br></div><div>I have been trying to find out if the problem is about some environment setting that I am missing, or if it is related to the source code directly.</div><div>So, I appreciate it if someone helps me to fix the example to make it usable. In fact, I would love to make it part of the FFmpeg examples package as I am aware it will be useful for beginners. <br></div><div><br></div><div>Any hint is very welcome.<br></div><div><br></div><div><br></div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 26, 2020 at 10:54 PM Gustav González <<a href="mailto:xtingray@gmail.com">xtingray@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>That's exactly the point where I started my research. There is interesting stuff there, but as I mentioned in the first message, all the examples start assuming an input file.</div><div>For example, I want to learn how to set the key parameters of an AVCodecParameters variable manually, so I can copy it into an AvContextCodec variable.</div><div>The "from scratch" approach is the missing point in the current examples.<br></div><div><br></div><div>PS: The encode_video.c has the potential to introduce several concepts, but it doesn't use any AVStream component, so it's still incomplete from the "educational" approach.<br></div><div><br></div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 26, 2020 at 10:01 PM Leandro Moreira <<a href="mailto:leandro.ribeiro.moreira@gmail.com" target="_blank">leandro.ribeiro.moreira@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">I think this is useful <a href="https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples" target="_blank">https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples</a></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 26, 2020, 11:49 PM Gustav González <<a href="mailto:xtingray@gmail.com" target="_blank">xtingray@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div>In the old versions of the ffmpeg source code, there was a nice example showing how to create a video file from scratch, setting the most important variables of its components.</div><div>This is it:<br></div><div><a href="https://github.com/rvs/ffmpeg/blob/master/libavformat/output-example.c" rel="noreferrer" target="_blank">https://github.com/rvs/ffmpeg/blob/master/libavformat/output-example.c</a></div><div><br></div><div>I just wonder if there is an updated version of it or some other reference I can use to create a video file using the same logic but calling the latest API methods, as much of them in the old example are already deprecated.</div><div><br></div><div>I have seen some comments in the documentation suggesting things like: "instead use this...", but the truth is the information is really vague. A working example as the one I referenced would be a great pedagogic tool. <br></div><div><br></div><div>Most of the "recent" examples take the parameters from an incoming (pre-existing) input file to run some kind of "operation" into an output file, but what if I want to create a video file from scratch? (i.e. from an image sequence)<br></div><div><br></div><div>Any advice/hint would be really appreciated. Thanks.<br></div><br><div dir="ltr"><div dir="ltr"><div>--<br> Gustav Gonzalez<br> <a href="mailto:xtingray@gmail.com" rel="noreferrer" target="_blank">xtingray@gmail.com</a><br><br></div></div></div></div>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" rel="noreferrer" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" rel="noreferrer" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".</blockquote></div>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div>--<br> Gustav Gonzalez<br> <a href="mailto:xtingray@gmail.com" target="_blank">xtingray@gmail.com</a><br><br></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>--<br> Gustav Gonzalez<br> <a href="mailto:xtingray@gmail.com" target="_blank">xtingray@gmail.com</a><br><br></div></div></div></div>