[Libav-user] Decoding a video stream with hevc_qsv

まゆ tokyo.march at icloud.com
Wed Dec 13 22:08:16 EET 2017


Hello,

 

I'm trying to decode a video stream with hevc_qsv.( h265->NV12 )

I succeeded to get a frame, however the frame has a block noise.

 

Now i dont understand why the noise occur.

 

decoding code is :

 

void qsv_decode(AVCodecContext *avctx, unsigned char *hevc_data /* size is more 32 byte than len */, int length)

{

              AVFrame *frame = NULL, *sw_frame = NULL;

              int ret = 0;

              int finish = 0;

 

              AVPacket packet;

 

              av_init_packet(&packet);

              ret = av_packet_from_data(&packet, hevc_data, length);

              if (ret < 0)

                            return ;

 

              while (ret >= 0 && finish == 0) {

                            ret = avcodec_send_packet(avctx, packet);

                            if (ret < 0)

                                          break;

 

                            if (!(frame = av_frame_alloc()) || !(sw_frame = av_frame_alloc()))

                                          break;

 

                            ret = avcodec_receive_frame(avctx, frame);

                            if (ret == AVERROR(EAGAIN) {

                                          av_frame_free(&frame);

                                          av_frame_free(&sw_frame);

                                          continue;

                            }

                            else if (ret < 0) {

                                          break;

                            }

 

                            ret = av_hwframe_transfer_data(sw_frame, frame, 0);

                            if (ret < 0)

                                          break;

 

                            finish = 1;

              }

 

              if (finish == 1)

              {

                            // set frame to image buffer

              }

 

              return ;

}

 

What am I missing out here, setting param to packet and so on ? (less buffer, fast timing...)

If you need any other information, please let me know.

 

Thanks in advance.

 
tanaka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20171213/5bb40895/attachment.html>


More information about the Libav-user mailing list