Streaming via custom output (ffmpeg)

Skajdrovski

New Member
Hello, a few weeks ago I've bought an AMD gpu.

The first problem I saw is I couldn't record videos in 120 fps on AMF encoder, both AVC and HEVC. Reason I set that high fps is because Twitch supports this kind of framerate without issues.
I found encoder doesn't choke when I setup custom output, but OBS doesn't allow us to set same output method in Streaming tab.

I searched up we can put Output to URL which allows to "stream" videos (eg. rtmp://waw02.contribute.live-video.net/app/{stream_key}) but not sure how exactly that works and I end up with error "Invalid argument" when trying to stream this way.

Is there any way to achieve streaming with custom ffmpeg output ? It's more efficient atleast on my PC setup :\
 

Attachments

  • 2023-01-08 21-33-09.txt
    14.9 KB · Views: 347

sandrix

Member
Don't even count on streaming/recording at 120 fps. Streaming at 120 fps doesn't make any sense. Users, on the contrary, reduce the fps of the stream in order to save bitrate and get higher quality for twitch.

I don't want to upset you, but when it comes to video encoding, AMD is way behind.
Usually, many people try to avoid topics related to the AMD encoder, because it sucks.
 
Last edited:

sandrix

Member
Speaking of your question, you shouldn't use ffmpeg, it won't make it any better. Use advanced output options.
 

Skajdrovski

New Member
Speaking of your question, you shouldn't use ffmpeg, it won't make it any better. Use advanced output options.
well, my testings say otherwise, I can achievie 120 fps footage without any stutters, while advanced output just freezes OBS when stopping recording. About AMD I heard they improved it a bit with adding b-frames. I wasn't patient enough to wait for RTX 4000 / RX 7000 :\
 

sandrix

Member
OK then. The address must be specified as follows:
rtmp://hel03.contribute.live-video.net/app/*******
RTMP server Twitch: https://stream.twitch.tv/ingests/
* - is your unique stream key

flv/aac containers for H.264
hls/aac for H.265 only YouTube HLS and at the end of the address you should specify .m3u8

The parameters ffmpeg should be specified through the = sign
For example: quality=quality profile=high g=120 rc=cbr b=8M enforce_hrd=1 preanalysis=0

 
Last edited:

Skajdrovski

New Member
OK then. The address must be specified as follows:
rtmp://hel03.contribute.live-video.net/app/*******.flv
RTMP server Twitch: https://stream.twitch.tv/ingests/
* - is your unique stream key

flv/aac containers for H.264
hls/aac for H.265 only YouTube HLS and at the end of the address you should specify .m3u8

The parameters ffmpeg should be specified through the = sign
For example: preset=quality profile=high rc=cbr g=120 enforce_hrd=1 vbaq=1 bframes=2

unfortunately adding .flv at the end of address didn't let me through this error (don't mind muxer settings)
 

Attachments

  • settings.png
    settings.png
    38.5 KB · Views: 971
  • error.png
    error.png
    5.4 KB · Views: 952

sandrix

Member
Bitrate doesn't matter. Because AMF's bitrate control rate is controlled by the quantization parameter.
Code:
quality=quality profile=high g=120 rc=cbr b=8M enforce_hrd=1 preanalysis=0
1673219539321.png
 

sandrix

Member
I'm getting encoder overloads so I don't use ffmpeg. Plus your graphics card supports b-frames, but I'm not sure which variable enables them in ffmpeg for amd. bf= or BPicturesPattern=

In general, I would just advise using advanced settings.
1673220060873.png

preanalysis is a rather paradoxical setting, but in my case, only forcibly disabling it makes the encoder work smoothly.
 

Skajdrovski

New Member
Probably. I have no way to check this, because I have an RX 570. In any case, the b-frames definitely work on RDNA 2.0, I was sent samples to analyze on the RX 6600 XT. Maximum 3 b-frames.
View attachment 90384
one more question, what g=120 parameter does ? removing it completely mess up bitrate. Does setting it to 240 while 120 fps gonna make it look better ?
 

Skajdrovski

New Member
Here are the results with these parameters, my internet bandwidth limits me to use 3400 bitrate, but for me it looks decent enough :)
quality=quality profile=high rc=1 MaxNumRefFrames=2 BReferenceEnable=1 MaxConsecutiveBPictures=2 BPicturesPattern=2 b=3.4M g=240
 

sandrix

Member
one more question, what g=120 parameter does ? removing it completely mess up bitrate. Does setting it to 240 while 120 fps gonna make it look better ?
This is the keyframe interval. Increasing it saves bitrate. Depends on content. For streaming, it's usually every 2 or 4 seconds for 60 fps. It doesn't matter much.
 
Top