3

ApplescriptのQuickTimeムービーからタイムコードを抽出したい。

このスクリプトを使用する

tell application "QuickTime Player"
    set themovie to open thefile
    set thetracks to tracks of document 1
    repeat with thetrack in thetracks
        if the kind of thetrack is "Timecode" then
            get the properties of thetrack
        end if
    end repeat
end tell

タイムコードトラックを取得できます。トラックのプロパティは次のとおりです。

{オーディオ可変レート:true、ビデオグレースケール:false、オーディオサンプルサイズ:0、クラス:トラック、オーディオサンプルレート:0.0、サウンドバランス:0、プリロード:false、ストリーミングビットレート:-1.0、期間:960300 、言語: "英語"、オーディオチャンネル数:0、レイヤー:0、内容:欠落値、低音ゲイン:0、開始時間:0、データ形式: "タイムコード"、高音ゲイン:0、オーディオ特性:false、サウンドボリューム:0、マスク:欠落値、ビデオ深度:0、位置:{0、0}、ID:4、高品質:false、インターレース解除フィールド:false、href: ""、自然寸法:{0、0}、単一フィールド:false、種類: "タイムコード"、インデックス:4、データサイズ:38412、視覚的特性:false、データレート:100、パージなし:false、透明度:49、チャプターリスト:{}、名前:"タイムコードトラック" 、alternate:{}、操作色:{32768、32768、32768}、enabled:true、タイプ: "tmcd"、ストリーミング品質:-1.0、転送モード:転送モード不明、サイズ:{0、0}、現在のマトリックス:{{1.0、0.0、0.0}、{0.0、1.0、0.0}、{0.0、 0.0、1.0}}}

どれもタイムコードとは何の関係もないようです。コンテンツプロパティが「不足している値」であることに注意してください

映画の現在の時刻を取得しようとすると、タイムコードが0から始まっていなくても、0が返されます。

これまでネットで見つけたことが無理だと思っています。私が間違っていることを証明してください

TIA-stib

4

2 に答える 2

2

回避策を見つけました。ここで利用可能なtimecodereaderと呼ばれるオープンソースのコマンドラインアプリがあります

ここで、少しハッキングする必要があります。timecodereader.mの152行目で、出力をstderrからstdoutに変更して、applescriptが結果を読み取れるようにする必要があります。そのようです:

fprintf(stderr,"%s\n", [timecodeString fileSystemRepresentation]);

fprintf(stdout,"%s\n", [timecodeString fileSystemRepresentation]);

ビルドして結果を実行可能パスに入れると、次のように使用できます。

set theStartTC to do shell script "timecodereader /Posix/Path/To/My/Movie.mov"

タイムコードの最初のフレームを含む文字列を返します。

于 2009-07-15T02:02:20.917 に答える
0

種類の代わりにトラックの名前を使用できます。

on open myfiles
 repeat with thefile in myfiles

  tell application "QuickTime Player"
   set themovie to open thefile
   set thetracks to tracks of document 1
   repeat with thetrack in thetracks
    if the name of thetrack is "Closed Caption Track" then
     set thetrack's enabled to false

    end if
   end repeat
  end tell
 end repeat
end open
于 2009-10-08T17:26:11.047 に答える