Background: In the study of MP4 decoding playback of audio and video subtitle of the Shard naming does not conform to specifications, the number of shards too many can only be scripted implementation.
To resolve the problem type :
1. Convert garfield1hd_261_dan-*.m4s unification to GARFIELD1HD_261_DAN-*.WEBVTT format
#!/bin/bashparse_dir=/home/lcw/testcd $parse _dir#garfield1hd_261_dan-8.m4sfor var in ' ls $parse _dir/*.m4s '; Do src_name= ' basename $var ' dst_name= ' echo $src _name | awk-f '. ' ' {print $ '. "" Webvtt "}" # echo "CP $src _name $dst _name" mv $src _name $DST _namedone
2. garfield1hd_eng_128000_257_segment-1402.m4a Remove the Segment garfield1hd_eng_128000_257-1402.m4a
#!/bin/bashparse_dir=/home/yinzhou/dashstream/media_lcw/vodafonecd $parse _dir#garfield1hd_261_dan_ segment-339.m4a#garfield1hd_eng_128000_257_segment-1402.m4afor var in ' ls $parse _dir/garfield1hd_*_*_*_segment-* '; Do src_name= ' basename $var ' dst_name= ' echo $src _name | awk-f ' _|-' {print $ "_" $ "_" $ "_" $4 "-" $6} " # echo "CP $src _name $dst _name" mv $src _name $DST _namedone
3. Remove the Segment from the garfield1hd_261_dan_segment-339.m4a garfield1hd_261_dan-339.m4a
#!/bin/bashparse_dir=/home/yinzhou/dashstream/media_lcw/vodafonecd $parse _dir#garfield1hd_261_dan_ segment-339.m4a#garfield1hd_eng_128000_257_segment-1402.m4afor var in ' ls $parse _dir/garfield1hd_*_*_segment-* '; Do src_name= ' basename $var ' dst_name= ' echo $src _name | awk-f ' _|-' {print $ "_" $ "_" $ $ "_-" $ $} " #echo" CP $SRC _name $dst _name " mv $src _name $DST _namedone
Linux Bulk Modified file name