2018,江端さんの忘備録

(昨日の続きです)

(Continuation from yesterday)

「夢を語る子どもにとって、全ての大人は敵である」

"All adults are enemies against all children who tell their dream."

これが正しい社会の姿です。

This is a correct social figure.

-----

As an adult, I knew the importance of "No listening to others talk."

「人の話を聞かない」ことを心掛けるようになってから、私は、いくつかの(小さな)夢を、ポツポツと達成することができるようになったと思います。

After keeping my eye open for "No listening to other's talk," I believe I could start translating my dream into action, even if the goal is small.

そして、その過程で知ったことは、「人の話を聞かない」を挫く最大の敵は、ネットであるということです。

In addition, I knew that the worst enemy was Internet communication to interfere in "No listening to other's talk."

「ネット」の中に閉じ込もり「夢を持ち得ない者」にとって、夢を語る人の中で、特に「何かを創作する人」は、常に憎悪の対象です。

For persons who cannot have their dream in the closed universe, a "creator" in dreamers is an outlet for hostility.

Twitterであれ、Lineであれ、Facebookであれ、掲示板であれ、ネットの向こう側にいる人間の全ては、「何かを創り出そう」とする、あなたの行動を妨害しようとします ―― 批判とか批評とかという形を装いながら。

On the Internet, they are trying to interfere with you, if you are a creator, with Twitter, Line, Facebook, and other bulletin boards, giving the appearance of reviewers or critics.

-----

逆から見れば、

From the opposite direction,

もし、あなたが、何かを創り出そうとしているのであれば、

if you want to create something new,

何も創り出さない/出せない奴は ―― 誰であれ ―― あなたの敵になります。

any person who doesn't / cannot make things will be your enemy.

2023,江端さんの忘備録

今週末、『もう動くだろう』と高を括っていたコードが動かなくて、丸1日半の時間が溶けました。

This weekend, a whole day and a half of my time melted away because the code I was so high on, 'it will work now,' didn't work.

しかも、今も動いていない。

And it is still not working.

最近は、朝、起きると、長いToDoリストが頭の中を流れて、それだけで憂鬱(ゆううつ)になっています。

Lately, when I wake up in the morning, a long to-do list flows through my head, and that alone is enough to make me feel depressed.

そんな中の、1.5日というのは、本当に辛い。

In such a situation, 1.5 days is tough.

-----

世の中には、(A)時間をかければ何とかなるものと、(B)時間をかけても何ともならないものがあります。

There are two things in the world: (a) things that can be worked out over time and (b) things that are nothing to be worked out over time.

で、上記(B)の中には、自分の努力とは無関係の理由で、何ともならないものがあり、それが、プログラミングやシステムだったりします。

So, some of the above (b) will not happen for reasons unrelated to your efforts. Programming and systems are that.

コラムは時間をかければ、ネタが出てきます。

Columns will come up with stories if you give them time.

特許やペーパーも何とかできます。

I can also manage patents and papers.

少なくとも、時間を見積ることができます。

At the very least, I can estimate the time.

しかし、プログラムとシステムだけは、本当に、どこでハマるか予測できないのです。

But only programs and systems can't predict where I will get stuck.

-----

という訳で、この週末は、ひたすら辛く、暗かったです。

So, this weekend was just hard and dark.

明日からの仕事の目処もつかず、非常に気が重いです。

I am very depressed because I have no idea what to work tomorrow.

『自分で頑張るのも、ほどほどにしておかなければ』ということですね。

2015,江端さんの忘備録

(昨日の続きです)

(Continuation from yesterday)

もうこれ以上はダメだ ―― と、先日会社の診療所にいったら、サクッと、この「セルシン」を処方して貰えました。

After I thought I could do nothing, I went to a clinic of my company, and the doctor prescribed the drug "Cercine" for me.

これが、凄くてですね、朝方、セルシンを一錠飲み込んで、布団の上に倒れこんでいるいると、ホワイトボードが頭の中から消えていくんです。

This drug is more significant than I expected. After taking an ace, the whiteboard disappears in my head, lying asleep.

ホワイトボードがなくなって、ホッとしているところで、目覚まし時計のアラームに起こされる、ということができます。

After I feel relieved to confirm the whiteboard is leaving, I can wake up by an alarm clock.

十分な睡眠ではないかもしれませんが、鉛のような体を引きづって歩いていた日々を考えると、

According to the day, I have to move my body such as lead, even if the sleep might not be enough for me,

そりゃもう

Sure,

『毎日がエブリディ』(著名な元野球選手のお言葉)

"Every day is every day" (It is a proverb of a famous former baseball player)

ですよ。

-----

まあ、何が言いたいかと言いますと、

What I want to say is,

『自分で頑張るのも、ほどほどにしておかなければ』ということですね。

"Everything I am going to do should be a halfway solution."

不眠やうつ状態が、続くのであれば、精神科でも心療内科でも、とっとと行っちゃおう、ということです。

If sleeplessness and a depressed mental state continue, we should go to psychiatry or psychosomatic medicine as soon as possible.

今の私は、安定剤の耐性がついて、効果が失われてしまうことが一番怖いのですが、まあ、『その時は、その時考えよう』と思います。

Now I am scared to get the stabilizer's tolerance and lose the drag's effect. But I think about it again when the problem is going to happen.

「鉛の体」は、本当に重いのです。

Anyway, the body, such as a lead, is hefty.

-----

私が、誤作動で壊してしまったパソコンをリストアできるように、壊れてしまった心や体を、直せる人も沢山いるのですから。

Some persons can cure broken minds and bodies like I can restore the PC I broke by my malfunction.

2023,江端さんの忘備録

NHKのダークサイドミステリ「悪魔はいた!? 世界衝撃のエクソシスト裁判?誰が少女を殺したのか?~」を見ていました。

I watched the NHK program, dark side mystery "The Devil Was There! The World Shocking Exorcist Trial? Who Killed the Girl? ~".

その番組の中でコメンテータが、アウシュビッツの話を語っていました。

A commentator on that program talked about Auschwitz.

それを聞いて思い出したことがりました。

This reminded me of something.

小学生の頃、教師がナチス政策の一つである、いわゆる『ユダヤ人問題の最終解決』の話をしかけた時、

When I was in elementary school, a teacher was about to talk about one of the Nazi policies, the so-called "Final Solution of the Jewish Question" She said to me,

『うーん、これについては、江端君の方が上手く説明できそうですね。頼めますか?』

'Hmmm, I think Ebata-kun can explain this better than I can. Can you do it?'

と、小学4年生の私に、この話の解説をふりました。

At this time, I was in the fourth grade.

-----

実際に、私の方が詳しかったです。

I was more familiar with this kind of thing.

殺害された人物の数について、当時の私たちの街の人口数を出して、そのスケール感を説明するなど、小学生としては、まずまずの説明ができたと思います。

I explained the scale of the number of people killed by giving the population numbers of our city at the time. For an elementary school student, I think I did an excellent job of explaining it.

-----

ただ、

However,

世界の(日本も含む)虐殺史に精通した小学生 ―― これは子どもはもちろん、大人から見ても『嫌な小学生だったろうな』と思います。

An elementary school student familiar with the history of the world's (including Japan's) genocide -- This must have been a 'disgusting elementary school student,' not only from a child's point of view but also from an adult's point of view.

私のティーンエイジャ時代に「明るい」とか「楽しい」とかの記憶が少ないのは、仕方がなかったのかもしれない、と思い返しています。

I think back to my teenage years and recall that it may have been inevitable that I have few memories of "cheerful" or "fun" times.

―― 江端さんって、ナチズムの信奉者なのですか?

 

2014,江端さんの忘備録

宇宙戦艦ヤマトは素晴しい作品です。2199は特に素晴らしかったです。

"Space battle ship YAMATO" is really excellent. Especially the version of "2199" is splendid.

しかし、私がものごころついたころから、どうしても納得できないセリフがあります。

There are however, the lines that I can never understand since I can remember.

「エネルギー充填120%!」

"120% of energy filling"

-----

なぜなら、この後に続くシーンは、こうなるはずだからです。

The scene must be the followings.

「エネルギー過充填にて、エネルギー伝導導管破砕! 」

"Excessive energy is filling and the energy conduction pipes are crushed!"

「波動エンジン、筐体強度臨界を突破します!」

"The wave engine is going to be broken through the housing strength critical point!!"

「ヤマト、爆発します!!」

"Yamato will explode!”

漆黒の宇宙空間が、目映い光で覆われた後、ゆっくりと元の状態に戻り、エンディングテーマとテロップが流れる。

After dazzling light over outer space of the jet black covered, it returns to an original state slowly, and an ending theme and a telop are appeared.

―― 宇宙戦艦ヤマト 完

Space battle ship YAMATO is completed.

―― スペックを守らなかった戦士達

Soldiers who did not follow specifications

------

どんな機械であれ、スペックの上限を超えて使ってはダメです。

You should not use any machine over the limitation of specification.

120%も充填したら、未来の宇宙戦艦だって壊れますよ。本当の話です。

If you fill more than "100%" of energy, even if it is a future space battle ship, the ship is going to be destroyed. It is a true story.

"120%"に、「なんか凄い」を込めたい気持ちはよく分かるのです。

I can understand the feeling that someone want to load "something great" in the world "120%".

しかし、技術立国日本を維持する為には、まず、機械の常識を少年少女達に理解して貰わなくてはなりません。

However, if we should maintain "technical nation, Japan", at first you must have boys and girls understand the common sense of the machine.

------

他は何も直さなくてもいいから、この「120%」というコンセプトだけは、なんとかなりませんかね?

I think that you don't have to modify anything but the concept of "120%".

2023,江端さんの忘備録

―― まさか、今さら警察当局から削除命令受けるとは思わなかった

昨日のブログを見なおして、改めて思ったのですが。

I was thinking about this again after reviewing yesterday's blog.

私の、「やさしい水素爆弾の作り方」が当局から削除命令を受けるのであれば、

If my, "How to build a hydrogen bomb the easy way" is ordered to be deleted by the authorities,

コミック&アニメの「Dr.STONE」は、発行禁止命令が出てもいいんじゃないか、と思うんですけどね。

I think the comic & animated "Dr. Stone" should have a no-publication order.

―― "Dr STONE"というアニメが面白い

もっとも、本当にそんな命令が出たら、私は命令の無効の訴えの原告団に入るつもりはありますが。

However, if such an order is indeed issued, I would join the plaintiffs in an action to invalidate the order.

-----

というか、爆発物の製造について記載されているコミックなんて、私、思いつくだけでも、5つは挙げられます。

I mean, I can name five comics that describe the manufacture of explosives, just in my memory.

ただ、それらの本は、原料は記載されていても、配合率とか、製造プロセスが、具体的に記載されていないので、セーフになっているのかもしれません。

However, those books may be safe because they list the ingredients, but do not specifically describe the ratio of ingredients or the manufacturing process.

確かに、数字の入っていない爆発物マニュアルなんて、全く役に立ちませんから。

Certainly, an explosives manual without numbers in it would be completely useless.

2019,江端さんの忘備録

まあ、理系のエンジニアとしては、仕方ないと思うのですが、今クールでは、

I think it cannot be helped as an engineer,

―― "Dr. STONE"というアニメが面白い

"The animation "Dr. STONE" is making me fun"

です。

突如発生した謎の石化減少によもる全人類の滅亡から、約3700年後に目覚めた現代の高校生が、全ての文明を失った世界で、科学の力を使って、文明を取り戻していく物語です。

A story is that a modern high school student who awakened about 3700 years after the sudden destruction of the mysterious petrification that occurred suddenly, and he comes to get civilization using the power of science in the lost world.

まだ、少年(少女?)たちに、このようなガチの科学マンガがウケているのかと思うと、とても嬉しいです。

I'm very happy to think that boys (and girls?) accept such scientific manga.

-----

私も、よく小学校の科学実験室から、ヨウ素液やら塩酸やらをパクっていました。

I also often stole iodine and hydrochloric acid from elementary science laboratories.

クリスマスプレゼントに、両親から、フラスコ、ビーカー、試験管、アルコールランプ一式を買って貰いました。

My parents gave me a set of flasks, beakers, test tubes, and alcohol lamps, as Christmas presents,

今だに、あの「嬉しさ」を超えるプレゼントを貰ったことはありません(今も、実家に残っています)。

I have never received a gift exceeded with joy (They still remain at home).

その後も、私は、火薬の調合したり、石油やガソリンの燃焼実験をやっていましたし、大学生になってさえ、塾の子供達に向けて「水素を使った爆破実験」をやっていたことはご存知の通りです。

Even after that, I was preparing explosives and experimenting with burning oil and gasoline. As you know, even when I was a college student, I was doing a "bomb-explosion experiment using hydrogen" for school children.

-----

Dr.STONEの主人公の、石神千空(いしがみ せんくう)は、「唆るぜ、これは」という口癖を繰り返し、また修飾語として「100億パーセント」という言葉をよく用いているようです。

Dr. STONE's protagonist, "Ishigami Senkuu", repeats the phrase "This inspires me" , and often use the word "10 billion percent" as a modifier.

この「100億パーセント」というフレーズ、私は嫌いではありません。

I like this "10 billion percent" phrase.

しかし、この主人公が現実の世界に存在したとしたら、使わないだろうな、とも思っています。

However, if this hero exists in the real world, I don't think he will use it.

以前も記載しましたが、私、宇宙戦艦ヤマトの名台詞

As I mentioned before, I don't like the following famous phrase of the animation "Space Battleship Yamato"

『エネルギー充填120%』

"Energy filling 120%"

というのが、どうにも好きではありませんでしたから。

この辺については、

About it, please read

"Space battle ship YAMATO. Soldiers who did not follow specifications"

を、ご一読下さい。

2023,江端さんの忘備録

私の代表作のコラムといえば、「やさしい水素爆弾の作り方」でしょう。

One of my best-known columns is "How to Build a Gentle Hydrogen Bomb."

このコラムは、塾の講師であった私が、小学生の子どもと一緒に、食塩水を電気分解して発生した水素の燃焼実験の様子を、コミカルに記載したものです。

This column is a comical description of a combustion experiment in which I, as a cram school instructor, worked with elementary school children on hydrogen combustion generated by the electrolysis of brine solution.

言うまでもありませんが、単なる化学反応の話が記載されているだけで、核融合反応の話など1mmも出てきません。

Mere chemical reactions are described, and fusion reaction is not mentioned.

そもそもこのコラムをWebにアップしたのは、1996年 ―― 27年前です。

I first posted this column on the Web in 1996, 27 years ago.

―― まさか、今さら警察当局から削除命令受けるとは思わなかった

-- I didn't think I'd get an order to delete it from the police authorities now.

―― でもって、まさか、プロバイダから『命令に応じない場合は、サービスを停止する』と宣言されるとは思わなかった

-- But then, I didn't expect the provider to declare, 'If you don't comply with the order, we will suspend your service.

-----

どう考えても、私のこのコラムの出版権(Web掲載権)の侵害です。

This infringes my right to publish this column (right to post on the Web).

そもそも、警察にどうこう言われる内容ではないことも明らかです。

In the first place, it is also clear that this is not what the police have to say about the matter.

さらに、コンテンツに問題があったとしても、法律制定前の記載であれば、「法の不遡及の原則」から鑑みて、この命令自体が逆に違法行為に問われます。

Furthermore, even if there were problems with the content, if the statements were made before the law was enacted, the order itself would be charged with illegal acts, given the "principle of non-retroactivity of the law" to the contrary.

ただ、今回の警察の命令に記載されていた、『爆発物取締罰則』という内容が気になって調べてみました。

However, I was curious about the "Explosives Control Penalties" listed in this police order and looked into it.

「明治十七年太政官布告第三十二号(爆発物取締罰則)」という恐ろしく古い法律が根拠条文のようです(この場合、「法の不遡及の原則」では抗弁できません)。

It seems that the basis of the law is an old law called "Dajokan Houmu No. 32 (Explosives Control Penal Provisions) of 1884" (in this case, the "principle of non-retroactivity of law" cannot be used as a defense).

カタカナで記載されている条文で読みにくかったのですが、私は、第1条の『治安ヲ妨ケ又ハ人ノ身体財産ヲ害セントスルノ目的ヲ以テ爆発物ヲ使用シタル者及ヒ人ヲシテ之ヲ使用セシメタル者』の主体に該当しないので、この法律自体の適用がおかしい。

It wasn't easy to read the article because it was written in Katakana. Still, I do not fall under Article 1, "Persons who use explosives to disturb public order or harm human life or property, and persons who use explosives to harm human life or property." Hence, the application of this law itself is not correct.

ただし、この条文については、最高裁の判断として、

However, the Supreme Court's decision on this article, i interpreted as follows,

「理化学上の爆発現象を惹起するような不安定な平衡状態において、薬品その他の資材が結合する物体であって、その爆発作用そのものによって公共の安全をみだし、または人の身体財産を害するに足る破壊力を有するもの」(最判昭和31年6月27日刑集第10巻6号921頁)

"An object in which chemicals and other materials are combined in an unstable equilibrium state that causes physical and chemical explosive phenomena, and the explosive action itself has sufficient destructive power to endanger public safety or damage human bodies and property" (June 27, 1956, Penal Code, Vol. 10, No. 6, p. 921).

という解釈がされています。

まあ、普通に考えて、故意または過失、という要件が必要になるとは思いますが、そうだとしても法律の対象が「製造者」になるのは言うまでもありません。

Well, I think the usual requirement of intent or negligence would be necessary, but even if that were the case, it goes without saying that the law would cover the "manufacturer."

つまり、警察当局は『私が、法律の素人だと思って、このような警告をしてきた』のだろう、と推認されます。

In other words, it can be inferred that the police authorities thought I was a layman in the law and gave me this warning.

-----

これについて、『当局とバトルして、その様子をブログに連載にするのはどうかな? 』とも思ったのですが、正直

I thought, 'Why don't I battle with the authorities about this and write a series of blog posts about it? But, to be honest, I thought

―― 面倒くさい

"That's a pain in the ass."

と、思いました。

それと、『この実験を、安易に子どもがマネするかもしれない』という危惧は、いつでもありました。

And there was always the fear that 'children might easily copy this experiment.

だからこそ、この実験の危険性については、コラムの中で山ほど記載していたのですが、子どもというのは「やるときにはやる」ものです。

That is why I have described the dangers of this experiment so much in my column, but children are "doers when they do it."

そして、これで事故が発生して、私の名前が予想せぬ形で全国に知れ渡るのは、私も嫌です。

And I would hate for this to cause an accident and for my name to be known all over the country unexpectedly.

-----

色々考えた結果、今回、私は、コンテンツの削除に応じることにしました。

After much consideration, I have decided to respond to the removal of the content.

―― 江端が、当局(権力)に対して日和った

"Ebata waited and saw and was assigned against the authorities (power)."

と、大いに吹聴して下さい ―― というか、今さらですが、私(江端)は、常日頃から日和っています。

And please blow it up a lot -- I mean, it's a little late for that, but I (Ebata) have always waited and saw.

権力どころか、社内のチームリーダーにさえ、日和っています。

Not only for power but also as a research teams reader in my company

2023,江端さんの技術メモ

最近、映像制御の仕事をすることになりました。

WSLを使って、作業効率をはかりたいと考えていますが、WSLは基本的にコマンドインターフェースなので、表示システムを作らなければなりません。

「Windows11にWSL2+Ubuntu20.04をインストールする」を試してみて、Golangをインストールしてみた件

すったもんだしているのですが、とりあえず、Windows10の方にX-Windowの方に、X serverを立てて表示ができたので、メモを残しておきます。

(というか、『Windows10上で、X-Windowsのサーバ動かす』という発想ができなかったので、

(gedit:5386): Gtk-WARNING **: cannot open display やらで、悩んでいました。

基本は、

Windows10のWSLでX11アプリケーションを実行してみた

の通りに実施したら動きました(実は、ここまで、手当たりしだい "sudo apt-get install" を乱発して

WSLの方から、

>export DISPLAY=:0

>gedit dummy.txt

 

と投入したら、X-windowsのエディタが立ち上がってきましたが、

など、たくさん問題が出ているようなので、対応を続けます(続く)

ところで、

WSLでGUIアプリを実行する

などで、自分の「上手くできなかったことを、きちんと書き残している方」のメモは本当に素晴しい。こういうメモは、普通の成功パターンしか記載していないメモの何十倍も役に立つのです。

で、まあ、それはさておき。


本命はこちら ――

GStreamer

です。

私、映像の伝送の研究は色々やってきたのですが(10~15年前)、映像そのものの研究は初めてなので、まずは、ローカルのパソコンで色々遊ぶ・・・もとい、調査することにしました。

で、今の私、GStreamerが何なのかも分かっていないのですが、「これを使え」と指示されているので、「これに突っ込んでいく」だけです。

『ほとんどの入門書は、入門者にとっては、ただの"ゴミ"』

マルチメディアフレームワークGStreamer ~ 入門編

を参考にさせて頂き、

$ export DISPLAY=:0

$ gst-launch-1.0 videotestsrc ! autovideosink

で、これが出てきました。

おお! やった!

WSLの方はこんな感じです。

$ gst-launch-1.0 filesrc location=./out.h264 ! avdev_h264 ! autovideosink

も、ちゃんと表示されるようです。映像の違いは分かりませんが。

カーネルコンパイルしたら表示されなくなりました(それが理由かは分かりません)。

$ gst-launch-1.0 -v videotestsrc ! x264enc ! avdec_h264 ! videoconvert ! autovideosink

で、表示できました。

(とりあえず、error: XDG_RUNTIME_DIR not set in the environment. だけでも潰しておこう)

ともあれ、最初の一歩は確保しました。

エラーコメントの表示対応のため、以下の設定をしておきました。

$ cd ~
$ vi .bash_profile

以下の2行を追加(正直、上の設定の意味は分からんが、とりあえずエラーは消える)。

export XDG_RUNTIME_DIR=/tmp/runtime-futa
export DISPLAY=:0


GStreamerによるレートコントロールについて調べています。

ラズパイにWEBカメラを接続してGStreamerを使った際に小一時間ハマった話

こちらに、

そして、例えば、任意のサイズやフレームレートでキャプチャを行いたい場合は、video/x-raw,width=1280,height=720,framerate=30/1 のような指定を行います。

というような記載がありました。

$ gst-launch-1.0 videotestsrc ! autovideosink

をちょっと変更して試してみました。

$ gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,width=1280,height=720,framerate=30/1 ! autovideosink

画面がでっかくなって表示されました。

$ gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,width=1280,height=720,framerate=1/1 ! autovideosink

これで、1fpsの表示になりました。

で、実際に映像ファイル(start_up.mp4)を持ち込んで表示してみました。

$gst-launch-1.0 filesrc location=start_up.mp4 ! decodebin ! videorate ! video/x-raw,framerate=30/1 ! autovideosink

これを、1fpsの表示に変えてみます。

$gst-launch-1.0 filesrc location=start_up.mp4 ! decodebin ! videorate ! video/x-raw,framerate=1/1 ! autovideosink

これを、1fpsのmp4ファイルとして保存してみます。

■1ftp映像に変換したもの "1ftp.mp4"$ gst-launch-1.0 -e filesrc location=start_up.mp4 ! decodebin ! videoconvert ! videoscale ! videorate ! "video/x-raw,framerate=1/1" ! videoconvert ! x264enc bitrate=2000 ! mp4mux ! filesink location=1ftp.mp4

上記のコマンドでは、GStreamerのgst-launch-1.0ユーティリティを使用しています。filesrcエレメントを使用して入力ファイルを読み込み、decodebinエレメントを使用してデコードします。その後、videoconvertvideoscaleエレメントを使用して動画の形式を変換し、videorateエレメントを使用してフレームレートを変更します。最後に、x264encエレメントを使用してビットレートを設定し、mp4muxエレメントを使用して新しいmp4ファイルに変換します。


ひき続き、SRTの通信実験を行ってみます。

(2)映像転送プロトコルは、現在、SRTが有力候補

     (a)タイムスタンプが付与した再送機能付きUDP(と理解)

     (b)Gstreamerに標準装備されている(らしい)

で、高信頼の映像通信を実現するプロトコルのようです。

GStreamer で SRT を使用する その1

の内容をマネします。

私の場合、新規の設定をしないでも以下のコマンドが動きましたので、どっかで設定を終えてしまったのだと思います。

$ gst-launch-1.0 videotestsrc ! videoconvert ! x264enc tune=zerolatency key-int-max=30 ! mpegtsmux ! srtserversink uri="srt://:12345" latency=500

で、SRT の配信には、srtserversink を使用しているようです。

で、受信側は、VLCメディアプレーヤを用います。

※WSL2にしてカーネルコンパイルした後、

C:\Users\ebata>ipconfig

(中略)

Windows IP 構成

イーサネット アダプター vEthernet (WSL):

接続固有の DNS サフィックス . . . . .:
リンクローカル IPv6 アドレス. . . . .: fe80::c317:ce40:f52f:1a41%40
IPv4 アドレス . . . . . . . . . . . .: 172.22.144.1
サブネット マスク . . . . . . . . . .: 255.255.240.0
デフォルト ゲートウェイ . . . . . . .:

しか使えなくなってしまったので、上記のVLCのアドレスは、

とする必要が生じました。

これで、「再生(P)ボタン」を押すと、テスト映像が表示されます。


次にWebRTCの実験を行います。

ここでは、

Go + GStreamer でお手軽 WebRTC 体験

を試させて頂きました。

GOのソースは一つだけだったので、WSL環境から行ってみました(最初、エラーの嵐だったのですが、よく考えれば、私はWSLの方にGStremaerの環境を立てていたので当然でした。

結構エラーが出てきましたので、色々対応をしていました。

sudo apt-get install libgstreamer-plugins-base1.0-dev

で、一部解決したのですが、以下のエラーが取れません。
# pkg-config --cflags -- gstreamer-1.0 gstreamer-base-1.0 gstreamer-app-1.0 gstreamer-plugins-base-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-plugins-bad-1.0 Package gstreamer-plugins-bad-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gstreamer-plugins-bad-1.0.pc' to the PKG_CONFIG_PATH environment variable
No package 'gstreamer-plugins-bad-1.0' found pkg-config: exit status 1

で、

https://github.com/notedit/gstreamer-go

に訪問してみたところ、

$ sudo apt-get install libgstreamer-plugins-bad1.0-dev

が、当たりだったようです。

で、後は上記のページの記載通りにGOプログラムを動かしたのですが、

2023/05/25 17:57:31 peer state change: failed

が登場してきて、変だなーと思ていたのですが、実はこれ成功しています。

このメッセージの上に、Goの出力の「長い文字列」が主力されていました。

これを入力して、「start session」ボタンを押下したら、以下の画面がブラウザに表示されました。

では、動作も確認できたので、ここからコードの勉強に入りましょう。


WebRTC を今から学ぶ人に向けて

の中にある、

WebRTC コトハジメ

が分かりやすい。

好奇心旺盛な人のためのWebRTC

も良い。

私はGolang使いなので、https://github.com/pion/webrtcを使いこなしたいが、膨大で手が出ない状況。今、とっかかりを探している。

とりあえず、wsl -d Ubuntu-20.04で、
ebata@DESKTOP-P6KREM0:/mnt/c/users/ebata/から、
get clone https://github.com/pion/webrtc で、インストール。

https://github.com/pion/webrtc/blob/master/examples/README.md

から、

$ cd webrtc
$ cd examples
$ go run examples.go --address :8080

で、ブラウザ http://localhost:8080で以下の画面が出てくる。

で、

のところで、"Run JavaScript"を押して、暫く(2~3分)待っていると、

という漢字で文字列が出てくるので、これを、上記のGo + GStreamer でお手軽 WebRTC 体験 のプログラムに放り込んで、同じように得られた文字列を放り込むと、

てな感じで映像が表示される。


$git clone https://github.com/pion/rtwatch.git

に挑戦。

https://github.com/pion/rtwatch の内容通りに設定するが、実行のところだけ少し違った

ebata@DESKTOP-P6KREM0:/mnt/c/users/ebata/rtwatch$ go run main.go -container-path=start_up.mp4
Video file 'start_up.mp4' is now available on ':8080', have fun!

これで、複数の、http://localhost:8080/ から同期した映像が配信されるようすが分かる。