Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Changes
Page history
Update gstreamer
authored
Nov 30, 2022
by
umaumax
Show whitespace changes
Inline
Side-by-side
gstreamer.md
View page @
b934983f
[[
_TOC_
]]
[[
_TOC_
]]
## official page
## links
公式ページ
[
GStreamer: open source multimedia framework
](
https://gstreamer.freedesktop.org/
)
[
GStreamer: open source multimedia framework
](
https://gstreamer.freedesktop.org/
)
## fpsを知りたい
公式リポジトリ
[
GStreamer / gstreamer · GitLab
](
https://gitlab.freedesktop.org/gstreamer/gstreamer
)
チュートリアル
[
Basic tutorial 1: Hello world!
](
https://gstreamer.freedesktop.org/documentation/tutorials/basic/hello-world.html?gi-language=c
)
公式のRustサンプル
[
tutorials · master · GStreamer / gstreamer-rs · GitLab
](
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/tree/master/tutorials
)
試してみた記事
[
\[ストリーミング技術\]RustでGStreamerチュートリアル 1: Hello World - Qiita
](
https://qiita.com/kyasbal_1994/items/a1a7d1bd5c4832947a8a
)
プラグイン一覧
[
Plugins
](
https://gstreamer.freedesktop.org/documentation/plugins_doc.html?gi-language=c
)
`gst-inspect-1.0`
を実行すると利用可能なエレメントが出力される
ライブラリソースコードがCで記述されている理由
[
Why is GStreamer written in C? Why not C++/Objective-C/...?
](
https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/general.html?gi-language=c#why-is-gstreamer-written-in-c-why-not-cobjectivec
)
## 概念
*
GStreamerではエレメントと呼ばれるプラグインパーツをつなぎ合わせてパイプラインとする。
*
エレメント同士をパイプラインとして接続するにはパッド(データの入出力口)を
`!`
で結合する表記となる。
*
結合することをリンクと呼ぶ。
*
用語
*
src: 入力エレメントの出力側
*
sink: 入力されるエレメントの入力側
## トラブルシューティング
### 動作確認サンプルコマンドが知りたい
ダミービデオがスクリーンに表示される
```
bash
# auto selection
$
gst-launch-1.0 videotestsrc
!
autovideosink
# Gtk
$
gst-launch-1.0 videotestsrc
!
gtksink
# OpenGL
$
gst-launch-1.0 videotestsrc
!
glimagesink
```
```
cacasink: cacasink: A colored ASCII art video sink
aasink: aasink: ASCII art video sink
```
H.264Encode&ファイル保存
```
bash
$
gst-launch-1.0 videotestsrc
!
x264enc
!
filesink
location
=
./out.h264
```
H.264デコード&再生
```
bash
$
gst-launch-1.0 filesrc
location
=
./out.h264
!
avdec_h264
!
autovideosink
```
### 正常に読み込まれていないエレメント一覧を知りたい
```
bash
$
gst-inspect-1.0
-b
```
不具合に対する対策として、キャッシュの削除
```
bash
rm
~/.cache/gstreamer-1.0/registry.aarch64.bin
```
初回のコマンド起動時のワーニングを再度確認するためにはキャッシュを削除する必要がある
### デバッグ情報が見たい
[
Running GStreamer Applications
](
https://gstreamer.freedesktop.org/documentation/gstreamer/running.html?gi-language=c#environment-variables
)
`GST_DEBUG`
環境変数を利用する
`GST_DEBUG=6`
とすれば
`LOG`
まで見れるが、
`GST_DEBUG=4`
(
`INFO`
)あたりがほどよいログの量である(0:nothing - 9:MEMDUMP)
### デコーダーランクについて
[
GStreamer - ArchWiki
](
https://wiki.archlinux.jp/index.php/GStreamer#.E3.83.87.E3.82.B3.E3.83.BC.E3.83.80.E3.83.BC.E3.83.A9.E3.83.B3.E3.82.AF.E3.82.92.E8.A8.AD.E5.AE.9A.E3.81.99.E3.82.8B
)
> 一部の NVIDIA ユーザーは gst-libav が nvcodec デコーダよりも Libav デコーダを優先してしまい、ハードウェアアクセラレーションを阻害してしまうことがあります。その為 GST_PLUGIN_FEATURE_RANK があります。環境変数 を使ってデコーダーのランク付けを行い、この問題を緩和することができます。
### fpsを知りたい
参考リンク
参考リンク
*
[
fpsdisplaysink
](
https://gstreamer.freedesktop.org/documentation/debugutilsbad/fpsdisplaysink.html?gi-language=c
)
*
[
fpsdisplaysink
](
https://gstreamer.freedesktop.org/documentation/debugutilsbad/fpsdisplaysink.html?gi-language=c
)
*
[
GStreamerで映像処理のボトルネックを見つける方法 - Qiita
](
https://qiita.com/sudamatthew95/items/9f300fc5555992bb8e8b
)
*
[
GStreamerで映像処理のボトルネックを見つける方法 - Qiita
](
https://qiita.com/sudamatthew95/items/9f300fc5555992bb8e8b
)
## 疑問
*
gstreamerを利用するプログラムを書く場合にはプラグインを作成する必要がある❓
## コード
[
gst_parse_launch
](
https://gstreamer.freedesktop.org/documentation/gstreamer/gstparse.html?gi-language=c#gst_parse_launch
)
を利用することで、文字列でパイプラインを構築できる
おそらく、
`gst-launch-1.0`
コマンドと同等な処理となる
\ No newline at end of file