[FFmpeg-user] 4K 60Hz Directshow Video Capture

Alex P alex.p at avenview.com
Mon Feb 26 18:22:57 EET 2018


Thank you for the testing James, it was really helpful and I think my issue might ultimately be a hard drive bandwidth limitation.

With 
ffmpeg -f dshow -video_size 3840x2160 -framerate 60000/1001 -rtbufsize 2100000000 -pixel_format bgr24 -i video="MZ0380 PCI, Analog 01 Capture" -c:v rawvideo -f null -

I was able to get 1x speeds but running the following  on an 10GB RAM disk only gets me around .3x
ffmpeg -f dshow -video_size 3840x2160 -framerate 60000/1001 -rtbufsize 2100000000 -pixel_format bgr24 -i video="MZ0380 PCI, Analog 01 Capture" -c:v rawvideo out.nut

Full 4K60 raw video should be 12gbps. This is 1.5GB/s. Running CrystalDiskMark gets me the attached results. In sequential reads and writes, it seems like my disk should be fast enough. But the other tests indicate otherwise.
Does anyone know what kind of hard drive test would best simulate what I'm doing? Could it be overhead from Windows writing the file? 

ffmpeg -f dshow -video_size 3840x2160 -framerate 60000/1001 -rtbufsize 210000000 -pixel_format bgr24 -i video="MZ0380 PCI, Analog 01 Capture" $03d.BMP or %03d.jpg
Gives me similar performance as video.

I think my only hope is my capture card natively supporting yuv444p. Converting between bgr24 to yuv444 impacts performance too much and libx264rgb isn’t fast enough. 

Any advice is appreciated. 

-----Original Message-----
From: ffmpeg-user [mailto:ffmpeg-user-bounces at ffmpeg.org] On Behalf Of James Girotti
Sent: Tuesday, February 13, 2018 1:33 PM
To: FFmpeg user questions
Subject: Re: [FFmpeg-user] 4K 60Hz Directshow Video Capture

On Tue, Feb 13, 2018 at 6:57 AM, Alex P <alex.p at avenview.com> wrote:

> I think I've figured it out. When I use nv12 or yuv420p as the input 
> and output pixel format, I get x1 performance. If I use bgr24/rgb24 as 
> the input and yuv444p as the output, I get around x0.3.
>

Looks like switching pixel formats highly impacts performance. It would be better for your capture card to output, for example, yuv444p. I can't tell from the specs if it can do that though.

Careful selecting nv12 as format for output, my quick test showed that the final output was yuv420p.


> In your testing James, what was the pixel format?


I was testing yuv420p samples as that is what was available to me at the time. I have made a yuv444p using testsrc. My poor Thuban cannot decode this FFv1 at realtime and raw-video filesize is gigantic. So I made a lossless hevc yuv444p. Surprisingly (or maybe not) hevc_cuvid can't decode it! Again, my poor Thuban cannot decode real-time, but there's some hope:

FFmpeg encoding speed was about 35-40 fps and hw-encoder utilization topped out at 40%. So there's still a lot of headroom in the hw-encoder. Rough theoretical calculation: I could get 100fps hw-encoding which is ~1.7X

I got about the same speed for h264_nvenc lossless. I got similar results using a 3 second raw yuv444p video input file.

If there are other pix_fmts you would like me to test, let me know. I'll do my best to try.
_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1GiB Test.png
Type: image/png
Size: 36649 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20180226/9dbdbf58/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 8GiB Test.png
Type: image/png
Size: 37877 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20180226/9dbdbf58/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 50MiB Test.png
Type: image/png
Size: 37104 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20180226/9dbdbf58/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 100MiB Test.png
Type: image/png
Size: 37911 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20180226/9dbdbf58/attachment-0003.png>


More information about the ffmpeg-user mailing list