Skip to content

Releases: DeepRegular/LogoScan

LogoScan 0.3.0

Choose a tag to compare

@DeepRegular DeepRegular released this 08 Oct 13:46

録画のどこにロゴが出ているかを測って、区間ごとの EraseLOGO を作れるようになりました。

ロゴの出ている区間

EraseLOGO は、ロゴの出ていないところにかけるとロゴの形が浮き出ます。CM を外して、区間ごとに呼ぶ必要があります。

  • 局ロゴを解析したあと、結果の欄の ロゴの出る区間とフェードを測る を押すと、録画を読み直して、ロゴが出ている区間を見つけます。コマンドなら lgdscan spans ロゴ.lgd 録画 です。
  • CM 明けにロゴがじわっと現れ、CM 前にじわっと消える局では、そのフェードの長さも測って fadein と fadeout に入れます。
  • 測ったフェードの値は、結果の欄の EraseLOGO の 1 行と、.lgd と一緒に書くサンプルの .avs に fadein・fadeout として入ります。フレーム番号はそのままです。
  • 測った区間をつないだ、その録画専用のスクリプトがほしいときは、いちばん下の この録画用の .avs を保存… で書けます。
  • フレーム番号は AviSynth と同じく、録画の最初に表示できる絵を 0 として数えます。

そのほかの変更

  • 動いたあと止まるロゴを「局ロゴ」と呼ぶことにしました(画面では「止まったロゴ」と書いていました)。
  • 局ロゴの結果にも、動くロゴと同じく EraseLOGO の 1 行と コピー を出しました。
  • 結果の欄のロゴを、ロゴの色と、実際の透け具合で表示するようにしました。これまでは、いちばん濃いところを不透明として引き伸ばしていたので、半透明のロゴも濃く見えていました。
  • アイコンを付けました。

直したこと

  • ffmpeg が途中で失敗しても、そこまでに読めた分だけでロゴを作っていました。今は ffmpeg の言ったことを添えて止まります。
  • 動くロゴの解析中に「×」や「追加…」で録画の一覧を変えると、録画ごとの開始フレームが別の録画に付いていました。
  • 動くロゴで「範囲を指定」したとき、コピーする行の start が録画の頭からではなく、範囲の頭から数えた値になっていました。
  • 録画の絵を読んでいる途中で別の録画を開くと、画面の大きさが違う場合にアプリが落ちることがありました。
  • 「ロゴの位置を検出」がまだ動いているうちに別の録画を開くと、前の録画の検出結果が新しい録画に付いていました。
  • 動くロゴで、画面の大きさやフレームレートの違う録画が混ざっていても、そのまま解析していました。今はどの録画が違うのかを示して止まります。
  • 動くロゴで、局ロゴが消えていくまでが長い録画を渡すと、消え方を測る段階が何時間も終わらないことがありました。
  • 範囲の終わりを始まりより前にすると、「使えるフレームがありません」という見当違いの知らせになっていました。

ダウンロード

  • Windows:LogoScan-0.3.0-windows-x86_64.zip を展開して lgdscan-gui.exe を起動してください。FFmpeg 8.1 を ffmpeg フォルダーに同梱しています。
  • Linux:LogoScan-0.3.0-linux-x86_64.tar.gz。Ubuntu 22.04 以降など、glibc 2.35 以上で動きます。FFmpeg はディストリビューションのものを入れてください。

LogoScan can now find where in a recording the logo is on screen and write an EraseLOGO call for each stretch.

Where the logo is on screen

EraseLOGO makes the shape of the logo show wherever it runs over a picture without the logo, so it has to be called stretch by stretch, leaving out the adverts.

  • After analysing a station logo, press ロゴの出る区間とフェードを測る (measure where the logo shows and how it fades) in the result. The recording is read again and the stretches with the logo are found. From the command line: lgdscan spans logo.lgd recording.
  • On channels that fade the logo in after the adverts and out before them, the length of the fade is measured too and goes into fadein and fadeout.
  • The measured fades go into the EraseLOGO line in the result and into the sample .avs written with the .lgd, as fadein and fadeout; the frame numbers stay as they were.
  • For a script of that recording's own, one call per stretch measured, press この録画用の .avs を保存… (save an .avs for this recording) at the bottom.
  • Frames are counted as AviSynth counts them, from the first picture of the recording that can be shown.

Other changes

  • The logo an animation settles into is now called the station logo (局ロゴ); the window used to call it the still logo.
  • The station logo's result also has its EraseLOGO line and a コピー (copy) button, as the moving logo has.
  • The logo in the result is shown in its own colours and as translucent as it really is. It used to be stretched so its most opaque pixel was solid, so a translucent logo looked dense.
  • An icon.

Fixed

  • When ffmpeg failed partway, a logo was made from what had been read until then. Now the analysis stops, with what ffmpeg said.
  • Changing the list of recordings (× or 追加…) while a moving logo was being analysed attached the start frames to the wrong recordings.
  • With a range set (範囲を指定) for a moving logo, the start in the line to copy counted from the start of the range instead of the start of the recording.
  • Opening another recording while a picture was being read could crash the program when the two differ in size.
  • Opening another recording while a logo detection was still running put the previous recording's result on the new one.
  • A moving-logo analysis went ahead with recordings of different picture sizes or frame rates mixed in. It now stops and names the recording that differs.
  • For a moving logo, recordings that run on long after the animation could keep the stage that measures the fade going for hours.
  • A range ending before it starts was reported as "no usable frames".

Download

  • Windows: unpack LogoScan-0.3.0-windows-x86_64.zip and run lgdscan-gui.exe. FFmpeg 8.1 comes with it, in the ffmpeg folder.
  • Linux: LogoScan-0.3.0-linux-x86_64.tar.gz, for Ubuntu 22.04 or later and the like (glibc 2.35). Install FFmpeg from your distribution.

LogoScan 0.2.0

Choose a tag to compare

@DeepRegular DeepRegular released this 05 Oct 12:49

番組の頭でアニメーションしながら出てくるロゴを解析できるようになりました。

動くロゴ

アニメーションの 1 フレームごとにロゴを 1 つずつ求めて、AviSynth の delogomod がそのまま読める .ldp に書きます。

  • 画面では「解析」の欄を 動くロゴ に切り替え、同じ局の録画を何本も開いて、ロゴが動き回る範囲を枠で囲みます。コマンドなら lgdscan anim 録画… --rect X,Y,W,H -o anim.ldp です。
  • 録画はそれぞれ、アニメーションが始まる少し前から、ロゴが画面から消えるまでを切り出してください(10 秒ほど)。30 本ほどあると安定します。
  • アニメーションの始まる位置が録画ごとに違っていても、自分で合わせます。録画ごとに何フレーム目から始まったかを表示します。
  • 動きが止まったあとのロゴも求めて、.lgd に書けます(画面では「止まったロゴを保存」、コマンドでは --still)。
  • 止まったロゴが消えていく様子も録画から測り、delogomod の end と fadeout に入れる値を出します。
  • 結果の欄では、アニメーションを 1 フレームずつ、ロゴを消した絵で確かめられます。保存した .ldp を開いて中を見ることもできます。

サンプルスクリプト

ロゴデータを保存するとき、AviSynth での使い方を同じ名前の .avs に書きます。.ldp には delogomod の EraseLogomod、.lgd には delogo の EraseLOGO の呼び出しを、そのまま書き写せる形で入れます。あとから作るなら lgdscan avs ロゴ.ldp です。

直したこと

  • 読む範囲を指定したとき(画面の「範囲を指定」、コマンドの --start)に、指定より数フレーム早いところから読んでいました。録画の頭に近いところでは、1 秒近く早くなることがありました。指定した時刻のフレームから読むようにしました。

ダウンロード

  • Windows:LogoScan-0.2.0-windows-x86_64.zip を展開して lgdscan-gui.exe を起動してください。FFmpeg 8.1 を ffmpeg フォルダーに同梱しています。
  • Linux:LogoScan-0.2.0-linux-x86_64.tar.gz。Ubuntu 22.04 以降など、glibc 2.35 以上で動きます。FFmpeg はディストリビューションのものを入れてください。

LogoScan can now analyse a logo that comes in with an animation at the start of a programme.

A logo that moves

One logo is found for every frame of the animation and written to an .ldp that AviSynth's delogomod reads as it is.

  • In the window, switch the analysis to 動くロゴ (moving logo), open many recordings from the same channel, and draw the box round the area the logo moves about in. From the command line: lgdscan anim recordings… --rect X,Y,W,H -o anim.ldp.
  • Cut each recording from a little before the animation starts to after the logo has gone from the picture (ten seconds or so). About thirty recordings give a steady result.
  • The animation need not start at the same point in every recording; the shift is found, and the frame each recording starts on is shown.
  • The logo the animation settles into is found too and can be saved as an .lgd (止まったロゴを保存 in the window, --still on the command line).
  • How that logo fades away is measured from the recordings, giving the values for delogomod's end and fadeout.
  • The result can be stepped through a frame at a time, on the picture with the logo removed. A saved .ldp can be opened to look inside.

Sample scripts

Saving a logo file also writes an .avs of the same name showing how to use it in AviSynth: a call of delogomod's EraseLogomod for an .ldp, of delogo's EraseLOGO for an .lgd, ready to copy. lgdscan avs logo.ldp writes one afterwards.

Fixed

  • With a range to read (範囲を指定 in the window, --start on the command line), reading began some frames before the time given, and up to nearly a second before it close to the start of a recording. It now begins at the frame of that time.

Download

  • Windows: unpack LogoScan-0.2.0-windows-x86_64.zip and run lgdscan-gui.exe. FFmpeg 8.1 comes with it, in the ffmpeg folder.
  • Linux: LogoScan-0.2.0-linux-x86_64.tar.gz, for Ubuntu 22.04 or later and the like (glibc 2.35). Install FFmpeg from your distribution.

LogoScan 0.1.0

Choose a tag to compare

@DeepRegular DeepRegular released this 03 Oct 07:07

最初の公開版です。AviUtl のロゴ解析プラグインと同じ形式の .lgd を、録画ファイルから作れます。

できること

  • ロゴの解析:画素ごとに不透明度と色を求めて、透過性ロゴフィルタでそのまま読める .lgd(ver0.1)を書きます。AviUtl で作った .lgd と比べると、輝度の不透明度の相関は 0.9996 です。
  • ロゴの位置の検出:録画全体から取り出したキーフレームで、動かない縁を探して枠を合わせます。候補が複数あれば選べます。
  • 画面で直す:枠は絵の上でドラッグして、または矢印キーで 1 画素ずつ動かせます。解析が終わると、ロゴを消した絵で仕上がりを確かめられます。
  • ロゴ名は CP932:AviUtl と同じ文字コードで書きます。CP932 に無い文字は保存の前に知らせます。

CM や場面転換でロゴが消えるフレームは自動で外すので、解析する範囲を選ばなくても使えます。

ダウンロード

  • Windows:LogoScan-0.1.0-windows-x86_64.zip を展開して lgdscan-gui.exe を起動してください。FFmpeg 8.1 を ffmpeg フォルダーに同梱しています。
  • Linux:LogoScan-0.1.0-linux-x86_64.tar.gz。Ubuntu 22.04 以降など、glibc 2.35 以上で動きます。FFmpeg はディストリビューションのものを入れてください。

どちらにも、画面版の lgdscan-gui とコマンド版の lgdscan が入っています。


The first release. LogoScan builds the same .lgd files as AviUtl's logo analysis plugin, straight from a recording.

What it does

  • Analyses the logo: finds the opacity and colour of every pixel and writes a ver0.1 .lgd the transparent-logo filter reads as it is. Against a .lgd made by AviUtl, the luma opacity correlates at 0.9996.
  • Finds the logo: looks for edges that stay put across keyframes taken from the whole recording and places the box there. When there are several candidates, you choose.
  • Lets you adjust it on the picture: drag the box, or move it a pixel at a time with the arrow keys. When the analysis is done, the picture shows the logo removed so you can judge the result.
  • Writes names in CP932, as AviUtl does, and tells you before saving if a character cannot be written.

Frames in which the logo is gone — commercials, scene changes — are set aside on their own, so there is no need to pick a range.

Download

  • Windows: unpack LogoScan-0.1.0-windows-x86_64.zip and run lgdscan-gui.exe. FFmpeg 8.1 comes with it, in the ffmpeg folder.
  • Linux: LogoScan-0.1.0-linux-x86_64.tar.gz, for Ubuntu 22.04 or later and the like (glibc 2.35). Install FFmpeg from your distribution.

Both contain the window, lgdscan-gui, and the command, lgdscan.