Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques script error

  • script error

    Posted by Peter Robertson on July 3, 2013 at 3:19 pm

    I was able to make a script a few months ago with the generous help of this forum but now it has stopped working. When I try to run:

    #!/bin/sh

    for (( i=0; i<97; i+=30 ))

    do ffmpeg -ss $i -t 10 -acodec copy -vcodec copy -i movie.mp4 index_$i.mov

    done

    I get the error:

    ./IndexVidBash.sh: line 1: {rtf1ansiansicpg1252cocoartf1187cocoasubrtf390: command not found
    ./IndexVidBash.sh: line 2: syntax error near unexpected token `}’
    ./IndexVidBash.sh: line 2: `\cocoascreenfonts1{\fonttbl\f0\fmodern\fcharset0 Courier;\f1\fnil\fcharset0 LucidaGrande;}’

    Any suggestion on how to fix this?

    Peter

    Pedro

    Lou Logan replied 13 years ago 2 Members · 2 Replies
  • 2 Replies
  • Peter Robertson

    July 3, 2013 at 3:56 pm

    My bad. The error appears to have been caused by the fact that I was using Text Edit to edit my .sh file–not a good idea. Saving the script with a different editor fixed the problem.

    FYI–the syntax for ffmpeg has changed since I used this script. With newer versions of ffmpeg you will need to use

    do ffmpeg -ss $i -t 10 -i YUWinter.mp4 -acodec copy -vcodec copy index_$i.mov

    the ‘-acodec copy -vcodec copy’ needs to be placed AFTER the output file.

    Peter

    Pedro

  • Lou Logan

    July 5, 2013 at 8:57 pm

    [Peter Robertson] “the ‘-acodec copy -vcodec copy’ needs to be placed AFTER the output file.”

    Don’t you mean “after the *input* file”? Please use the CODE button on your commands and console outputs.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy