diff mbox

[FFmpeg-devel] avcodec/qsvenc Question for Intel QSV low latency

Message ID CANy4d5BdOq=FWo7RGRa6Yg2kCAQ4vUfvzpx57fYDxYo7aqVQ8Q@mail.gmail.com
State New
Headers show

Commit Message

Natsuki Kai Nov. 13, 2017, 5:13 a.m. UTC
Oh sorry, I don't understand how to do well yet...
I'll try again.
Thank you guys.

     if (!q->async_fifo)
         return AVERROR(ENOMEM);



On Mon, Nov 13, 2017 at 1:13 AM, Michael Niedermayer <michael@niedermayer.cc
> wrote:

> On Sun, Nov 12, 2017 at 11:40:57AM +0900, Natsuki Kai wrote:
> > Hello guys,
> >
> > this is my first posting to ffmpeg-devel, and I believe my mail format is
> > correct.
> >
> > I'm using ffmpeg for encoding video in real-time, so low encode delay is
> > needed.
> > Once I call "avcodec_send_frame(avctx, frame)", I'd like to get the
> encoded
> > data from "avcodec_receive_packet(avctx, avpkt)".
> >
> > However I cannot do that in ffmpeg and Intel QSV (qsv),
> > "avcodec_receive_packet()" returns nothing when I input the first frame
> to
> > qsv encoder by calling "avcodec_send_frame()".
> > Of cource, after second frame inputs, qsv encoder returns valid data.
> > I'd like to get a valid data from first calling.
> >
> > I've tried some cases and as a result, my requirement is satisfied when
> > avcodec/qsvenc.c will be fixed like below diff info.
> > Then I have a question.
> > Why q->async_fifo is set to be q->async_depth "+ 1"?
> > Anybody knows?
> >
> > --- a/avcodec/qsvenc.c
> > +++ b/avcodec/qsvenc.c
> > @@ -803,7 +803,7 @@
> >
> >      q->param.AsyncDepth = q->async_depth;
> >
> > -    q->async_fifo = av_fifo_alloc((1 + q->async_depth) *
> > +    q->async_fifo = av_fifo_alloc((q->async_depth) *
> >                                    (sizeof(AVPacket) +
> > sizeof(mfxSyncPoint*) + sizeof(mfxBitstream*)));
> >      if (!q->async_fifo)
> >          return AVERROR(ENOMEM);
>
> This looks corrupted by a newline
>
> Applying: avcodec/qsvenc Question for Intel QSV low latency
> error: corrupt patch at line 10
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Those who are best at talking, realize last or never when they are wrong.
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>

Comments

Moritz Barsnick Nov. 13, 2017, 12:54 p.m. UTC | #1
On Mon, Nov 13, 2017 at 14:13:15 +0900, Natsuki Kai wrote:
> Oh sorry, I don't understand how to do well yet...
[...]
> -    q->async_fifo = av_fifo_alloc((1 + q->async_depth) *
> +    q->async_fifo = av_fifo_alloc((q->async_depth) *
>                                    (sizeof(AVPacket) +
> sizeof(mfxSyncPoint*) + sizeof(mfxBitstream*)));

Your mail tool or send chain is inserting linebreaks into the patch. It
will therefore not work anymore on the receiving side (as it is not
only visually inspected on the list, but also tested). You can either
send the patch with "git send-email", or attach it as a separate file.

Moritz
Natsuki Kai Nov. 14, 2017, 4:02 p.m. UTC | #2
Hi Moritz,

Thank you for explaining in details. It really helped me.
It seems gmail or other mail tool shouldn't be used, but only "git
send-email" is accepted.
I posted patch mail from git command.
http://ffmpeg.org/pipermail/ffmpeg-devel/2017-November/219805.html
So please discuss in that thread.

P.S.
I've been confused because "git send-email" doesn't work on windows PC...
Finally, I gave up working on windows and posted on Mac.

On Mon, Nov 13, 2017 at 9:54 PM, Moritz Barsnick <barsnick@gmx.net> wrote:
> On Mon, Nov 13, 2017 at 14:13:15 +0900, Natsuki Kai wrote:
>> Oh sorry, I don't understand how to do well yet...
> [...]
>> -    q->async_fifo = av_fifo_alloc((1 + q->async_depth) *
>> +    q->async_fifo = av_fifo_alloc((q->async_depth) *
>>                                    (sizeof(AVPacket) +
>> sizeof(mfxSyncPoint*) + sizeof(mfxBitstream*)));
>
> Your mail tool or send chain is inserting linebreaks into the patch. It
> will therefore not work anymore on the receiving side (as it is not
> only visually inspected on the list, but also tested). You can either
> send the patch with "git send-email", or attach it as a separate file.
>
> Moritz
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Carl Eugen Hoyos Nov. 14, 2017, 10:55 p.m. UTC | #3
2017-11-14 17:02 GMT+01:00 Natsuki Kai <n.kai.cj.github@gmail.com>:
> Hi Moritz,
>
> Thank you for explaining in details. It really helped me.
> It seems gmail or other mail tool shouldn't be used, but only "git
> send-email" is accepted.

Just send your patch - made with git format-patch - as
attachment. This should work with all mail clients.

Carl Eugen
Natsuki Kai Nov. 19, 2017, 11:03 a.m. UTC | #4
I sent it as another thread, but yes it's ok.
Please check the attachment patch file.
Thank you.


On Wed, Nov 15, 2017 at 7:55 AM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
> 2017-11-14 17:02 GMT+01:00 Natsuki Kai <n.kai.cj.github@gmail.com>:
>> Hi Moritz,
>>
>> Thank you for explaining in details. It really helped me.
>> It seems gmail or other mail tool shouldn't be used, but only "git
>> send-email" is accepted.
>
> Just send your patch - made with git format-patch - as
> attachment. This should work with all mail clients.
>
> Carl Eugen
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
diff mbox

Patch

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 2bc19f5241..7d73c64dca 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -803,7 +803,7 @@  int ff_qsv_enc_init(AVCodecContext *avctx,
QSVEncContext *q)

     q->param.AsyncDepth = q->async_depth;

-    q->async_fifo = av_fifo_alloc((1 + q->async_depth) *
+    q->async_fifo = av_fifo_alloc((q->async_depth) *
                                   (sizeof(AVPacket) +
sizeof(mfxSyncPoint*) + sizeof(mfxBitstream*)));