New upstream version 25.0.3+dfsg1

This commit is contained in:
Sebastian Ramacher 2020-03-25 09:07:22 +01:00
parent 04fe0efc67
commit 8b2e5f2130
569 changed files with 62491 additions and 5875 deletions

View file

@ -3,7 +3,7 @@ VTH264EncSW="AppleVTH264SoftwareKodierer"
VTEncoder="VideoToolboxKodierer"
Bitrate="Bitrate"
UseMaxBitrate="Limitiere Bitrate"
MaxBitrate="Max. Bitrate"
MaxBitrate="Maximale Bitrate"
MaxBitrateWindow="Maximales Bitratenfenster (Sekunden)"
KeyframeIntervalSec="Keyframeintervall in Sek. (0=automatisch)"
Profile="Profil"

View file

@ -1,10 +1,10 @@
VTH264EncHW="Apple VT H264 Hardware Enkodér"
VTH264EncSW="Apple VT H264 Software Enkodér"
VTEncoder="VideoToolbox Enkodér"
Bitrate="Dátový tok"
UseMaxBitrate="Obmedziť dátový tok"
MaxBitrate="Maximálny dátový tok"
MaxBitrateWindow="Maximálny dátový tok okna (v sekundách)"
Bitrate="Bitrate"
UseMaxBitrate="Obmedziť bitrate"
MaxBitrate="Maximálny bitrate"
MaxBitrateWindow="Maximálny bitrate okna (v sekundách)"
KeyframeIntervalSec="Interval kľúčových snímok (sekúnd, 0 = automaticky)"
Profile="Profil"
None="(Žiadny)"

View file

@ -0,0 +1,14 @@
VTH264EncHW="Apple VT H264 strojni kodirnik"
VTH264EncSW="Apple VT H264 strojni kodirnik"
VTEncoder="VideoToolbox kodirnik"
Bitrate="Bitna hitrost"
UseMaxBitrate="Omeji bitno hitrost"
MaxBitrate="Največja bitna hitrost"
MaxBitrateWindow="Okno največje bitne hitrosti (sekunde)"
KeyframeIntervalSec="Razmik med ključnimi sličicami (sekunde, 0=samodejni)"
Profile="Profil"
None="(brez)"
DefaultEncoder="(privzeti kodirnik)"
UseBFrames="Uporabi B-sličice"

View file

@ -1,5 +1,6 @@
#include <obs-module.h>
#include <util/darray.h>
#include <obs-avc.h>
#include <CoreFoundation/CoreFoundation.h>
#include <VideoToolbox/VideoToolbox.h>
@ -671,6 +672,8 @@ static bool is_sample_keyframe(CMSampleBufferRef buffer)
static bool parse_sample(struct vt_h264_encoder *enc, CMSampleBufferRef buffer,
struct encoder_packet *packet, CMTime off)
{
int type;
CMTime pts = CMSampleBufferGetPresentationTimeStamp(buffer);
CMTime dts = CMSampleBufferGetDecodeTimeStamp(buffer);
@ -703,6 +706,37 @@ static bool parse_sample(struct vt_h264_encoder *enc, CMSampleBufferRef buffer,
packet->size = enc->packet_data.num;
packet->keyframe = keyframe;
// VideoToolbox produces packets with priority lower than the RTMP code
// expects, which causes it to be unable to recover from frame drops.
// Fix this by manually adjusting the priority.
uint8_t *start = enc->packet_data.array;
uint8_t *end = start + enc->packet_data.num;
start = (uint8_t *)obs_avc_find_startcode(start, end);
while (true) {
while (start < end && !*(start++))
;
if (start == end)
break;
type = start[0] & 0x1F;
if (type == OBS_NAL_SLICE_IDR || type == OBS_NAL_SLICE) {
uint8_t prev_type = (start[0] >> 5) & 0x3;
start[0] &= ~(3 << 5);
if (type == OBS_NAL_SLICE_IDR)
start[0] |= OBS_NAL_PRIORITY_HIGHEST << 5;
else if (type == OBS_NAL_SLICE &&
prev_type != OBS_NAL_PRIORITY_DISPOSABLE)
start[0] |= OBS_NAL_PRIORITY_HIGH << 5;
else
start[0] |= prev_type << 5;
}
start = (uint8_t *)obs_avc_find_startcode(start, end);
}
CFRelease(buffer);
return true;
@ -929,6 +963,8 @@ void encoder_list_create()
da_push_back(vt_encoders, &enc);
#undef VT_DICTSTR
}
CFRelease(encoder_list);
}
void encoder_list_destroy()