<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi ffmpeg geeks,<br>
I'm newbie using the Libav APi. I've use ffmpeg several times for
converting video and audio files but rigt now I'm working on an APi
with Qt and C++ which need to integrate libavcodec and libavformat
for converting any video file to another format, mostly
OGG(Vorbis/Theora) video. So the main problem I got is that I don't
know how to do that. I've seen a lot of examples even the ffmpeg.c
source file but realy doesn't work for me. Maybe I miss understood
or maybe 'cause the examples are outdated and most of the functions
are deprecated.<br>
The function gets and input video file and must convert it to an
output video file (i.e: outVideo.avi, outVideo.mpeg, outVideo.ogv,
etc) ... so here is a piece of my code...<br>
<br>
AVPacket pkt;<br>
av_init_packet(&pkt);<br>
AVFrame * picture = avcodec_alloc_frame();<br>
int finishedFrames;<br>
int vframe, aframe = 0;<br>
<br>
while(av_read_frame(avInFormatCtx, &pkt) >= 0)<br>
{<br>
if(pkt.stream_index == videoStreamPos)<br>
{<br>
int outSize =
avcodec_decode_video2(videoDecoderCodecCtx, picture,
&finishedFrames, &pkt);<br>
printf("Bytes Decodificados: %d\n", outSize);<br>
<br>
if(finishedFrames)<br>
{<br>
vframe++;<br>
printf("Decoding VIDEO frame %d\n", vframe);<br>
int encodedVideo =
avcodec_encode_video(videoEncoderCodecCtx, frameBuffer,
finishedFrames, videoFrame);<br>
<br>
// What do I have to do with VIDEO here?<br>
}<br>
}<br>
<br>
if(pkt.stream_index == audioStreamPos)<br>
{<br>
aframe++;<br>
printf("PROCESSING AUDIO FRAME ...%d\n",
aframe);<br>
<br>
// What do I have to do with AUDIO here?<br>
}<br>
av_free_packet(&pkt);<br>
}<br>
Anyone could tell me what I got wrong or point me what I have to
do.<br>
Thanks in advance for any help or suggestion.<br>
<div class="moz-signature">-- <br>
<img src="cid:part1.05020102.01040802@art.jovenclub.cu" border="0"></div>
</body>
</html>