<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:14pt"><div style="color: rgb(0, 0, 0); font-size: 18.6667px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Hi , I'm trying to encode raw frames to vp8. I use the example<br>which encode raw frames into a h264 file, I have use this example to encode a short<br>movie into an h264(without sound of course). Then I can see this h264 file with ffplay.<br>I think it should be posible to make the same but encode the file to vp8, and then see<br>this vp8 file with ffplay. Is it posible? Because I encode the file to vp8 but ffplay cant<br>encode it. Here is some of the code that I use to encode the raw frame:</div><div style="color: rgb(0, 0, 0); font-size: 18.6667px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div
style="color: rgb(0, 0, 0); font-size: 18.6667px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">AVCodec *output = avcodec_find_encoder((AVCodecID)AV_CODEC_ID_VP8);<br><br>AVCodecContext *contextOutput = avcodec_alloc_context3(output);<br><br>contextOutput->bit_rate = 500* 1000;<br>contextOutput->rc_min_rate = coutput->rc_max_rate = coutput->bit_rate;<br><br>av_opt_set_double(coutput->priv_data, "max-intra-rate", 90, 0);<br>av_opt_set(coutput->priv_data, "quality", "realtime", 0);<br> <br>contextOutput->thread_count = 4;<br>contextOutput->rc_buffer_aggressivity = 0.95;<br>contextOutput->rc_buffer_size = 500*1000*6;<br>contextOutput->profile = 3;<br>contextOutput->qmax = 54;<br>contextOutput->qmin = 4;<br> <br>AVRational myrational = {1,25};<br>contextOutput->time_base= myrational;<br>contextOutput->gop_size = 99999;<br>contextOutput->pix_fmt =
PIX_FMT_YUV420P; <br><br>contextOutput->width = 800;<br>contextOutput->height = 600;<br><br>if(avcodec_open2(contextOutput,output,NULL)<0)<br>{<br> printf("no putput codec open\n");<br> return -1;<br>}<br><br>then
with this AVCodecContext I try to encode the raw frame with the methode
avcodec_encode_video2. It works for h264 but not for vp8, any idea about this topic would be very helpfull.</div><div style="color: rgb(0, 0, 0); font-size: 18.6667px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 18.6667px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">thnx<br> </div><div style="color: rgb(0, 0, 0); font-size: 18.6667px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 18.6667px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 18.6667px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div
style="color: rgb(0, 0, 0); font-size: 18.6667px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 18.6667px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 18.6667px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 18.6667px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div></div></body></html>