代码之家  ›  专栏  ›  技术社区  ›  stib

是否有任何方法可以使用applescript读取Quicktime电影的时间码轨迹

  •  3
  • stib  · 技术社区  · 17 年前

    我想从Applescript中的快速时间电影中提取时间码。

    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
    

    我可以得到时间码轨迹,轨迹的属性是:

    灰度:false,音频样本大小:0, 类:轨道,音频采样率:0.0, 声音平衡:0,预加载:false, 音频通道计数:0,层:0, 高音增益:0,音频 掩码:缺失值,视频深度:0, 维度:{0,0},单个字段:false, 尺寸:38412,视觉 特征:假、数据速率:100, 可选:{},操作颜色:{32768, 类型:“tmcd”,流媒体质量:-1.0, 0.0}, {0.0, 0.0, 1.0}}}

    根据我目前在网上发现的情况,我认为这是不可能的。请证明我错了

    -stib

    2 回复  |  直到 17 年前
        1
  •  2
  •   stib    16 年前

    here

    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"
    

        2
  •  0
  •   Taryn Frank Pearson    14 年前

    您可以使用曲目的名称而不是种类:

    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