Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Azure Media Services のライブ配信のテストに使える、テスト用映像を ffmpeg で生成する。

Posted at

やりたいこと

  • Azure Media Services の Live Channel の機能をテストしたい

面倒なこと

  • RTMP を喋れるようなエンコーダーを用意するのが結構めんどくさい
  • テスト用映像を用意するのがめんどくさい
  • PC のライブカメラを使うと、自分の顔がずーっと流れてて残念な気持ちになる
  • 何秒くらい遅延しているかをテストするために、映像に時計の情報を入れたいがそれが結構めんどくさい

それ、ffmpeg で解決出来ました!

下記コマンドにて ffmpeg を起動するだけ!

testsignal-rtmpingest.bat
ffmpeg.exe -v verbose -re -f lavfi -i testsrc -f lavfi -i "sine=frequency=440:sample_rate=44100:beep_factor=8" -strict -2 -c:a aac -b:a 128k -ar 44100 -r 30 -g 60 -keyint_min 60 -b:v 400000 -c:v libx264 -preset medium -bufsize 800k -maxrate 400k -f flv rtmp://ライブチャンネル名.channel.media.azure.net:1935/live/自動生成されるパラメーター/mystream1

何をやっているか

  • ffmpeg のフィルターで testsrc を使って時計付きテストパターンを生成
  • 同じく、音声側は 440Hz のビープ音と、1 秒ごとの 3520Hz の短いビープ音の生成
  • x264 でエンコードして rtmp で指定したライブチャンネルにインジェスト

こんな感じ

ffmpegtest.png

ffmpeg ダウンロード先

こちらから!
https://ffmpeg.org/

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?