Re: [Libav-user] Decoding Problem (got_picture always return 0)

2012-03-22 Thread 吴沁凡
The incoming data received by the client can be an incomplete frame (or may be more than one frame, since the data is not organized as the same as you wrote at server end), so you can not decode it directly. Use function av_parser_parse2() first to get complete frame one by one from the incoming da

Re: [Libav-user] Decoding Problem (got_picture always return 0)

2012-03-23 Thread ZHAO Yinxia
Hi Qinfan, Thank you very much for your hints! I monitored the sending frames and the receiving frames, and they are the same. In fact, at the server end, I generate frames one by one, and encode it, then send it. Therefore, at the client end, they must be received one frame by one frame. So I th

Re: [Libav-user] Decoding Problem (got_picture always return 0)

2012-03-23 Thread ZHAO Yinxia
Hi, If i am right, got_picture_ptr should be zero in my case because i send one frame each time. While there are bad pointers in picture->data, do you have any idea? On Fri, Mar 23, 2012 at 10:36 AM, ZHAO Yinxia wrote: > Hi Qinfan, > > Thank you very much for your hints! > > I monitored the sen

Re: [Libav-user] Decoding Problem (got_picture always return 0)

2012-03-23 Thread huanggh0108
I guess the data may be audio frame, not video frame. The data should be filtered before sending at the server end. 2012-03-23 huanggh0108 发件人: Yinxia 发送时间: 2012-03-23 00:52:01 收件人: libav-user 抄送: 主题: [Libav-user] Decoding Problem (got_picture always return 0) Hi dear all, I am

Re: [Libav-user] Decoding Problem (got_picture always return 0)

2012-03-23 Thread ZHAO Yinxia
*收件人:* libav-user > *抄送:* > *主题:* [Libav-user] Decoding Problem (got_picture always return 0) > Hi dear all, > > I am a newbie to ffmpeg and I would like to decode the bitstream, which is > encoded using libx264 at the server end and sent to client frame by frame. > I wrote a f

Re: [Libav-user] Decoding Problem (got_picture always return 0)

2012-03-23 Thread Việt Hùng Nguyễn
frame, not video frame. The data should be >> filtered before sending at the server end. >> >> >> 2012-03-23 >> -- >> huanggh0108 >> ------ >> *发件人:* Yinxia >> *发送时间:* 2012-03-23 00:52:01 >>

Re: [Libav-user] Decoding Problem (got_picture always return 0)

2012-03-23 Thread Việt Hùng Nguyễn
d >>> be filtered before sending at the server end. >>> >>> >>> 2012-03-23 >>> ---------- >>> huanggh0108 >>> -- >>> *发件人:* Yinxia >>> *发送时间:* 2012-03-23 00:52:01 >>> *收件人:* libav-use

Re: [Libav-user] Decoding Problem (got_picture always return 0)

2012-03-23 Thread ZHAO Yinxia
Thank you Hung, Nguyen Viet , I've added these 32 bits headers, but it does not work. my program at server end is something like this: int saveFrame(void *ctx, unsigned char *pixels, int frameWidth, int frameHeight, unsigned char **out, int *len) { Ctx *c = (Ctx*)ctx; // convert RGB colorspace i

Re: [Libav-user] Decoding Problem (got_picture always return 0)

2012-03-23 Thread Việt Hùng Nguyễn
Hi, It seems you got some mistakes in your code. 1- In your conversion colour space code, not all stride is frameWidth. For YUV420p, stride for Cr, Cb is frameWidth/2 2- After you call x264_encoder_encode, you should call x264_nal_encode 3- When send data to ffmpeg h264 decoder, remember that is a

Re: [Libav-user] Decoding Problem (got_picture always return 0)

2012-03-26 Thread ZHAO Yinxia
Thank you very much sir! I solved my problems according to your suggestion! While I have to point out that: 1. for the four bytes header, it is automatically added if we set *param.b_annexb = 1*, and 0 while add the size of frame, so we don't need to add it manually. (Don't forget to set *param.b_