logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
kgoodyer  
#1 Posted : Saturday, May 26, 2018 1:00:47 PM(UTC)
kgoodyer

Rank: Advanced Member

Groups: Registered
Joined: 6/16/2015(UTC)
Posts: 193
Man
United Kingdom
Location: Milton Keynes, UK

Thanks: 10 times
Was thanked: 53 time(s) in 27 post(s)
Streaming Question

VMIX lists the following possible x.264 presets:

Ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow

but NVENC (NVIDIA h.264 hardware encoding ) uses presets:

slow, medium, fast, high performance, high quality, bd, low latency, low latency high quality. low latency high performance, lossless, & lossless high performance.

Is there an easy way for me to select say the ffmpeg 'high performance' ffmpeg preset from the VMIG streaming dialog? I will I have to use an external copy of ffmpeg using "DSHOW://VIMX Video" on a command line?

Keith
thanks 1 user thanked kgoodyer for this useful post.
tsulls on 5/31/2018(UTC)
DWAM  
#2 Posted : Thursday, May 31, 2018 1:25:17 PM(UTC)
DWAM

Rank: Advanced Member

Groups: Registered
Joined: 3/20/2014(UTC)
Posts: 2,721
Man
France
Location: Bordeaux, France

Thanks: 243 times
Was thanked: 794 time(s) in 589 post(s)
Hi Keith

I asked pretty much the same question lately. No answer so far

See : https://forums.vmix.com/...ts&m=53480#post53480

Guillaume
thanks 1 user thanked DWAM for this useful post.
tsulls on 5/31/2018(UTC)
tsulls  
#3 Posted : Thursday, May 31, 2018 5:16:25 PM(UTC)
tsulls

Rank: Member

Groups: Registered
Joined: 4/22/2017(UTC)
Posts: 12
Location: Los Angeles, CA

Thanks: 7 times
Same I can't seem to find anything - my post:
https://forums.vmix.com/...aspx?g=posts&t=15891
kgoodyer  
#4 Posted : Thursday, May 31, 2018 11:23:06 PM(UTC)
kgoodyer

Rank: Advanced Member

Groups: Registered
Joined: 6/16/2015(UTC)
Posts: 193
Man
United Kingdom
Location: Milton Keynes, UK

Thanks: 10 times
Was thanked: 53 time(s) in 27 post(s)
Hi

Whilst not entirely convenient, I am using an external ffmpeg command line to pick up the VMIX Directshow output, and then using carefully hand crafted ffmpeg command lines to encode the VMIX output into 8 x h.264 streams each with differing resolutions and bit rates on a £50 second hand ebay NVIDIA QUADRO K2000 (Gforce GTX cards are restricted to a maximum of 2 streams). As I only need 4:2:0 h.264 it seemed pointless using a modern expensive GPU. ffmpeg also allows you to select which GPU card you want to use, so hopefully I can get a GTX-1060 to register as GPU0 and let VMIX take control of that, and use a second K2000 as GPU1 to do all my encoding.

BTW the hardware acceleration implementation built-in to flash media encoder sucks - it barely uses the GPU, and the h.264 encoder available in flash based apps is even worse. I don't honestly think it actualy uses the GPU's for anything. The FMLE multi-bitrate streaming system sucks - use a CDN that can transcode for you, or buy a Quadro card, and let ffmpeg take the strain.

If anybody is interested in my command line - Using current (May 2018) FFMPEG Windows Stable Build, this is for 4 streams, at the highest possible performance, at the sacrifice of latency and quality. You can easily expand it to support as many streams as your 'QUADRO' graphics card can handle at a given performance, I can max out about 9/10 high performance streams on a K2000, I would imagine you can do 30 or 40 on a new P6000 card (just don't have the spare $5000 to try it out).


Code:


// Stream 1 1920x1080p25 @5Mbps
// Stream 2 1280x720p25 @4Mbps
// Stream 3 1024x576 @3Mbps
// Stream 4 512x288 @2Mbps 

ffmpeg -loglevel error -re -f dshow -video_size 1920x1080 -rtbufsize 1000M  -framerate 25 -i video="VMIX"  -f dshow -i audio="VMIX Audio " -s 1920x1080 -vf scale=interl=1,format=pix_fmts=yuv420p -c:v h264_nvenc -b:v 5000k  -preset 4 -profile:v main -level 4.1 -f flv -acodec aac -strict -2 -ar 44100 -ab 256K -ac 2 rtmp://ingest.xxxxxx.co.uk/Live/stream1 -s 1280x720 -vf scale=interl=1,format=pix_fmts=yuv420p -c:v h264_nvenc -b:v 4000k -preset 4 -profile:v main -level 4.1 -f flv -acodec aac -strict -2 -ar 44100 -ab 128K -ac 2 rtmp://ingest.xxxxxx.co.uk/Live/stream2 -s 1024x576 -vf scale=interl=1,format=pix_fmts=yuv420p -c:v h264_nvenc -b:v 3000k -preset 4 -profile:v main -level 4.1 -f flv -acodec aac -strict -2 -ar 44100 -ab 96K -ac 2 rtmp://ingest.xxxxxx.co.uk/Live/stream3 -s 512x288 -vf scale=interl=1,format=pix_fmts=yuv420p -c:v h264_nvenc -b:v 2000k -preset 4 -profile:v main -level 4.1 -f flv -acodec aac -strict -2 -ar 44100 -ab 32K -ac 2 rtmp://ingest.xxxxxx.co.uk/Live/stream4




Probably still needs some tweaking (some of the profile/levels are a bit high for the lower resolutions)- but please remember you can ONLY do two streams in hardware on consumer Gforce GTX cards, so this will error when it try's to start the third and fourth stream. But with the right GPU card (remember mine was only £50 on Ebay) you can turn your VMIX into a streaming power house.

Of the 2Gb of RAM on the K2000 Quadro we are running at about 200kbyts - plenty of spare RAm if you want to use the CUDA cores for something (h.264 encoding does NOT use the CUDA cores - there are separate pipelined h.264 encoders on NVIDI GPU's - they just share the RAM, and it appears that h.264 encoding dosen't use much of it. So dont be tempted by cards with 12Gb of DDR5, you wont use any of it if your using your card for encoding.

Hey Martin, how about offering us Quadro Users the ability to do say 8 web streams? but we would need a little more control in setting presets as some may want slow 2 pass ultra high quality, and some people like me is more about the number of simultaneous CDN's and bitrates I need to connect to.

There are plenty of philosophers out there that will argue the subjective quality issues between the cpu based x.264 encoder and hardware NVENC encoding - personally even at high performance NVENC produces a perfectly acceptable result for the kind of streaming we are all doing (that presuming your not the BBC).

All The Best

Keith
thanks 2 users thanked kgoodyer for this useful post.
DWAM on 6/1/2018(UTC), vvcvvc on 8/9/2018(UTC)
DWAM  
#5 Posted : Friday, June 1, 2018 12:39:14 PM(UTC)
DWAM

Rank: Advanced Member

Groups: Registered
Joined: 3/20/2014(UTC)
Posts: 2,721
Man
France
Location: Bordeaux, France

Thanks: 243 times
Was thanked: 794 time(s) in 589 post(s)
Hi Keith

Thanks for sharing this. I love your use of a cheap Quadro as GPU 2 on the same host. Very clever!

Quote:
Probably still needs some tweaking (some of the profile/levels are a bit high for the lower resolutions)

Yes levels are inappropriate for SD, but apart from that after a quick glance to your script, it seems pretty much ok.
I will try to test it for real soon. Keep you posted if I find a way to improve it.

Guillaume
DWAM  
#6 Posted : Friday, June 1, 2018 12:41:28 PM(UTC)
DWAM

Rank: Advanced Member

Groups: Registered
Joined: 3/20/2014(UTC)
Posts: 2,721
Man
France
Location: Bordeaux, France

Thanks: 243 times
Was thanked: 794 time(s) in 589 post(s)
Oh btw I came here to copy Martin's answer about this from another post.

Quote:

Hi,

The only setting that impacts hardware encoding at this time is the Profile.
Selecting Main or High should improve quality a little from Baseline.

vMix uses the NVIDIA "Low Latency HQ" option internally, so this should be the highest possible quality
from the encoder for low latency purposes like streaming.

As for render time impact. NVIDIA cards have a separate dedicated hardware encoding logic separate from the rest of the GPU,
so it's not really an indicator that the encoder could be pushed further to improve quality.
(That is without doing an offline multi-pass encode which is not suitable for streaming).

Hope this helps.

Regards,

Martin
vMix


Thanks Martin
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.