小编joj*_*ojo的帖子

如何使用 xmlstarlet 附加具有多个子节点的 xml 文件?

我想在之后添加这个块</audio_selector>

<input_clipping>
<end_timecode>00:00:05:00</end_timecode>        
 <order>1</order>
 <order>2</order>   
<start_timecode>00:00:01:00</start_timecode>        
</input_clipping>
Run Code Online (Sandbox Code Playgroud)

以下是我的预期输出:

<?xml version="1.0" encoding="UTF-8"?>
<job href="/jobs/35932"  version="2.10.0.44452">
  <input>
    <deblock_enable>Auto</deblock_enable>
    <deblock_strength>0</deblock_strength>
    <no_psi>false</no_psi>
    <order>1</order>
    <timecode_source>zerobased</timecode_source>
    <file_input>
      <certificate_file nil="true"/>
      <password>xxx</password>
      <uri>s3_source</uri>
      <username>xxx</username>
    </file_input>
    <name>input_1</name>
    <video_selector>
      <color_space>follow</color_space>
      <order>1</order>
      <program_id nil="true"/>
      <name>input_1_video_selector_0</name>
    </video_selector>
    <audio_selector>
      <default_selection>true</default_selection>
      <infer_external_filename>false</infer_external_filename>
      <order>1</order>
      <program_selection>1</program_selection>
      <selector_type>track</selector_type>
      <track>1, 2</track>
      <unwrap_smpte337>true</unwrap_smpte337>
      <name>input_1_audio_selector_0</name>
    </audio_selector>
    <input_clipping>    
    <end_timecode>00:00:05:00</end_timecode>        
     <order>1</order>
     <order>2</order>   
    <start_timecode>00:00:01:00</start_timecode>        
    </input_clipping>
  </input>
  <timecode_config>
    <require_initial_timecode>false</require_initial_timecode>
    <source>zerobased</source>
    <sync_threshold nil="true"/>
  </timecode_config>
  <ad_trigger>scte35_splice_insert</ad_trigger>
  <ad_avail_offset>0</ad_avail_offset>
  <priority>100</priority>
  <user_data></user_data>
  <avsync_enable>true</avsync_enable>
  <avsync_pad_trim_audio>true</avsync_pad_trim_audio>
  <stream_assembly>
    <name>stream_assembly_0</name>
    <video_description>
      <afd_signaling>None</afd_signaling>
      <anti_alias>true</anti_alias>
      <drop_frame_timecode>true</drop_frame_timecode>
      <fixed_afd nil="true"/>
      <force_cpu_encode>false</force_cpu_encode>
      <height>1080</height>
      <insert_color_metadata>false</insert_color_metadata>
      <respond_to_afd>None</respond_to_afd>
      <sharpness>50</sharpness>
      <stretch_to_output>false</stretch_to_output> …
Run Code Online (Sandbox Code Playgroud)

xmlstarlet

5
推荐指数
1
解决办法
1780
查看次数

aws s3 ls过滤器存储类(标准)

如何列出文件,但我只想列出所有标准类。

我想排除冰川类。

当前这是我的命令:

aws s3 ls s3://Videos/Action/ --human-readable --summarize
Run Code Online (Sandbox Code Playgroud)

amazon-s3 amazon-web-services aws-cli

4
推荐指数
1
解决办法
1903
查看次数

xmlstarlet 替换 xml 节点值

我是新使用 xmlstarlet 的。我想知道如何使用 xmlstarlet 更改 xml 节点的值。

我尝试了一些东西。xmlstarlet ed --inplace -u '/file_input/uri' 'string("s3://my_source")' template.xml > output.xml

不起作用。

我的预期输出为 s3://my_sources3://mydestination。我想更改source_pathdestination_path节点。

<?xml version="1.0" encoding="UTF-8"?>
<job version="2.10.8">
  <input>
    <deblock_enable>Auto</deblock_enable>
    <deblock_strength>0</deblock_strength>
    <no_psi>false</no_psi>
    <order>1</order>
    <timecode_source>zerobased</timecode_source>
    <file_input>
      <certificate_file nil="true"/>
      <password>upass</password>
      <uri>source_path</uri>
      <username>uname</username>
    </file_input>
    <file_group_settings>
      <rollover_interval nil="true"/>
      <destination>
        <password>upass</password>
        <username>uname</username>
        <uri>destination_path</uri>
      </destination>
    </file_group_settings>
  </input>
</job>
Run Code Online (Sandbox Code Playgroud)

非常感谢

xmlstarlet

4
推荐指数
1
解决办法
7884
查看次数

aws s3 ls recursive grep extension '.mov' and total size

I would like to know how to list the files in amazon s3 bucket by recursive way and filter .mov files.

Sample output:

sample:

filename1.mov1    120mb<br>
filename2.mov2    300mb

Total Object : 2
Total Size: 420mb
Run Code Online (Sandbox Code Playgroud)

my current command below:

aws s3 ls --summarize --human-readable --recursive s3://mybucket/Videos
Run Code Online (Sandbox Code Playgroud)

Thanks

amazon-s3 amazon-ec2 amazon-web-services aws-cli

2
推荐指数
1
解决办法
3411
查看次数