logo

Live Production Software Forums


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

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
pingu2k  
#1 Posted : Wednesday, May 20, 2020 12:24:30 AM(UTC)
pingu2k

Rank: Member

Groups: Registered
Joined: 5/17/2020(UTC)
Posts: 23
Germany
Location: Berlin

Thanks: 16 times
Was thanked: 6 time(s) in 2 post(s)
Upon experimenting with h264_nvenc on a RTX2080super with vMix and OBS for high-quality streaming I ended up with much better quality streams and records of OBS. CPU-driven x264 is not my primary goal but it needs some adjustmens too, but first to Hardware Encoder "NVENC".

General perceptions of vMix MP4/x264 with the same bitrates:
MP4 H264High nvenc has much better quality than FFMPEG nvenc, this follows quality-wise MP4 H264High software.
This is not my goal for producing a good stream or recording. OBS does a better job on encoding, so it is possible in a live scenario. Sure, for postproduction a "slower" denoised encode can yield far better results.

I analyzed the files and MP4 software doesn't use CABAC, this costs quality and FFMPEG software is very conservative with main or even baseline profiles, FFMPEG nvenc isn't utilising high-profile or the slow preset.

Don't get me wrong, this are great settings for older or slower computers. But a high-end machine can do smaller files or yield better quality and utilise more processing power.

Digging into vMix I exchanged both ffmpeg-files inside C:\Program Files (x86)\vMix\streaming to the most recent version of ffmpeg.zeranoe (static-type). This works without a flaw, but I'm still testing and NO guarantee, that it might work for everyone.

Afterwards I analyzed which settings vMix uses for recording. The ffmpegformats.xml of C:\Program Files (x86)\vMix\streaming can be user-edited - thats great!

More to the software-encoding later, first to hardware.
I'm testing a long time with nvenc to produce good quality and searched around forums and nvidia-docs and sadly not every possible setting is explained. My commands gain much more quality than stock-nvenc, without sacrificing too much computing power. Keep in mind, nvenc is a dedicated encoding-processor (some call it streaming-processor) on the nvidia cards, it is not linked to CUDA-performance.

I changed the video codec to h264_nvenc and audio to aac, as these are the common names used of the present ffmpegs.
My commands are: -vcodec {video_codec} -pix_fmt:v nv12 -preset:v slow -profile:v high -rc-lookahead:v 60 -spatial-aq:v 1 -temporal-aq:v 1 -b_ref_mode:v 2 -coder:v cabac -bf:v 3 -b:v {video_bitrate} -acodec {audio_codec} -b:a {audio_bitrate} -f {extension_type}

It uses preset slow of the encoder with a lookahead of 60 frames. This should match your framerate, but I'm still testing. High profile with CABAC (maybe not neccessary to mention). Spatial and temporal AQ rearange bits inside the frame for better percieved quality (psyo-visual tuning). I use 3 bframes that can be used as a reference (b_ref_mode 2).
In contrast: OBS has a preset for highquality (a bit less than slow, but it doesn't really matter), lookahead and psyo-visual tuning. My settings are more advanced. (And some guys on the internet suggest to set concurring surfaces to 64, but I haven't found any info what this really does.)
My RTX can encode 2 high-quality streams or files in 1080p60 with these settings - as consumer cards only allow 2 streams, I don't know if more are possible.

For the software part i've created a MP4 x264 medium high AAC Profile with libx264 video-codec and aac for audio.
Command-Settings: -pix_fmt yuv420p -vcodec {video_codec} -preset:v medium -profile:v high -b:v {video_bitrate} -acodec {audio_codec} -b:a {audio_bitrate} -f {extension_type}
This is a profile with my PC is capable of and can be used as a small giveaway for clients.
Next I added high-profile to the MP4 x264 fast option -works with less CPU usage.

Now the fun part. x264 and h264_nvenc have a quality-based encoding! You don't specify a bitrate, but a quality to reach. That way you save bits on easy and slow moving party and spend them on higher motion parts of the video. This is only usefull for recording, as the bitrate fluctuates upredictably.
Instead of a bitrate define a QP for nvenc. Start your tests with 19 or 21 for achival and much higher values for small files.
For x264 define CRF and start with 16 or 19 for HQ archival and 20 to 23 for small client-files.

I've produced much input for you and the vMix Team to understand. But this works for recoding so far!

My problem is I cannot enter custom values or edit a XML-File for the streaming part of vMix.
By the way, streaming with ffmpeg2 and nvenc is not that bad, compared to recording. It uses a high profile, if selected and uses CABAC. Half-way there. But I'd like to use Bframes and maybe add more of my settings.

How can I edit these settings? Is there a file I can edit? (just for nerdy-testing-stuff)

In the future it would be really cool to have a custom-field inside the recording and streaming-window to enter custom values.

I understand, that you want an easy-to-use and reliable product and I don't want an easy field for every possible option. Just a custom field, like handbrake shows us or OBS on some parameters.

Keep up the good work for vMix!
thanks 5 users thanked pingu2k for this useful post.
mjgraves on 5/20/2020(UTC), stigaard on 5/31/2020(UTC), DaveBHBC on 6/3/2020(UTC), vvcvvc on 7/13/2020(UTC), hellokitty on 9/30/2021(UTC)
dark_ata  
#2 Posted : Thursday, May 21, 2020 2:24:01 AM(UTC)
dark_ata

Rank: Advanced Member

Groups: Registered
Joined: 8/10/2015(UTC)
Posts: 133
Location: Tenerife

Thanks: 11 times
Was thanked: 18 time(s) in 13 post(s)
look this post https://forums.vmix.com/...adro-P5000-or-RTX2080-Ti


you can uses this to get 5-15 1080p encoder in funtion of your computer
https://github.com/keyla...ia-patch/tree/master/win
pingu2k  
#3 Posted : Wednesday, May 27, 2020 9:36:17 PM(UTC)
pingu2k

Rank: Member

Groups: Registered
Joined: 5/17/2020(UTC)
Posts: 23
Germany
Location: Berlin

Thanks: 16 times
Was thanked: 6 time(s) in 2 post(s)
Thanks for the input, I'll try it out.

But that doesn't cope with the missing options inside vmix.
DWAM  
#4 Posted : Wednesday, May 27, 2020 10:13:56 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)
You can still use EXT outs / VMix Video to feed FFMPEG externally with the settings of your choice.

I agree on most of your observations about the lack of encoding optimisations possibilities or even quality difference with OBS / FFMPEG / NVENC vs vMix.

An easy solution for Martin to let advanced users deal with their own encoding settings could be to add the ability for the encoder (FFMPEG) to use a custom file with parameters. This way there's no need to add a custom field in the GUI which can be confusing for beginners and still let us easily tweak and optimize settings to our needs/desires (under our responsability)...

IF a user's custom file exists
FFMPEG uses it
ELSE
FFMPEG uses settings defined via the GUI
END IF

My 2 cts...
Guillaume

PS : this is a +1 for anything related to streaming quality encoding improvement in vMix
thanks 3 users thanked DWAM for this useful post.
pingu2k on 5/27/2020(UTC), mjgraves on 5/28/2020(UTC), vvcvvc on 7/13/2020(UTC)
stevespaw  
#5 Posted : Wednesday, May 27, 2020 10:57:57 PM(UTC)
stevespaw

Rank: Advanced Member

Groups: Registered
Joined: 3/12/2015(UTC)
Posts: 482
Man
Location: Kansas City, MO USA

Thanks: 151 times
Was thanked: 75 time(s) in 57 post(s)
Originally Posted by: DWAM Go to Quoted Post


An easy solution for Martin to let advanced users deal with their own encoding settings could be to add the ability for the encoder (FFMPEG) to use a custom file with parameters. This way there's no need to add a custom field in the GUI which can be confusing for beginners and still let us easily tweak and optimize settings to our needs/desires (under our responsability)...

IF a user's custom file exists
FFMPEG uses it
ELSE
FFMPEG uses settings defined via the GUI
END IF

My 2 cts...
Guillaume

PS : this is a +1 for anything related to streaming quality encoding improvement in vMix



+1
thanks 1 user thanked stevespaw for this useful post.
DWAM on 6/1/2020(UTC)
mjgraves  
#6 Posted : Thursday, May 28, 2020 1:19:28 AM(UTC)
mjgraves

Rank: Advanced Member

Groups: Registered
Joined: 7/1/2015(UTC)
Posts: 1,151
Man
United States
Location: Houston TX

Thanks: 319 times
Was thanked: 263 time(s) in 233 post(s)
Originally Posted by: DWAM Go to Quoted Post

IF a user's custom file exists
FFMPEG uses it
ELSE
FFMPEG uses settings defined via the GUI
END IF


+1


thanks 1 user thanked mjgraves for this useful post.
DWAM on 6/1/2020(UTC)
niemi  
#7 Posted : Sunday, May 31, 2020 9:11:56 AM(UTC)
niemi

Rank: Advanced Member

Groups: Registered
Joined: 2/16/2017(UTC)
Posts: 178
Location: Denmark

Thanks: 27 times
Was thanked: 18 time(s) in 15 post(s)
+1
thanks 1 user thanked niemi for this useful post.
DWAM on 6/1/2020(UTC)
stigaard  
#8 Posted : Sunday, May 31, 2020 6:01:31 PM(UTC)
stigaard

Rank: Advanced Member

Groups: Registered
Joined: 5/20/2015(UTC)
Posts: 493
Man
Denmark
Location: Copenhagen, Denmark

Thanks: 389 times
Was thanked: 100 time(s) in 79 post(s)
+1
thanks 1 user thanked stigaard for this useful post.
DWAM on 6/1/2020(UTC)
doggy  
#9 Posted : Sunday, May 31, 2020 6:53:15 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,227
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 956 time(s) in 791 post(s)
+1
thanks 1 user thanked doggy for this useful post.
DWAM on 6/1/2020(UTC)
Slaver  
#10 Posted : Sunday, May 31, 2020 7:03:36 PM(UTC)
Slaver

Rank: Advanced Member

Groups: Registered
Joined: 9/27/2014(UTC)
Posts: 113
Location: Germany

Thanks: 27 times
Was thanked: 8 time(s) in 8 post(s)
+1
thanks 1 user thanked Slaver for this useful post.
DWAM on 6/1/2020(UTC)
NHT  
#11 Posted : Sunday, May 31, 2020 11:53:25 PM(UTC)
NHT

Rank: Advanced Member

Groups: Registered
Joined: 4/18/2016(UTC)
Posts: 223
Location: United Kingdom

Thanks: 33 times
Was thanked: 37 time(s) in 31 post(s)
+1
thanks 1 user thanked NHT for this useful post.
DWAM on 6/1/2020(UTC)
toastbh  
#12 Posted : Monday, June 1, 2020 12:16:54 AM(UTC)
toastbh

Rank: Newbie

Groups: Registered
Joined: 3/19/2018(UTC)
Posts: 5

Was thanked: 2 time(s) in 2 post(s)
+1
thanks 1 user thanked toastbh for this useful post.
DWAM on 6/1/2020(UTC)
clafarge  
#13 Posted : Monday, June 1, 2020 12:34:34 AM(UTC)
clafarge

Rank: Advanced Member

Groups: Registered
Joined: 5/27/2017(UTC)
Posts: 93
Man
United States
Location: Greater St Louis Area

Thanks: 67 times
Was thanked: 20 time(s) in 13 post(s)
+1
thanks 1 user thanked clafarge for this useful post.
DWAM on 6/1/2020(UTC)
avsoundguy  
#14 Posted : Monday, June 1, 2020 12:36:29 AM(UTC)
avsoundguy

Rank: Advanced Member

Groups: Registered
Joined: 10/26/2016(UTC)
Posts: 80

Thanks: 194 times
Was thanked: 13 time(s) in 12 post(s)
What DWAM said +1
thanks 1 user thanked avsoundguy for this useful post.
DWAM on 6/1/2020(UTC)
pm  
#15 Posted : Monday, June 1, 2020 1:37:12 AM(UTC)
pm

Rank: Advanced Member

Groups: Registered
Joined: 11/28/2015(UTC)
Posts: 184

Thanks: 10 times
Was thanked: 32 time(s) in 27 post(s)
+1
thanks 1 user thanked pm for this useful post.
DWAM on 6/1/2020(UTC)
MartLeib  
#16 Posted : Monday, June 1, 2020 2:50:42 AM(UTC)
MartLeib

Rank: Advanced Member

Groups: Registered
Joined: 2/23/2017(UTC)
Posts: 189
Estonia

Thanks: 1 times
Was thanked: 52 time(s) in 42 post(s)
Massive +1
thanks 1 user thanked MartLeib for this useful post.
DWAM on 6/1/2020(UTC)
jip  
#17 Posted : Monday, June 1, 2020 3:38:40 AM(UTC)
jip

Rank: Advanced Member

Groups: Registered
Joined: 7/23/2013(UTC)
Posts: 122
Estonia
Location: North

Thanks: 12 times
Was thanked: 13 time(s) in 11 post(s)
+1
thanks 1 user thanked jip for this useful post.
DWAM on 6/1/2020(UTC)
Peter1000  
#18 Posted : Monday, June 1, 2020 4:06:22 AM(UTC)
Peter1000

Rank: Advanced Member

Groups: Registered
Joined: 1/25/2019(UTC)
Posts: 303
Switzerland

Thanks: 17 times
Was thanked: 79 time(s) in 60 post(s)
+1
thanks 1 user thanked Peter1000 for this useful post.
DWAM on 6/1/2020(UTC)
gzifcak  
#19 Posted : Monday, June 1, 2020 5:04:12 AM(UTC)
gzifcak

Rank: Advanced Member

Groups: Registered
Joined: 4/26/2020(UTC)
Posts: 38
United States

Thanks: 4 times
Was thanked: 3 time(s) in 3 post(s)
+1
thanks 1 user thanked gzifcak for this useful post.
DWAM on 6/2/2020(UTC)
gre2gor  
#20 Posted : Wednesday, June 3, 2020 2:20:14 AM(UTC)
gre2gor

Rank: Advanced Member

Groups: Registered
Joined: 12/14/2018(UTC)
Posts: 81
Slovenia

Was thanked: 17 time(s) in 6 post(s)
+1
thanks 1 user thanked gre2gor for this useful post.
DWAM on 6/3/2020(UTC)
Users browsing this topic
Guest
2 Pages12>
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.