Ffmpeg

From Colettapedia
Revision as of 17:11, 3 January 2017 by Colettace (talk | contribs) (Created page with "==Copying Files== <pre> cp -av /camera /local # Keep the file modify times function rename { ORIG_FILE=$1 PREFIX="SANYO_" TOUCH_ARG=`stat -f "%Sm" -t "%Y%m%d%H%M...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Copying Files


cp -av /camera /local # Keep the file modify times

function rename {
    ORIG_FILE=$1
    PREFIX="SANYO_"
    TOUCH_ARG=`stat -f "%Sm" -t "%Y%m%d%H%M.%S" $ORIG_FILE`
    NAME_TIMESTAMP=`stat -f "%Sm" -t "%Y%m%d_%H%M%S" $ORIG_FILE`
    NEW_NAME="${PREFIX}${NAME_TIMESTAMP}.mp4"
    #echo "Moving $ORIG_FILE to $NEW_NAME"
    mv -v $ORIG_FILE $NEW_NAME
    touch -t $TOUCH_ARG $NEW_NAME
}


H.264 encoding

  • Also set resolution and bitrate all at the same time:
ffmpeg -i VID_20160918_113318088.mp4 -vprofile high -codec:v libx264 -preset slow -b:v 2500k -maxrate 2500k -bufsize 5000k -vf scale=-2:720 -threads 0 -codec:a aac -b:a 128k ../HD_size/VID_20160918_113318088_720.mp4