Changes between Version 37 and Version 38 of FilteringGuide


Ignore:
Timestamp:
Jan 9, 2015, 5:09:07 AM (4 years ago)
Author:
c-14
Comment:

bash syntax changes

Legend:

Unmodified
Added
Removed
Modified
  • FilteringGuide

    v37 v38  
    106106cd $path
    107107
    108 filter="-vf \"yadif=0:-1:0, scale=400:226, drawtext=fontfile=/usr/share/fonts/truetype/DroidSans.ttf: \
    109 text='tod- %X':x=(w-text_w)/2:y=H-60 :fontcolor=white :box=1:boxcolor=0x00000000@1\""
    110 codec="-vcodec libx264  -pix_fmt yuv420p -b:v 700k -r 25 -maxrate 700k -bufsize 5097k"
     108filter=(-vf "yadif=0:-1:0, scale=400:226, drawtext=fontfile=/usr/share/fonts/truetype/DroidSans.ttf: \
     109text='tod- %X':x=(w-text_w)/2:y=H-60 :fontcolor=white :box=1:boxcolor=0x00000000@1")
     110codec=(-vcodec libx264  -pix_fmt yuv420p -b:v 700k -r 25 -maxrate 700k -bufsize 5097k)
    111111
    112 command_line="ffmpeg -i $in_file $filter $codec -an $out_file"
     112command_line="ffmpeg -i $in_file \"${filter[@]}\" \"${codec[@]}\" -an $out_file"
    113113
    114114echo $command_line
    115 eval $command_line
     115$command_line
    116116exit
    117117}}}
    118118Note that the double quotes " around the whole filtergraph have been escaped \" and the filtergraph spans more than one line, the echo command shows the full command as it is executed. Useful for debugging.
    119119
    120 The {{{eval}}} invocation of the $command_line variable is required to avoid loss of the embedded escaped quotes which occurs if it is absent. Other shells may behave differently.
     120The arrays in the $command_line variable are required to avoid loss of the embedded escaped quotes which occurs if they is absent. Other shells may behave differently.
    121121
    122122