Eklentiler – Obs Studio 29.1.3 Dokümantasyon, Eklentiler Kılavuzu | Obs
Eklentiler Kılavuzu
Linux
(Flatpak)
Eklentiler
Hemen hemen tüm özel işlevsellik, tipik olarak dinamik kütüphaneler veya komut dosyaları olan eklenti modülleri aracılığıyla eklenir. Ses/video çekme ve/veya çıktı, bir kayıt yapma, bir RTMP akışına çıktı, x264’te kodlama yeteneği, eklenti modülleri aracılığıyla gerçekleştirilen şeylere örnektir.
Eklentiler kaynakları, çıktıları, kodlayıcıları ve hizmetleri uygulayabilir.
İlk eklentinizi yazıyorum? Başlamanız için temel bir şablon eklentisi sunuyoruz.
Bunlar, eklentiler tarafından yaygın olarak kullanılan bazı önemli başlıklardır:
- libobs/obs-module.H – Eklenti modülleri oluşturmak için kullanılan birincil başlık. Bu dosya aşağıdaki dosyaları otomatik olarak içerir:
- libobs/obs.H – Ana Libobs başlığı. Bu dosya aşağıdaki dosyaları otomatik olarak içerir:
- libobs/obs-source.H – Eklenti modüllerinde kaynakları uygulamak için kullanılır
- libobs/obs-çıktı.H – Eklenti modüllerinde çıkışları uygulamak için kullanılır
- libobs/obs-coder.H – Eklenti modüllerinde kodlayıcıları uygulamak için kullanılır
- libobs/observice.H – Eklenti modüllerinde hizmetleri uygulamak için kullanılır
- libobs/obs-veriler.H – libobs nesneleri için ayarları yönetmek için kullanılır
- Libobs/Obs-Properties.H – libobs nesneleri için özellikler üretmek için kullanılır
- libobs/grafikler/grafikler.
Ortak dizin yapısı ve cMakelistler.txt
Kaynak dosyalarının düzenlenmesinin ortak yolu, eklenti başlatma için bir dosyaya sahip olmaktır ve daha sonra uyguladığınız her bir nesne için belirli dosyalara sahip olmaktır. Örneğin, ‘benim plugin’ adlı bir eklenti oluşturacak olsaydınız, benim plugin gibi bir şey olurdu.C Eklenti başlatma yapıldığı yerde.C Özel bir kaynağın tanımı için, benim çıktı.C Özel Çıktı Tanımı için vb. (Bu elbette bir kural değil)
Bu, yerel bir eklenti modülü için ortak bir dizin yapısına bir örnektir:
Benim-Eklenti/veri/yeren-BİZ. Benim-Eklenti/CMakelistler.txt Benim-Eklenti/Benim-Eklenti.C Benim-Eklenti/Benim-kaynak.C Benim-/Benim-.C Benim-Eklenti/Benim-kodlayıcı.C Benim-Benim-hizmet.C
Bu ortak bir CMakelistlerin örneği olacaktır.Bu dosyalarla ilişkili txt dosyası:
# benim-plugin/cmakelistler.TXT Projesi (My-Plugin) seti (my-plugin_sources my-plugin.c benim kaynak.C My-Output.C My-kodlayıcı.C Hizmetim.C) Add_library (my-plugin modülü $) Target_link_library (benim-plugin libobs) install_obs_plugin_with_data (plugin verileri)
Yerel eklenti başlatma
Yerel bir eklenti modülü oluşturmak için libobs/obs-module eklemeniz gerekecektir.H başlığı, obs_declare_module () makro kullanın, ardından obs_module_load () işlevinin bir tanımını oluşturun . Obs_module_load () işlevinizde, daha sonra özel kaynaklarınızı, çıktılarınızı, kodlayıcılarınızı veya hizmetlerinizi kaydedersiniz. Daha fazla bilgi için modül API referansına bakın.
.C, her türden bir nesneyi kaydedecek:
.C */ #katmak / * Ortak işlevleri tanımlar (gerekli) */ Obs_declare_module() / * Ortak INI tabanlı yerel ayarı (isteğe bağlı) uygular */ Obs_module_use_default_locale("Benim-plugin", "en-us") hariç yapı obs_source_info my_source; /* Benim kaynakımda tanımlandı.C */ hariç yapı obs_output_info my_utput; /* Benim çıkışımda tanımlandı.C */ hariç yapı obs_encoder_info my_encoder; /* Benim kodlayıcımda tanımlandı.C */ yapı obs_service_info my_service; /* Hizmetimde tanımlandı.C */ bool obs_module_load() obs_register_source(); obs_register_output(& &); obs_register_encoder(& &my_encoder); obs_register_service(& &my_service); geri dönmek doğru; >
Kaynaklar
Kaynaklar akışta video ve/veya ses oluşturmak için kullanılır. Ekranları/oyunları/ses yakalama, video çalma, bir resim gösterme veya ses çalma gibi şeyler. Kaynaklar ayrıca ses ve video filtrelerini ve geçişleri uygulamak için de kullanılabilir. Libobs/obs-source.H Dosyası, kaynakları uygulamak için özel bir başlıktır. Daha fazla bilgi için kaynak API referansına (obs_source_t) bakın.
Örneğin, bir kaynak nesneyi uygulamak için, bir obs_source_info yapısı tanımlamanız ve kaynağınızla ilgili bilgiler ve geri aramalarla doldurmanız gerekir:
/*.C */ . ] yapı obs_source_info my_source .İD = "my_source", .tip = Obs_source_type_input, .output_flags = Obs_source_video, .get_name = my_source_name, .yaratmak = my_source_create, .tahrip etmek = my_source_destroy, .güncelleme = my_source_update, .Video_render = , . = my_source_width, .get_height = my_source_height >;
O zaman benim plugin benim.C, kaynağı libobs ile kaydettirmek için obs_module_load () içinde obs_register_source () adresini ararsınız.
/* benim-plugin.C */ [. ] hariç yapı obs_source_info my_source; /* Benim kaynakımda tanımlandı.C */ bool obs_module_load(geçersiz obs_register_source(& &my_source); [. ] geri dönmek doğru; >
Bazı basit kaynak örnekleri:
- Asenkron Video Kaynağı: Rastgele Doku Testi Kaynağı
- Ses Kaynağı: Sinüs Dalga Testi Kaynağı
- Video Filtresi: Test Video Filtresi
- Ses Filtresi: Kazanma Ses Filtresi
Çıkışlar
. Akış ve kayıt, çıkışların iki yaygın örneğidir, ancak tek çıkış türü değildir. Çıkışlar ham verileri alabilir veya kodlanmış verileri alabilir. Libobs/obsutput.H Dosyası, çıktıları uygulamak için özel başlıktır. Daha fazla bilgi için çıktı API referansına (obs_output_t) bakın.
Örneğin, bir çıktı nesnesini uygulamak için, bir obs_output_info yapısı tanımlamanız ve çıktınızla ilgili bilgiler ve geri aramalarla doldurmanız gerekir:
/* My Output.C */ [. ] yapı obs_output_info my_utput . = , . = Obs_output_av | , .get_name = my_output_name, .yaratmak = my_output_create, .tahrip etmek = my_output_destroy, .başlangıç = my_output_start, .durmak = my_output_stop, .encoded_packet = my_output_data, .get_total_bytes = my_output_total_bytes, .encoded_video_codecs = "H264", .encoded_audio_codecs = "AAC" >;
O zaman benim plugin benim.C, çıktıyı libobs ile kaydetmek için obs_module_load () ‘deki obs_register_utput () adresini ararsınız.
/* benim-plugin.C */ [. ] yapı obs_output_info my_utput; /* Benim çıkışımda tanımlandı.C */ bool obs_module_load() obs_register_output(& &my_utput); [. ] geri dönmek doğru; >
Bazı çıkış örnekleri:
- Kodlanmış video/ses çıkışları:
- FLV çıkışı
- FFMPEG MUXER çıkışı
- RTMP akış çıkışı
- FFMPEG çıkışı
Kodlayıcılar
Kodlayıcılar, kodlayıcıları kullanan çıktılarla kullanılan video/ses kodlayıcılarının gözlemsel uygulamalarıdır. X264, NVENC, QuickSync kodlayıcı uygulamalarının örnekleridir. Libobs/obs-coder.H dosyası, kodlayıcıları uygulamak için özel başlıktır. Daha fazla bilgi için Enkoder API Referansına (OBS_ENCODER_T) bakın.
Örneğin, bir kodlayıcı nesnesini uygulamak için, bir obs_encoder_info yapısını tanımlamanız ve kodlayıcınızla ilgili bilgiler ve geri aramalarla doldurmanız gerekir:
/* benim kodlayıcı.C */ [. ] yapı obs_encoder_info my_encoder_encoder .İD = "my_encoder", . = Obs_encoder_video, .kodek "H264", .get_name = my_encoder_name, .yaratmak = my_encoder_create, .tahrip etmek = my_encoder_destroy, .kodlamak = my_encoder_encode, .güncelleme = my_encoder_update, .get_extra_data = my_encoder_extra_data, .get_sei_data = my_encoder_sei, .get_video_info = my_encoder_video_info >;
.C, kodlayıcıyı libobs ile kaydetmek için obs_module_load () içinde obs_register_encoder () ararsınız.
/* benim-plugin. [. ] hariç yapı my_encoder; /* Benim kodlayıcımda tanımlandı. bool obs_module_load(geçersiz) obs_register_encoder(& &my_encoder); . ] geri dönmek doğru >
ÖNEMLİ NOT: Enkoder ayarlarının şu anda belirli bir adlandırma sözleşmesi olması gereken birkaç ortak ayar değeri vardır:
- – Bu değer hem video hem de ses kodlayıcıları için kullanılmalıdır: Bitrate, Kilobits.
- “Rate_control” – Bu, video kodlayıcılar için kullanılan bir ayardır. Genellikle en az “CBR” oran kontrolüne sahip olması bekleniyor. Diğer yaygın oran kontrolleri “VBR”, “CQP” dir.
- “Keyint_sec” – Video kodlayıcılar için, Keyframe aralık değerini, saniyeler halinde veya mümkün olan en yakın yaklaşımı ayarlar. (Yazarın notu: Bu, “Keytt” olmalıydı, çerçevelerde.)
Enkoder örnekleri:
- Video kodlayıcılar:
- X264 kodlayıcı
- FFMPEG NVENC Encoder
- QuickSync Encoder
- FFMPEG AAC/Opus Encoder
Hizmetler
Hizmetler, akış yapan çıktılarla kullanılan akış hizmetlerinin özel uygulamalarıdır. Örneğin, Twitch’e akış için özel bir uygulamaya sahip olabilirsiniz ve YouTube’un RTMP sunucularını almak veya kanalı kontrol etmek gibi şeyleri yapmak için API’lerini oturum açma ve kullanma yeteneğine izin vermek için başka bir uygulamaya sahip olabilirsiniz. Libobs/observice.H dosyası, hizmetleri uygulamak için özel başlıktır. Daha fazla bilgi için Hizmet API Referansına (Obs_Service_T) bakın.
(Yazarın notu: Bu yazıdan itibaren hizmet API’sı eksik)
/* benim hizmetim.C */ [. ] yapı obs_service_info = .İD = "my_service", .get_name my_service_name, .yaratmak = my_service_create, .tahrip etmek = my_service_destroy, .kodlamak = my_service_encode, .güncelleme = my_service_update, . = my_service_url, . = my_service_key >;
O zaman benim plugin benim.C, hizmeti libobs ile kaydetmek için obs_module_load () içinde obs_register_service () adresini ararsınız.
/* benim-plugin.C */ [. ] hariç yapı obs_service_info my_service; /* Hizmetimde tanımlandı.C */ bool obs_module_loadgeçersiz) obs_register_service(& &my_service); . ] doğru; >
Mevcut iki hizmet nesnesi, eklentilerdeki/rtmp-hizmetlerindeki “Ortak RTMP hizmetleri” ve “özel RTMP hizmeti” nesneleridir
Ayarlar (bkz. Libobs/Obs-Vores.h) tipik olarak libobs nesneleriyle ilişkili ayar verilerini almak veya ayarlamak için kullanılır ve daha sonra JSON metni aracılığıyla kaydedilebilir ve yüklenebilir. Daha fazla bilgi için Veri Ayarları API referansına (obs_data_t) bakın.
obs_data_t alt nesnelerin bir dize tablosu olduğu bir JSON nesnesinin eşdeğeridir ve obs_data_array_t benzer şekilde bir dizi saklamak için kullanılır obs_data_t JSON dizilerine benzer nesneler (oldukça aynı olmasa da).
Oluşturmak için obs_data_t veya obs_data_array_t nesne, obs_data_create () veya obs_data_array_create () işlevlerini ararsınız. Ve Nesneler referans sayılır, bu nedenle nesneyi bitirdiğinizde, bu referansları serbest bırakmak için obs_data_release () veya obs_data_array_release () adresini arayın. Her zaman bir obs_data_t veya Nesne bir işlevle döndürülür, referansları arttırılır, bu nedenle bu referansları her seferinde yayınlamanız gerekir.
Değerleri ayarlamak için nesne, aşağıdaki işlevlerden birini kullanırsınız:
İHRACAT obs_data_set_string( *veri, const kargaşa *isim, const kargaşa *val); İHRACAT geçersiz (obs_data_t *veri, const kargaşa isim, uzun uzun val); İHRACAT geçersiz (obs_data_t *veri, const kargaşa *, çift val); İHRACAT geçersiz obs_data_set_bool(obs_data_t veri, const kargaşa *isim, bool geçersiz obs_data_set_obj(obs_data_t *veri, kargaşa *, obs_data_t *obj); İHRACAT geçersiz obs_data_set_array(obs_data_t veri, kargaşa isim, obs_data_array_t *sıralamak);
Benzer şekilde, bir değer elde etmek için nesne, aşağıdaki işlevlerden birini kullanırsınız:
/ * İşlevleri al */ İHRACAT const *obs_data_get_string(obs_data_t veri, kargaşa isim); İHRACAT uzun obs_data_get_int(obs_data_t *veri, const kargaşa *isim); İHRACAT obs_data_get_doubleobs_data_t *veri, const kargaşa *isim İHRACAT (obs_data_t *veri, const *isim); İHRACAT obs_data_t *obs_data_t *veri, const kargaşa ); İHRACAT obs_data_array_t obs_data_t *veri, const kargaşa *isim);
Tipik JSON veri nesnelerinin aksine, obs_data_t Nesne ayrıca varsayılan değerleri de ayarlayabilir. Bu, belirli bir dizeye atanan bir değer yoksa, neyin döndürüldüğünü kontrol etme yeteneğine izin verir obs_data_t Bir JSON String veya JSON dosyasından bu veriler yüklendiğinde nesne. get_defaults Yaratılışta nesne için varsayılan ayarların ayarlanmasına izin veren geri arama.
Bu işlevler, varsayılan değerlerin aşağıdaki gibi olduğunu kontrol edin:
/* Varsayılan değer işlevleri. */ geçersiz obs_data_set_default_string(obs_data_t *veri, const kargaşa *isim, const kargaşa *val); İHRACAT geçersiz obs_data_set_default_int( *, const kargaşa *isim, uzun uzun ); İHRACAT geçersiz obs_data_set_default_doubleobs_data_t *veri, const kargaşa *, çift ); İHRACAT geçersiz obs_data_set_default_bool(obs_data_t *veri, const kargaşa *isim, bool val İHRACAT geçersiz obs_data_set_default_obj(obs_data_t *veri, kargaşa isim, *obj);
Mülkler
Özellikler (bkz. Libobs/Obs-Properties.h) bir libobs nesnesi için ayarları değiştirmek için otomatik olarak kullanıcı arayüzü oluşturmak için kullanılır (istenirse). Her Libobs nesnesinin bir get_properties . Özellikler API, nesnenin ayarlarına bağlı belirli özellikleri tanımlar ve ön uç, kullanıcının ayarları değiştirmesini sağlamak için widget oluşturmak için bu özellikleri kullanır. Örneğin, bir Boolean ayarınız varsa, kullanıcının bu ayarı değiştirebilmesi için obs_properties_add_bool () kullanırsınız. .
statik obs_properties_t *my_source_properties(geçersiz ) *ppts = obs_properties_create(); ppts, "my_bool", obs_module_text"Mybool" UNUMED_PARAMETER(veri); ppts > [. ] yapı obs_source_info my_source .get_properties = my_source_properties, [. ] >;
veri Nesne mevcutsa parametre nesnenin verileridir. Tipik olarak bu kullanılmıyor ve mümkünse muhtemelen kullanılmamalı. Özellikler, onunla ilişkili bir nesne olmadan alınırsa null olabilir.
Özellikler, hangi ayarların gösterildiğine bağlı olarak değiştirilebilir. Örneğin, obs_property_set_modified_callback () işlevini kullanarak belirli bir ayarın ayarlandığına bağlı olarak belirli özellikleri devre dışı veya görünmez olarak işaretleyebilirsiniz.
Örneğin, Boolean Property A metin özelliğini gizlemek istiyorsanız:
statik bool setty_a_modifiedobs_properties_t *, obs_property_t *, obs_data_t *Ayarlar) bool etkinleştirilmiş (, "setty_a"); P = obs_properties_get(ppts, "setty_b"); obs_property_set_enabled(P, etkinleştirilmiş); /* Özellik widget'larını güncellemek için true döndür geri dönmek doğru; > [. ] obs_properties_t *my_source_properties(geçersiz * obs_properties_t *ppts = (); obs_property_t *; P = obs_properties_add_boolppts, , ("Sac")); obs_property_set_modified_callback(P, setty_a_modified); obs_properties_add_text(, "setty_b", obs_module_text("Ayar"), Obs_text_default); ppts; >
Tipik olarak, Obs Studio ile birlikte paketlenmiş çoğu eklenti, her dosyanın farklı bir dil olduğu basit bir INI dosya yerelleştirme yöntemi kullanacaktır. Bu yöntemi kullanırken, eklentinin bir kısmında ekstra çaba olmadan yerel verileri otomatik olarak yükleyecek/yok edecek OBS_MODULE_USE_USE_DEFAULT_LOCALE () makro kullanılır. .h) metin araması gerektiğinde kullanılır.
. Obs_module_set_locale () ihracatı, mevcut dili ayarlamak için libobs tarafından çağrılır ve daha sonra obs_module_free_locale () ihracatı, modülün imhası üzerine libobs tarafından çağrılır. Eklentiniz için özel bir yerel ayar uygulaması uygulamak istiyorsanız, obs_module_use_default_locale () makrosuna güvenmek yerine bu dışa aktarımı obs_module_text () ile birlikte tanımlamak istersiniz.
© Telif Hakkı 2017-2023, Lain Bailey.
Obs Studio, yeni tür kaynaklar, filtreler ve özellikler sağlayan çeşitli eklentileri destekler. Bazı eklentiler, Obs Studio’nun Elgato Stream destesi gibi belirli donanımlarla iletişim kurmasına da izin verir.
Bazı eklentiler Flathub üzerinden Linux kullanıcılarına da sunulmuştur.
Uyumluluk
Çoğu eklenti, Obs Studio’nun mevcut olduğu tüm platformlarda kullanılabilir olacak şekilde geliştirilmiştir. Ancak, bir eklentinin OBS Studio kopyanızla uyumlu olmayabileceği bazı durumlar vardır:
- Eklenti yalnızca bir platformda mevcuttur (i.e. Windows, macOS değil)
- Eklenti aynı mimari için mevcut değil (i.e. x86_64, ARM64 değil)
- Eklenti, kullandığınız Obs Studio sürümü için güncellenmedi
Obs Studio 28’de hangi platformlar için hangi eklentilerin mevcut olduğunu görmek için.0, Obs Studio 28 Eklenti Uyumluluk Listesine bakın.
Eklentileri yükleyin veya kaldırın
Obs Studio’nun en popüler eklentilerinin çoğu yükleyicilerle birlikte gelir. Genel olarak, eklentileri aşağıda listelenen yerlere yüklerler.
Bir eklenti manuel olarak yüklemeniz gerekiyorsa, ilgili dosyaların bu klasörlerin birine girmesi gerekir. Lütfen önce eklentinin belgelerini kontrol edin.
pencereler (tüm kullanıcılar)
C: \ Program Files \ Obs-Studio \ Obs-Plugins \ 64bit
pencereler
(Legacy 32-bit eklentiler; obs Studio 27.2.4 ve sadece önceki)C: \ Program Files \ Obs-Studio \ Obs-Plugins \ 32bit
(tek kullanıcı)
%AppData%\ obs-studio \ obs-plugins
Mac os işletim sistemi
~/Kütüphane/uygulama desteği/obs-studio/eklentiler
Linux
~/.config/obs-studio/eklentiler
Linux
(Flatpak)Flatpak kullanarak eklentileri yükleyin
Obs Studio’yu özel bir konuma yüklerseniz veya taşınabilir mod kullanırsanız, yükleyicinin hedef klasörünü özel konumunuzla değiştirmeniz gerekir Veri/Eklentiler dosya.
İçindekiler
- libobs/obs.H – Ana Libobs başlığı. Bu dosya aşağıdaki dosyaları otomatik olarak içerir: