0

編集して追加情報を含めます。

Telestream Vantage を使用して、XML を Telestream がメタデータ ラベルと呼ぶものに変換しています。

簡単な方法論は次のとおりです。

  1. Vantage 管理コンソールでメタデータ ラベル セットを作成する
  2. メタデータ ラベル セットを XML としてエクスポートする
  3. XML から、提供された XML から値を「削除」し、ラベル セットのフィールドに入力する XSL を作成します。

次のような FFProbe によって生成された xml があります。

<?xml version="1.0" encoding="UTF-8"?>
<ffprobe:ffprobe xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ffprobe='http://www.ffmpeg.org/schema/ffprobe' xsi:schemaLocation='http://www.ffmpeg.org/schema/ffprobe ffprobe.xsd'>
<programs>
</programs>

<streams>
    <stream index="1" channels="1"/>
    <stream index="2" channels="1"/>
    <stream index="3" channels="1"/>
    <stream index="4" channels="1"/>
    <stream index="5" channels="1"/>
    <stream index="6" channels="1"/>
    <stream index="7" channels="1"/>
    <stream index="8" channels="1"/>
    <stream index="9" channels="1"/>
    <stream index="10" channels="1"/>
    <stream index="11" channels="1"/>
    <stream index="12" channels="1"/>
    <stream index="13" channels="1"/>
    <stream index="14" channels="1"/>
    <stream index="15" channels="1"/>
    <stream index="16" channels="1"/>
    <stream index="17" channels="1"/>
    <stream index="18" channels="1"/>
    <stream index="19" channels="1"/>
    <stream index="20" channels="1"/>
    <stream index="21" channels="1"/>
    <stream index="22" channels="1"/>
    <stream index="23" channels="1"/>
    <stream index="24" channels="1"/>
    <stream index="25" channels="1"/>
    <stream index="26" channels="1"/>
    <stream index="27" channels="1"/>
    <stream index="28" channels="1"/>
    <stream index="29" channels="1"/>
    <stream index="30" channels="1"/>
    <stream index="31" channels="1"/>
    <stream index="32" channels="1"/>
    <stream index="33" channels="1"/>
    <stream index="34" channels="1"/>
    <stream index="35" channels="1"/>
    <stream index="36" channels="1"/>
    <stream index="37" channels="1"/>
    <stream index="38" channels="1"/>
    <stream index="39" channels="1"/>
    <stream index="40" channels="1"/>
</streams>

そして、次のステートメントを使用して、各行から「チャネル」属性を抽出しようとしています:

        <soa:Parameter type="int32" identifier="0c000188-c401-4b99-91dc-8e15ebcb7981" bindable="True" name="Stream 01" enabled="true" disableable="false" optionseditable="false" row="-1" column="-1" columnspan="1">
            <xsl:value-of select="default:ffprobe/default:streams[1]/default:stream[1]/@channels"/>
        </soa:Parameter>

ご覧のとおり、私が見ているのは「Value of Select」セクションです。後続のブロックごとに、「ストリーム」参照を増やします。

<xsl:value-of select="default:ffprobe/default:streams[1]/default:stream[n]/@channels"/>

次に、添付ファイルとして XML ファイルを取り込む Vantage ワークフローを実行し、スタイルシートとターゲットのメタデータ ラベル セットを使用して「変換」を適用します。

メタデータ ラベル セットを確認すると、インポートされた XML ファイルによると、すべての値が 1 ではなく 0 です。私の XSL スキルは非常に不足していますが、何か助けていただければ幸いです。

4

2 に答える 2

0

Going through the W3C tutorials, and some trial and error, the following statement worked:

<xsl:value-of select="ffprobe/streams/stream[n]/@channels" />

I also changed the ffprobe command string:

-print_format xml=fully_qualified=1

Which altered the xml that ffprobe outputted to:

<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
    <programs>
    </programs>

    <streams>
        <stream index="1" channels="2"/>
        <stream index="2" channels="4"/>
        ...
    </streams>
</ffprobe>
于 2015-10-06T11:11:58.520 に答える