0

最近、ビデオクリップを載せるとても良いアイデアを見ました。「ライク・ア・ローリング・ストーン」についてです。ここで見ることができます: http://video.bobdylan.com/desktop.html

ご覧のとおり、上/下キーでチャンネルを変更して操作できます。

16 個の個別のサブクリップをすべてダウンロードしました。

ここでの課題は、プログラムを作成することです。1 人のプレイヤーが同じことを行うだけでなく、もう少し多くのことを行うことができます。

私は別のフォーラムで助けを得ようとしましたが、今はプログラミングの段階で立ち往生しています。

こちらをご覧ください:

編集: [リンクを削除] Videohelp フォーラム、この質問と同じタイトルのスレッド]

ビデオをロードしてモザイクで表示する小さなプログラムを作成しました。これは、「チャンネルを変更する」機能への第一歩です。DirectShow および Direct9 ライブラリを使用する DSPack コンポーネントを Delphi 7 で使用しています。

ここで、これまでに得たもの:

モザイク 12本の動画

写真に見られるように、12 のビデオが読み込まれました。

システムを軽減するために、「チャネルの変更」機能を実装するとき、時間ごとに 1 つのビデオを見るとき、他のすべてのビデオの可視プロパティをオフにする予定です。ただし、モザイク レイアウトの場合はできません。

このステップを解決したら、ホットキーを使用して「チャンネルの変更」機能を実装します。

問題は、VideoWindow と FilterGraph の Visible および Active プロパティと混同していて、それに応じて使用していないことです。

ここまでのコードは次のとおりです。

procedure TFormPlayWin.FormActivate(Sender: TObject);
begin
  BigScreen := true;
  SmallScreen := false;
  VideoWindow01.Width := 1425;
  VideoWindow01.Height := 761;

  VideoWindow01.Visible := true;
  VideoWindow02.Visible := false;
  VideoWindow03.Visible := false;
  VideoWindow04.Visible := false;
  VideoWindow05.Visible := false;
  VideoWindow06.Visible := false;
  VideoWindow07.Visible := false;
  VideoWindow08.Visible := false;
  VideoWindow09.Visible := false;
  VideoWindow10.Visible := false;
  VideoWindow11.Visible := false;
  VideoWindow12.Visible := false;

    if not FilterGraph01.Active then FilterGraph01.Active := true;
    if not FilterGraph02.Active then FilterGraph02.Active := true;
    if not FilterGraph03.Active then FilterGraph03.Active := true;
    if not FilterGraph04.Active then FilterGraph04.Active := true;
{
    if not FilterGraph05.Active then FilterGraph05.Active := true;
    if not FilterGraph06.Active then FilterGraph06.Active := true;
    if not FilterGraph07.Active then FilterGraph07.Active := true;
    if not FilterGraph08.Active then FilterGraph08.Active := true;
    if not FilterGraph09.Active then FilterGraph09.Active := true;
    if not FilterGraph10.Active then FilterGraph10.Active := true;
    if not FilterGraph11.Active then FilterGraph11.Active := true;
    if not FilterGraph12.Active then FilterGraph12.Active := true;
}
    FilterGraph01.ClearGraph;
    FilterGraph02.ClearGraph;
    FilterGraph03.ClearGraph;
    FilterGraph04.ClearGraph;
{
    FilterGraph05.ClearGraph;
    FilterGraph06.ClearGraph;
    FilterGraph07.ClearGraph;
    FilterGraph08.ClearGraph;
    FilterGraph09.ClearGraph;
    FilterGraph10.ClearGraph;
    FilterGraph11.ClearGraph;
    FilterGraph12.ClearGraph;
}
    FilterGraph01.RenderFile('D:\Meus documentos\Downloads\Bob Dylan\Joined01.flv');
    FilterGraph02.RenderFile('D:\Meus documentos\Downloads\Bob Dylan\Joined02.flv');
    FilterGraph03.RenderFile('D:\Meus documentos\Downloads\Bob Dylan\Joined03.flv');
    FilterGraph04.RenderFile('D:\Meus documentos\Downloads\Bob Dylan\Joined04.flv');
{
    FilterGraph05.RenderFile('D:\Meus documentos\Downloads\Bob Dylan\Joined05.flv');
    FilterGraph06.RenderFile('D:\Meus documentos\Downloads\Bob Dylan\Joined06.flv');
    FilterGraph07.RenderFile('D:\Meus documentos\Downloads\Bob Dylan\Joined07.flv');
    FilterGraph08.RenderFile('D:\Meus documentos\Downloads\Bob Dylan\Joined08.flv');
    FilterGraph09.RenderFile('D:\Meus documentos\Downloads\Bob Dylan\Joined09.flv');
    FilterGraph10.RenderFile('D:\Meus documentos\Downloads\Bob Dylan\Joined10.flv');
    FilterGraph11.RenderFile('D:\Meus documentos\Downloads\Bob Dylan\Joined11.flv');
    FilterGraph12.RenderFile('D:\Meus documentos\Downloads\Bob Dylan\Joined12.flv');
}
    VideoWindow01.PopupMenu := PopupMenu;
    SoundLevel.Position := FilterGraph01.Volume;

    FilterGraph01.Play;
    FilterGraph02.Play;
    FilterGraph03.Play;
    FilterGraph04.Play;
{
    FilterGraph05.Play;
    FilterGraph06.Play;
    FilterGraph07.Play;
    FilterGraph08.Play;
    FilterGraph09.Play;
    FilterGraph10.Play;
    FilterGraph11.Play;
    FilterGraph12.Play;

      FilterGraph02.Active := false;
      FilterGraph03.Active := false;
      FilterGraph04.Active := false;
      FilterGraph05.Active := false;
      FilterGraph06.Active := false;
      FilterGraph07.Active := false;
      FilterGraph08.Active := false;
      FilterGraph09.Active := false;
      FilterGraph10.Active := false;
      FilterGraph11.Active := false;
      FilterGraph12.Active := false;

      VideoWindow02.Visible := false;
      VideoWindow03.Visible := false;
      VideoWindow04.Visible := false;
      VideoWindow05.Visible := false;
      VideoWindow06.Visible := false;
      VideoWindow07.Visible := false;
      VideoWindow08.Visible := false;
      VideoWindow09.Visible := false;
      VideoWindow10.Visible := false;
      VideoWindow11.Visible := false;
      VideoWindow12.Visible := false;
}
end;

上記では、領域全体をカバーする最初のクリップを作成し、他のビデオを非表示にしようとしています。しかし、大きな VideoWindow1 の上に VideoWindow 2、3、および 4 が表示されているため、事態は悪化しています。

アイデアは、ホットキーを使用して大画面と小画面を切り替え、「チャンネルを変更する」ことです。

処理と同期を維持するために、オーディオ トラックを 1 つだけ実行したいと考えています。これを DirectShow フィルターから切り離すには? オーディオを 1 つだけ再生するために必要です。そのうちの 1 つだけが必要な場合に、すべてのオーディオ トラックを実行するのはお勧めできません。他のものをミュートする必要があります。

そうは言っても、私は2つの質問があります:

1 - あまりにも多くの動画を一度に処理できるように上記のコードを改善する方法。

2 - 他のすべてのビデオのオーディオ トラックをミュートする方法。

4

2 に答える 2

0

OOP を使用するのに適した作業のようです。しかし、配列がなくても簡単に行うことができます..アイデアをお話しします..

説明/機能

同時に 12 のミニ画面 (1 つはサウンド付き) 必要なときに 1 つの大きな画面 (新しいチャンネルを選択するために 12 に変更する可能性あり)

実装:

1) 12 個のビデオをロードし、スクリーン 1 のサウンドをオンにする 2) アクティブな miniScreen を変更する (フォーカスとアクティブなサウンドを変更する) 3) 選択したムービーで BigScreen を開く 4) 12miniScreens に戻る

コンポーネント:

var ActiveMiniScreen : TScreen;

minScr01 ... minScr12 (あなたがしたように 12 画面) bigScr (aling allClient、visible=false または 2 番目のフォームを使用した追加の画面) backTo12Button (bigScr.onDoubleClick または 2 番目のフォームのボタン)

4つの方法が必要です..

onFormCreate()

すべてのビデオをロードし、アクティブに設定します(サウンドを開始し、他のビデオと視覚的に区別します)

ActiveMiniScreen := miniScr1;
miniScr1.loadVideo()
miniScr1.soundOn
miniScr1.BorderColor:= red

miniScr2.loadVideo()
miniScr2.soundOff
miniScr2.BorderColor:= black
      ...
miniScr12.loadVideo()
miniScr12.soundOff
miniScr12.BorderColor:= black

onMinScreenClick() すべての miniSreens は同じ onMiniScreen1Click メソッドを共有します

ActiveMiniScreen := Tscreen(Sender)
Tscreen(Sender).SoundOn
Tscreen(Sender).BorderColor:= red

onMinDoubleScreenClick()

BigScreen.visible:=true
BigScreen.align:=alClient
BigScreen.loadVideo( ActiveMiniScreen.video )  //load miniScreen active 's video)
BigScreen.soundOn
ActiveMiniScreen.soundOff

onBigScreenDoubleClick() (DoubleClick または onClick) または form2 のボタン

BigScreen.visible:=false
BigScreen.soundOff
ActiveMiniScreen.soundOn
于 2013-12-10T00:34:40.983 に答える