「GStreamer」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
153行目: 153行目:
 
}}
 
}}
   
==== Set decoder ranks ====
+
==== デコーダーランクを設定する ====
   
{{Accuracy|Is {{ic|avdec_av1}} an actual plugin? It doesn't exist in the [https://gstreamer.freedesktop.org/documentation/plugins_doc.html plugin list].}}
+
{{Accuracy|Is {{ic|avdec_av1}} プラグインはの中に存在しない? [https://gstreamer.freedesktop.org/documentation/plugins_doc.html plugin list].}}
   
For some [[NVIDIA]] users, {{Pkg|gst-libav}} may prioritize the Libav decoder over [https://gstreamer.freedesktop.org/documentation/nvcodec/index.html nvcodec] decoders which will inhibit hardware acceleration. The {{ic|GST_PLUGIN_FEATURE_RANK}} [[environment variable]] can be used to rank decoders and thus alleviate this issue. See "GST_PLUGIN_FEATURE_RANK" in the [https://gstreamer.freedesktop.org/documentation/gstreamer/running.html#environment-variables documentation] for more information. For example:
+
一部の [[NVIDIA]] ユーザーは {{Pkg|gst-libav}} [https://gstreamer.freedesktop.org/documentation/nvcodec/index.html nvcodec] デコーダよりも Libav デコーダを優先してしまい、ハードウェアアクセラレーションを阻害してしまうことがあります。その為 {{ic|GST_PLUGIN_FEATURE_RANK}} があります。[[環境変数]] を使ってデコーダーのランク付けを行い、この問題を緩和することができます。詳しくは [https://gstreamer.freedesktop.org/documentation/gstreamer/running.html#environment-variables ドキュメント] "GST_PLUGIN_FEATURE_RANK" をご覧ください。例えば
   
GST_PLUGIN_FEATURE_RANK=nvmpegvideodec:MAX,nvmpeg2videodec:MAX,nvmpeg4videodec:MAX,nvh264sldec:MAX,nvh264dec:MAX,nvjpegdec:MAX,nvh265sldec:MAX,nvh265dec:MAX,nvvp9dec:MAX
+
GST_PLUGIN_FEATURE_RANK=nvmpegvideodec:MAX,nvmpeg2videodec:MAX,nvmpeg4videodec:MAX,nvh264sldec:MAX,nvh264dec:MAX,nvjpegdec:MAX,nvh265sldec:MAX,nvh265dec:MAX,nvvp9dec:MAX など。
   
  +
AV1 ハードウェアをサポートしていない場合や、無効にしたい場合、上記のリストに {{ic|avdec_av1:NONE}} と {{ic|av1dec:NONE}} を追加して下さい。(例えば {{Pkg|webkit2gtk}} 系ブラウザなど)
Those without AV1 hardware support may also want to disable AV1 decoders (e.g., for YouTube on {{Pkg|webkit2gtk}}-based browsers) by appending {{ic|avdec_av1:NONE}} and {{ic|av1dec:NONE}} to the list above.
 
   
 
== 参照 ==
 
== 参照 ==

2022年1月11日 (火) 04:37時点における版

GStreamer は GObject の型システムを使って C プログラミング言語で書かれたパイプラインベースのマルチメディアフレームワークです。

プログラマーは GStreamer を使うことで、単純な音声再生や動画再生から録画・録音、ストリーミング、編集まで、様々なメディア処理コンポーネントを作成することができます。パイプライン設計により、動画エディタやストリーミングメディアの配信プログラム、メディアプレイヤーまで幅広いマルチメディアアプリケーションの基礎となります。

クロスプラットフォームになるように設計されているので Linux (x86, PowerPC, ARM), Solaris (Intel, SPARC), macOS, Microsoft Windows, OS/400 上で動作します。GStreamer には Python, C++, Perl, GNU Guile (guile), Ruby などのプログラミング言語用のバインディングが用意されています。GStreamer はフリーソフトウェアであり、GNU Lesser General Public License でライセンスされています。

インストール

gstreamer パッケージをインストールしてください。

GStreamer を役立てるには、プラグインパッケージのインストールが必要になります:

  • gst-libav - 多数のデコーダとエンコーダが含まれている libav ベースのプラグイン。
  • gst-plugins-bad - 品質テストやドキュメントが必要とされるプラグイン。
  • gst-plugins-base - 重要で典型的な基本セット。
  • gst-plugins-good - LGPL ライセンスで配布されている高品質のプラグイン。
  • gst-plugins-ugly - 配布に問題がある高品質のプラグイン。
  • gst-plugin-libde265AUR - gstreamer 用の libde265 プラグイン (オープンな h.265 動画コーデックの実装)。

Usage

Using gst-launch-1.0

A helpful tool of GStreamer is the gst-launch-1.0(1) command. It is an extremely versatile command line tool to create GStreamer pipelines. It is very similar to and can do many of the things the FFmpeg command can do. Here are some examples:

Convert an MP4 file to MKV:

$ gst-launch-1.0 filesrc location=source.mp4 ! qtdemux name=demux matroskamux name=mux ! filesink location=dest.mkv  demux.audio_0 ! queue ! aacparse ! queue ! mux.audio_0  demux.video_0 ! queue ! h264parse ! queue ! mux.video_0

Using gst-discoverer-1.0

Another helpful tool is gst-discoverer-1.0(1), which is the GStreamer equivalent of FFmpeg's ffprobe(1).

Get info on a video file:

$ gst-discoverer-1.0 file.mp4
Properties:
  Duration: 0:02:55.613000000
  Seekable: yes
  Live: no
  container: Quicktime
    audio: MPEG-4 AAC
      Stream ID: c910ef2fa357f9f4ad365aebc98cfca88d23fdca99d832645f5113efa43b0cd3/002
      Language: <unknown>
      Channels: 2 (front-left, front-right)
      Sample rate: 44100
      Depth: 16
      Bitrate: 125588
      Max bitrate: 125588
    video: H.264 (Constrained Baseline Profile)
      Stream ID: c910ef2fa357f9f4ad365aebc98cfca88d23fdca99d832645f5113efa43b0cd3/001
      Width: 192
      Height: 144
      Depth: 24
      Frame rate: 15000/1001
      Pixel aspect ratio: 1/1
      Interlaced: false
      Bitrate: 107884
      Max bitrate: 107884

統合

PulseAudio

PulseAudio のサポートは gst-plugins-good パッケージによって提供されます。

PipeWire

PipeWire のサポートは gst-plugin-pipewire パッケージで提供されます。

KDE / Phonon の統合

KDE#Phonon を見て下さい。

ハードウェアアクセラレーション

ハードウェアビデオアクセラレーションを見てください。 GStreamer は自動的に正しい API を検出し、使用します [1] システム インストール に依存します。

ドライバのホワイトリストは無視する

GStreamer は、VA-API ドライバのホワイトリストを使用しています。ホワイトリストを無視して他のドライバのサポートを許可するには、環境変数GST_VAAPI_ALL_DRIVERS=1 を設定してください。

VA-API のサポート状況を確認する

VA-API サポートを確認するには

$ gst-inspect-1.0 vaapi
Plugin Details:
  Name                     vaapi
  Description              VA-API based elements
  Filename                 /usr/lib/gstreamer-1.0/libgstvaapi.so
  Version                  version
  License                  LGPL
  Source module            gstreamer-vaapi
  Source release date      date
  Binary package           gstreamer-vaapi
  Origin URL               https://archlinux.org/

  vaapijpegdec: VA-API JPEG decoder
  vaapimpeg2dec: VA-API MPEG2 decoder
  vaapih264dec: VA-API H264 decoder
  vaapivc1dec: VA-API VC1 decoder
  vaapih265dec: VA-API H265 decoder
  vaapipostproc: VA-API video postprocessing
  vaapidecodebin: VA-API Decode Bin
  vaapisink: VA-API sink
  vaapih265enc: VA-API H265 encoder
  vaapih264enc: VA-API H264 encoder

  10 features:
  +-- 10 elements

NVDECODE/NVENCODE 対応の確認 =

NVDECODE/NVENCODE の対応状況を確認するには

$ gst-inspect-1.0 nvcodec
Plugin Details:
  Name                     nvcodec
  Description              GStreamer NVCODEC plugin
  Filename                 /usr/lib/gstreamer-1.0/libgstnvcodec.so
  Version                  version
  License                  LGPL
  Source module            gst-plugins-bad
  Source release date      date
  Binary package           GStreamer Bad Plugins (Arch Linux)
  Origin URL               https://archlinux.org/

  nvh265enc: NVENC HEVC Video Encoder
  nvh264enc: NVENC H.264 Video Encoder
  nvvp9dec: NVDEC vp9 Video Decoder
  nvvp8dec: NVDEC vp8 Video Decoder
  nvh265dec: NVDEC h265 Video Decoder
  nvh265sldec: NVDEC H.265 Stateless Decoder
  nvjpegdec: NVDEC jpeg Video Decoder
  nvh264dec: NVDEC h264 Video Decoder
  nvh264sldec: NVDEC H.264 Stateless Decoder
  nvmpeg4videodec: NVDEC mpeg4video Video Decoder
  nvmpeg2videodec: NVDEC mpeg2video Video Decoder
  nvmpegvideodec: NVDEC mpegvideo Video Decoder

  12 features:
  +-- 12 elements

デコーダーランクを設定する

この記事またはセクションの正確性には問題があります。
理由: Is avdec_av1 プラグインはの中に存在しない? plugin list. (議論: トーク:GStreamer#)

一部の NVIDIA ユーザーは gst-libavnvcodec デコーダよりも Libav デコーダを優先してしまい、ハードウェアアクセラレーションを阻害してしまうことがあります。その為 GST_PLUGIN_FEATURE_RANK があります。環境変数 を使ってデコーダーのランク付けを行い、この問題を緩和することができます。詳しくは ドキュメント の "GST_PLUGIN_FEATURE_RANK" をご覧ください。例えば

GST_PLUGIN_FEATURE_RANK=nvmpegvideodec:MAX,nvmpeg2videodec:MAX,nvmpeg4videodec:MAX,nvh264sldec:MAX,nvh264dec:MAX,nvjpegdec:MAX,nvh265sldec:MAX,nvh265dec:MAX,nvvp9dec:MAX など。

AV1 ハードウェアをサポートしていない場合や、無効にしたい場合、上記のリストに avdec_av1:NONEav1dec:NONE を追加して下さい。(例えば webkit2gtk 系ブラウザなど)

参照