#incron
Explore tagged Tumblr posts
Text

I'm not surprised in the slightest lmao
Love the Guard lol
#this isn't a diss or anything either#I *am* that kind of basic bitch#im the Veteran Professional from *Incron* to be different#darktide#warham
58 notes
·
View notes
Note
"That's a new low for you."
She had strategically positioned herself so the hatch blocked her from view, but allowed Bill to see everything once he looked up. Her smirk was taunting and teasing, daring him to say absolutely anything. As much as he didn’t want to fall into her trap, he already had just by walking into the room
“Well, that’s a new low for you,” he rumbled. Her smirk grew wider. “You think you can waltz in here half-naked and I’ll agree to whatever you want.”
“Yes,” she answered despite his lack of an actual question. “I’m quite confident in that.” Her arms slowly crossed over her chest, but just below so her barely-covered breasts were still on display. His pants and lack of movement told her everything she needed to know.
“I’m not sending the Marines to the Incron Vale.” It was the same thing he had told her on the phone.
“Not Marines,” she clarified as she took a full step toward him, her hips swaying in a perfect distraction. “Just one or two.”
“I thought we agreed to keep leadership out of the bedroom.” His eyebrow arched up and he looked her over.
“You would’ve agreed anyway; that’s where my confidence lies. I just thought this would be more fun.”
He groaned softly, torn between arousal and frustration that she was always frakking right. Still, he resisted a moment longer. “Unarmed.”
“Agreed.” She stayed where she was and made him come to her, but he moved eagerly and immediately nudged her toward his rack.
11 notes
·
View notes
Text
gender roundup
rite: the one and only cis man in this retinue. good relationship with gender, far more concerned with performing loyalty to the emperor. It’s genuine, but psykers can never be too careful. he/him. gray ace but also probably the best person to go to for relationship advice because he knows how to act normal. if you want his attention you better WORK for it. show some decorum follow protocol etc
kal: trans man. never bothered with any transition either chemical or surgical, just started calling himself a guy one day back on incron and everyone had bigger things to worry about. took a grenade to the chest and took the opportunity to get everything hacked off. cares so little about “passing” that he effortlessly wraps around to the other side and he passes flawlessly. he/him. honestly, probably bisexual, but nobody’s going to check and he spends too much time inebriated for it to be morally permissible.
zed: agender, it identifies primarily as a guardsman. it’s from krieg, what does anybody really expect. it/its-they/them, nonnegotiable. bisexual (Hallowette is reasonable, but why Rannick? this krieger needs help).
mak/kenna: nonbinary femme trapped in the body of a grungy anxiety crier. for what they’ve been through, holding up pretty well! they’re exhausted all the time and everybody hates them and they know they’re one misstep away from being purged but they’re doing fine. maybe they’d like nicer clothes but they can’t have everything. they/them. bisexual. but who wants that.
#rite#kal#Zed#these names are short for something else etc. zed = zeta mak = makenna kal = call on the emperor#he changed his name not because of the gender but because he’s a zealot#text post#kenna
3 notes
·
View notes
Text
Monitorear archivos y carpetas en tu Linux con incron && incrontab
Monitorear archivos y carpetas en tu Linux con incron && incrontab
Gracias al feedback de nuestros lectores me han comentado del comando incron e incrontab, hoy vamos a ver como se instala y el uso que podemos darle para saber cuando se modifica, elimina, crea, etc, un archivo o el contenido de una carpeta, sin duda algo muy interesante.
Incrones una potente herramienta para monitorear la actividad del sistema de archivos. Consiste en un demonio y un manipulador…
View On WordPress
#configurar incron incrontab#Monitorear archivos y carpetas en tu Linux con incron && incrontab
0 notes
Link
1 note
·
View note
Photo
FFmpegでストリームから画像に出力する https://ift.tt/2x3g9z1
お久しぶりです。streampackのfadoです。花粉の季節到来に最近猛威を振るっている新型コロナウィルスに加えて、外出する気力が��われていきますよね。オリンピックの年ですし早く収束してくれることを祈ります!さて、今回はFFmpegというツールを使ってストリームを画像に変換する流れを紹介したいと思います。本記事で少しでもみなさんの参考になれたら嬉しいです!
注意事項
検証はAWS環境で行ったものとなります。
検証環境のOSはAmazon Linuxにしました。
入力ファイルはrtspストリーミングと想定しています。
Wowza Media Systems社が無料で提供するrtspストリームのサンプルを使用しています。
rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
作業の目的
rtspストリームをFFmpegを用いて画像(jpgファイル)に変換
出力されたjpgファイルをほぼオンザフライでS3に同期させます
AWSリソース
EC2
インスタンスタイプ: t2.small
OS: Amazon Linux
HDD: 30GiB
S3
EC2にアタッチするIAMロールやセキュリティグループの設定等は省略させていただきます。
検証環境の準備
1.jpg画像用フォルダーを作成
$ mkdir -p ~/images/test1
2.FFmpegのインストールとセットアップ。
自分でビルドする必要のないFFmpeg Static Buildsを利用します。
https://johnvansickle.com/ffmpeg/
$ wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz $ tar xvfJ ffmpeg-git-amd64-static.tar.xz $ sudo cp -av ffmpeg-git-20200211-amd64-static/ffmpeg /usr/local/bin/ $ sudo cp -av ffmpeg-git-20200211-amd64-static/ffprobe /usr/local/bin/ $ which {ffmpeg,ffprobe} /usr/local/bin/ffmpeg /usr/local/bin/ffprobe
$ ffmpeg -version ffmpeg version N-51730-gf15007afa9-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2020 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6) configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg libavutil 56. 39.100 / 56. 39.100 libavcodec 58. 68.102 / 58. 68.102 libavformat 58. 38.100 / 58. 38.100 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 75.100 / 7. 75.100 libswscale 5. 6.100 / 5. 6.100 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100
3.incronのインストール
incronはEPELレポジトリからインストールしますのでまずEPELリポジトリを有効にする必要があります。
$ sudo yum-config-manager --enable epel $ sudo yum -y install incron
バージョンを確認
$ incrond -V incrond 0.5.9
自動起動を設定し、サービスを起動
$ sudo chkconfig incrond on $ sudo /etc/init.d/incrond start
作業の手順
1.S3に同期させるためのスクリプトの作成
ソースのjpgファイルが削除されたらターゲットのjpgファイルも削除されるように --delete オプションを付けます。
BUCKET名は適切なものに書き換えてください。
aws-synctoS3.sh
#!/bin/bash /usr/bin/aws s3 sync /home/ec2-user/images/test1 s3://BUCKET名/images/test1 --delete
実行権限を付与
$ chmod +x ~/aws-synctoS3.sh
2.incrontabの設定
incrontab -eで設定
設定後、incrontab -dでテーブルをreload
どんなタイプが設定可能かincrontab -tで確認可能
incronのログは /var/log/cronに出力されます
$ incrontab -l /home/ec2-user/images/test1 IN_MODIFY,IN_CREATE,IN_DELETE,IN_ONESHOT,IN_NO_LOOP /home/ec2-user/aws-synctoS3.sh
・IN_MODIFY ファイルが上書きされた場合でもトリガーされる ・IN_ONESHOT イベントを一回のみ監視する ・IN_NO_LOOP イベントが完了するまで監視をしない
問題ないかログを確認しましょう。
$ sudo tail -f /var/log/cron Feb 21 01:23:09 ip-10-16-10-61 incrond[2727]: ready to process filesystem events Feb 21 01:49:01 ip-10-16-10-61 CROND[2776]: (root) CMD (/sbin/start --quiet update-motd) Feb 21 01:53:52 ip-10-16-10-61 incrond[2727]: table for user ec2-user created, loading Feb 21 01:55:31 ip-10-16-10-61 incrond[2727]: table for user ec2-user changed, reloading
3.バックグラウンドでFFmpegコマンドの実行
$ ffmpeg -rtsp_transport tcp -i rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov -f image2 -s 1920x1080 -r 15 /home/ec2-user/images/test1/image-%08d.jpg < /dev/null > /dev/null 2>&1 &
パラメーターの説明
-rtsp_transport rtspのトランスポートプロトコルを指定。udpでパケロスが生じた場合の回避策としてtcpに指定 -i 入力ファイルもしくはストリームを指定 -f フォーマットを指定。FFmpegは賢いのでこのパラメーターは省略しても問題ない -s 解像度を指定 (wxh) -r 出力ファイルのフレームレートを指定 %08d 出力のファイル名に8桁の数字で順番をつける < /dev/null > /dev/null 2>&1 & FFmpegをバックグラウンドで起動させ、FFmpegの��準出力と標準出力エラーを/dev/nullにリダイレクトする
jobsコマンドでバックグラウンドで動いているプロセスを確認できます。
$ jobs [1]+ 実行中 ffmpeg -rtsp_transport tcp -i rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov -f image2 -s 1920x1080 -r 15 /home/ec2-user/images/test1/image-%08d.jpg < /dev/null > /dev/null 2>&1 &
4.指定したフォルダーにjpgファイルができたことを確認
$ ls ~/images/test1/image-0000* | head /home/ec2-user/images/test1/image-00000001.jpg /home/ec2-user/images/test1/image-00000002.jpg /home/ec2-user/images/test1/image-00000003.jpg /home/ec2-user/images/test1/image-00000004.jpg
5.incronがトリガーされたことを確認
$ sudo tail -f /var/log/cron Feb 21 03:14:48 ip-10-16-10-61 incrond[2727]: (ec2-user) CMD (/home/ec2-user/aws-synctoS3.sh) Feb 21 03:14:49 ip-10-16-10-61 incrond[2727]: (ec2-user) CMD (/home/ec2-user/aws-synctoS3.sh) Feb 21 03:14:51 ip-10-16-10-61 incrond[2727]: (ec2-user) CMD (/home/ec2-user/aws-synctoS3.sh)
6.出力されたjpgファイルがS3に問題なく同期されたことを確認
結果
FFmpegを使ってrtspストリームを15fpsでjpg画像に変換することができました。出力されたjpgファイルをincronを用いてS3に同期させることもできましたので本記事の目的は達成できたかと思います。今回は15fpsを指定しましたので仕組み上、1秒に15回S3に同期されることになります。注意すべき点はFFmpegの処理よりもincronプロセスの方が高負荷であることです。30fpsや60fpsに変換したい場合や2つ以上のストリームの画像変換を試したい場合、jpgではなくpngで出力させたい場合などインスタンスタイプを変更しながら検証する必要が出てきます。
私が検証した環境ではt2.smallでFFmpegとincronと同時に走らせて15fpsならCPU使用率が約80%、ロードアベレージが1.5を超えた結果となりました。ギリギリですね。
感想
FFmpegはとても万能で動画や音声処理をするには欠かせないツールです。仕事でも動画変換をしたり動画配信したりでFFmpegを使う機会がたくさんあります。使いこなせていない機能もまだまだあります。FFmpegとはもっともっと仲良くなりたいなと考えている今日この頃の私です。実はAmazon Linux 2での検証もしてみたのですがAmazon Linux 2のEPELで採用されているincronのバージョンが新しくなり、IN_NO_LOOPがデフォルトとなったり、IN_ONESHOTは今回と��う動きを見せたりで少し苦戦していましたが再チャレンジし、いずれか報告できたらいいなと思っています。
参考文献
https://www.ffmpeg.org/ https://ffmpeg.org/ffmpeg-formats.html#image2-2 https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/image_sequence https://linux.die.net/man/5/incrontab
元記事はこちら
「FFmpegでストリームから画像に出力する」
March 02, 2020 at 12:00PM
0 notes
Text
Not expecting this to get any notes, this is more for myself cus I'm bored
Foehn-Amicus: Reject. Vanguard. Redeemer.
Born on Incron, Foehn-Amicus would have lived a life of drudgery of a filtration worker had her life not been changed by the arrival of the Lunar Class Cruiser Tempest. Fresh from the Fringe War, the ship was in need of crew replenishment and Foehn was one of many to be press ganged into service upon the Tempest, the incident leaving her an orphan when her parents resisted. Alone and ripped away from home, Foehn found not much change in her life, simply trading the dragging of algae tanks to the lugging of munitions. But, fortune found Foehn and she caught the attention of a veteran voidsmen who found potential in her steely gaze. Trained alongside other aspirants, Foehn was inducted into the Voidsmen of the Tempest at the tender age of 17. It was here she honed her sense of command and discipline. She quickly rose through to a squad leader at only 23, an inspiring and imposing presence. Her life changed when the Tempest returned to Incron to restock. She had run afoul with a noble of moderate standing whom she assaulted after they had made a comment upon the Fringe War. The incident led to a charge of insubordination that saw her rank, and even place on the Tempest stripped away from her. She was picked up by the Tancred Bastion on route to a penal colony. Of course, this is what started her path to becoming a Reject. Though in the beginning she attempted to portray herself with the same aura of command as her service with the Voidsmen, she quickly found the hive of Tertium to be a much different battleground. The commanding presence painted her a target, to both the heretics looking to knock her lights out and a specific few of her fellow rejects. She found herself changing strategy, keeping her fellow rejects in the fight was more important than the minutia of how they did it. When she had finally cleared her name and officially joined Inquisitor Grenyl's warband, she was a unique kind of squad leader. Often she would slip into the shadows of the hive to either execute a priority target or give a hand to a fallen comrade, before leading the charge as the vanguard to her squad. Though some of her fellow veterans rib her for her straight laced tendencies, and she gets into more than a few fights with the preachers, Foehn-Amicus is both the blazing vanguard of the emperor and the helping hand to the martyrs of another day.
#me really enjoying the agrippina shotgun was just a pleasant coincidence for the backstory lol#yes I am writing lore for my character for why I switched from mainly playing Voice of Command Vet to Infiltrator Vet#warham#darktide#my writing#darktide era Foehn is like. 30-ish#she had a good 10 years as a Voidswoman
2 notes
·
View notes
Text
[플밍] cron과 incron 한글 문제
$ locale > /etc/default/locale
이 커맨드로 디폴트 환결설정을 세팅해 주면 된다. cron/incron이 실행될 때 이것을 읽는가 보다.
service incron restart 하는 것을 잊지 않길..
incron 은 별로 자료가 없지만 cron과 거의 흡사하여 큰 문제는 없다.
http://www.logikdev.com/2010/02/02/locale-settings-for-your-cron-job/
update 140101) 이 설정은 Amazon Instance를 리부트할 때마다 실행시켜줘야 함.. 왜 그런지 모르겠음. 덤으로 리부트 후에는 broken pipe를 막기 위해 /etc/ssh/sshd_config에 아래를 추가할 것.
KeepAlive yes ClientAliveInterval 60
cd ~/domain.com git init git add . git commit -m "initial import of pre-existing web files" cd ~/hub.domain.com git --bare init cd ~/domain.com git remote add hub ~/hub.domain.com git push hub master cd ~/dev.domain.com git clone ~/hub.domain.com git remote rename origin hub
0 notes
Photo

flvファイルをS3へアーカイブ https://ift.tt/325fRBS
はじめに
streampackのメンバーになって2ヶ月目のrisakoです。 今回の記事は、理解に苦しんだ仕組みの一つである「S3へのアーカイブ」をテーマにしました! これから、S3で動画配信をしてみたいと思っている方のヒントになれば幸いです。
S3とは?
S3 はSimple Storage Serviceの略称のことをいう。 クラウド型オブジェクトストレージサービスで、東京リージョン・スタンダードストレージの場合、1GBあたり0.025ドルで利用できる。 公式には99.999999999%の耐久性で、安さと高可用性を兼ね備えている。
イメージ
今回は、点線で囲まれている部分について説明します。

出典:https://cloudpack.media/43892
nginx.confの編集
flvファイルを作成できるようにnginx.conf内に追記する。 下記の設定をすることで、flvファイルを作成できるようになる。
application live { live on; record all; record_path /var/video_recordings_flv; record_unique on; }
今回の設定では record all オーディオ、ビデオ共に全てをレコードする record_path flvファイルの場所を指定する。今回は、/var/video_recordings_flvにflvファイルが保存されるように指定。 record_unique on常に新しい状態のファイルに更新される設定。デフォルトではoffになっている。
確認
OBSで配信した動画ファイルが指定した場所に作成できているか確認する。
#ls -l /var/video_recordings_flv/ total 6144 -rw-r--r-- 1 nobody nobody 6289402 Jul 17 19:09 test-1563416738.flv
作成できているので、このファイルをS3にアップロードする。
S3へのアップロード
AWS CLI でアップロードを行う。 事前準備として、#aws configureでアクセスキー・シークレットキー・リージョン名・出力形式を入力する。この作業をしていないと、Unable to locate credentials. You can configure credentials by running "aws configure".このようなエラーで怒られてしまうので注意。
確認
OBSで配信し、指定の場所に作成できているflvファイルをaws s3コマンドでアップロードしてみる。 作成されているflvファイルがtest-1563416738.flvなので、まずは、これをアップロードしてみる。
#aws s3 cp test-1563416738.flv s3://<S3バケット名>/
【S3上でアップロードがされているか確認する】

incrontabを使ってアップロードする
作業 コマンド インストール yum –enablerepo=epel install incron 起動 /etc/init.d/incrond start 停止 /etc/init.d/incrond stop
スクリプト作成
スクリプトに書き込むための権限変更を行います。
#chmod 755 aws_test.sh #ls -l total 4 -rwxr-xr-x 1 root root 0 Jul 18 14:54 aws_test.sh
作成したスクリプト内を変更。
#!/bin/bash aws s3 sync /var/video_recordings_flv s3://<S3バケット名>/
反映させます。
#aws_test.sh
incrontab設定
#incrontab -e /var/video_recordings_flv IN_MOVED_TO,IN_CREATE,IN_CLOSE_WRITE,IN_NO_LOOP /root/bin/aws_test.sh #incrontab -d #incrontab -l /var/video_recordings_flv IN_CREATE,IN_CLOSE_WRITE,IN_MOVED_TO,IN_NO_LOOP /root/bin/aws_test.sh
OBSで配信・確認
#tail -f /var/log/cron Jul 18 17:17:23 ip-10-15-0-165 incrond[4135]: (root) CMD (/root/bin/aws_test.sh) #ls /var/video_recordings_flv/ test-1563358109.flv test-1563419519.flv test-1563433417.flv test-1563437843.flv
S3上での確認

/var/video_recording_flv/の配下に作成されているflvファイル名と、S3上にアップロードされているファイル名が一致していることから、正しくアップロードできていることが確認できます。
最後に
S3へのアーカイブは手順さえ理解してしまえば、簡単にアーカイブできるということがわかりました。 これからS3を駆使してstreampackのメンバーとして頑張っていきます!
参考
「HLSライブストリーミングサーバーs3配信」 https://cloudpack.media/43892
「AWS CLIでS3を操作するコマンド一覧」 https://qiita.com/uhooi/items/48ef6ef2b34162988295
元記事はこちら
「flvファイルをS3へアーカイブ」
August 27, 2019 at 12:00PM
0 notes
Photo
HLSライブストリーミングサーバーs3配信 https://ift.tt/2yZRNmS
こんにちはhagiです。
前回AWS EFS でHLS配信を書きました。
MediaServicesが出る前にNFSやs3fsで共有領域をマウントして配信を検討していた時期があったので「あの時あればどうなっていたかな?」という疑問を解決するためにやってみます。
そこで”ああ!s3格納の事書いてなかった”、となり今回はライブ配信をs3に格納する方法を記述したいと思います。
はじめに
今回はライブ配信をAmazon s3に格納する方法を記述します。 もう少し細かく書くとHLSライブストリーミングサーバーの構築 (ABR対応)で作成したHLSデータをs3から配信します。
Amazon s3とは
s3は格納ですがwebコンテンツの配信も可能です。 その上s3は 99.999999999% の耐久性 でスタティックコンテンツ配信するのには最強ではないでしょうか? (個人的意見です)
Amazon s3 どこからでもお好みの量のデータの保存と取得が簡単に行えるオブジェクトストレージ
(https://aws.amazon.com/jp/s3/)
ストリーミングサーバーの構築
まずは下記に記述している手順でHLSストリーミングサーバーを構築します。
HLSライブストリーミングサーバーの構築 (ABR対応)をご確認ください。
s3への転送
ライブ配信はコンテンツの提供タイミングが非常に重要です。 HLSはそもそもセグメントに分けられており、プレイリストはセグメント毎に更新されクライアント(視聴)はプレイリストに記述されたデータファイルを取りにきます。
そこでEC2上で作成したストリーミングサーバー(この構成の場合はトランスコーダーですが。。。)でセグメントやプレイリストが出来次第s3に転送する必要があります。
いろいろ方法はあると思いますが今回紹介したいのがinotifyを使ったincrondです。
incrond
inotifyのcronデーモンとなります。 inotifyの仕組みを使ったcronデーモンでファイルの作成、編集、削除���検知しそれに合わせてコマンドやスクリプトをcronのように実行できます。
inotifyとは
inotify (inode notify) とは、ファイルシステムへの変更を通知するようファイルシステムを拡張して、その変更をアプリケーションに報告するLinuxカーネルサブシステムである。inotifyに先行して存在し、類似の目標を持つdnotify(英語版)は、inotifyに取って代わられている。
https://ja.wikipedia.org/wiki/Inotify
incronのインストール
$ sudo yum install incron
デーモンの起動
$ sudo /etc/init.d/incrond start
デーモンのヘルプ
$ incrond -h incrond - inotify cron daemon (c) Lukas Jelinek, 2006, 2007, 2008 usage: incrond [<options>] <operation> may be one of the following: These options may be used: -?, --about gives short information about program -h, --help prints this help text -n, --foreground runs on foreground (no daemonizing) -k, --kill terminates running instance of incrond -f <FILE>, --config=<FILE> overrides default configuration file (requires root privileges) -V, --version prints program version For reporting bugs please use http://bts.aiken.cz
incrontab
incrondにて登録をする際incrontabコマンドを利用します。crontabと利用方法は似ています。
incrontab man ページ
$ man incrontab : : -l (or --list) option causes the current table is printed to the standard output. -r (or --remove) option causes the current table (if any) is permanently remove without any warning or confirmation. Use with caution! -e (or --edit) option causes executing an editor for editting the user table (see below for the information about editor selection). You can edit your incron table now. If the table is changed it stores the modified version. -t (or --types) option causes the list of supported event types (delimited by commas) is printed to the standard output. This feature is intended for front-end applications to find out which event types was compiled in. -d (or --reload) option causes reloading the current table by incrond(8). It is done through "touching" the table (writing into it without modifying it). This feature is intended e.g. for creating watches on newly created files (with already existing rules) or for rearming IN_ONESHOT watches.
incrontab man ページ セクション5
$ man 5 incrontab : : EVENT SYMBOLS These basic event mask symbols are defined: IN_ACCESS File was accessed (read) (*) IN_ATTRIB Metadata changed (permissions, timestamps, extended attributes, etc.) (*) IN_CLOSE_WRITE File opened for writing was closed (*) IN_CLOSE_NOWRITE File not opened for writing was closed (*) IN_CREATE File/directory created in watched directory (*) IN_DELETE File/directory deleted from watched directory (*) IN_DELETE_SELF Watched file/directory was itself deleted IN_MODIFY File was modified (*) IN_MOVE_SELF Watched file/directory was itself moved IN_MOVED_FROM File moved out of watched directory (*) IN_MOVED_TO File moved into watched directory (*) IN_OPEN File was opened (*) : : IN_DONT_FOLLOW Don't dereference pathname if it is a symbolic link IN_ONESHOT Monitor pathname for only one event IN_ONLYDIR Only watch pathname if it is a directory
登録内容確認
$ sudo incrontab -l
登録
$ sudo incrontab -e
ライブ配信の転送
上記のincrondを利用してm3u8の書き込みが完了した際にs3に転送するよう設定することができます。
例:
例えばtest.m3u8が変更、作成、削除された場合、s3_sync.shを実行し一度だけ実行して重複して実行しない。
$ sudo incrontab -l /live/test.m3u8 IN_MODIFY,IN_CREATE,IN_DELETE,IN_NO_LOOP s3_sync.sh
それでs3_sync.shに下記のようにs3 syncコマンドで実行する。
aws s3 sync /live s3://XXXXXXX/live/
最後に
結論としてはs3にHLSのファイルを転送するにはincrondは使えます。 転送されたあとs3から配信が可能となり配信サーバーのスケールを考える必要は無くなります。
元記事はこちら
「HLSライブストリーミングサーバーs3配信」
October 23, 2018 at 12:00PM
0 notes