Skip to content

Instantly share code, notes, and snippets.

@dacr
Created May 11, 2025 11:26
Show Gist options
  • Select an option

  • Save dacr/c33bfc163943371d9b662e8be026d0e3 to your computer and use it in GitHub Desktop.

Select an option

Save dacr/c33bfc163943371d9b662e8be026d0e3 to your computer and use it in GitHub Desktop.

Revisions

  1. dacr created this gist May 11, 2025.
    24 changes: 24 additions & 0 deletions canon5d-mov-to-mp4.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    ## summary : Converts CANON 5D mark IV 4K mov files in the current directory to MP4
    ## keywords : bash, ffmpeg, canon, 5DMarkIV, yuvj422p
    ## publish : gist
    ## authors : David Crosson
    ## license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
    ## id : 2da6b78e-ae05-4460-853a-e4abf0e245dd
    ## created-on : 2025-05-11T10:08:56+02:00
    ## managed-by : https://github.com/dacr/code-examples-manager
    ## run-with : sh $file

    for INPUT in *.MOV; do
    OUTPUT=$(basename "$INPUT" .MOV).mp4
    echo "====================================================================="
    echo "-- convert '$INPUT' to '$OUTPUT'"
    echo "---------------------------------------------------------------------"
    if [ ! -f "$OUTPUT" ]; then
    ffmpeg \
    -i "$INPUT" \
    -c:v libx264 -c:a copy \
    -vf format=yuv420p \
    -movflags +faststart \
    "$OUTPUT"
    fi
    done