<div dir="ltr">For encoding, yes, I don't need to worry copying from host to device. <div>For decoding, part of. In official example, they use <span style="font-size:12.800000190734863px">av_hwframe_transfer_</span><wbr style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">data to copy from device memory to host,  but nothing tricky. (in hw_decode.c and qsvdec.c)</span></div><div><br></div><div><span style="font-size:12.800000190734863px">The problem I have is how to do this: decode in gpu -> do some process for frames in gpu -> encode in gpu, only copy to device at start and copy from in the end. There's no example to wrap raw device pointer to a hardware av_frame.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 3, 2017 at 12:01 PM, From Seattle <span dir="ltr"><<a href="mailto:fromseattle@gmail.com" target="_blank">fromseattle@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">So if you use h264_nvenc as codec, you don't have to worry about copying to/from gpu memory? The encoding and decoding will be done on hardware?</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 2, 2017 at 7:47 PM, Shu Wang <span dir="ltr"><<a href="mailto:halfelf.ronin@gmail.com" target="_blank">halfelf.ronin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm using nvenc to encode h264. If reading frame from host memory, it's nothing special from libx264. <div><br></div><div>But there is another problem I'd like to ask help here.</div><div>I don't know how to create a hw av_frame directly from device memory. </div><div>For example, hw decoding usually output a hw av_frame, which usually following av_hwframe_transfer_<wbr>data to copy it back. What if I want to encoding it in device memory directly?</div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-1379454083010565571h5">On Fri, Nov 3, 2017 at 7:33 AM, From Seattle <span dir="ltr"><<a href="mailto:fromseattle@gmail.com" target="_blank">fromseattle@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-1379454083010565571h5"><div dir="ltr">Hi Everyone,<div><br></div><div>Can anyone provide an example of encoding use hardware? In the examples come along with ffmpeg, there is only hw_decode.cpp, I wish there is a similar one like hw_encode.cpp.</div><div><br></div><div>Really appreciated.</div><div><br></div><div>Frank.</div></div>
<br></div></div>______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/list<wbr>info/libav-user</a><br>
<br></blockquote></div><br>
</div></div>
<br>______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/list<wbr>info/libav-user</a><br>
<br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Shu. Wang @ Bestminr<br><a href="http://halfelf.me" target="_blank">http://halfelf.me</a></div></div>
</div>