gadgeteerza

Convert mov to mp4

Sep 30th, 2024
230
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.07 KB | Source Code | 0 0
  1. #!/bin/bash
  2.  
  3. # Check if an input file is provided
  4. if [[ $# -eq 0 ]]; then
  5.   echo "Usage: $0 <input_mov_file>"
  6.   exit 1
  7. fi
  8.  
  9. # Get the input file name (without extension)
  10. input_file="${1%.*}"
  11.  
  12. # Get the output file name (same name as input but with .mp4 extension)
  13. output_file="${input_file}.mp4"
  14.  
  15. # Option in Video: FFmpeg command with hardware acceleration and encoding parameters
  16. # For a higher bitrate try changing -qp 15 to -qp 10
  17. ffmpeg -hwaccel cuda -hwaccel_device 0 -i "$input_file.mov" -vf yadif -codec:v h264_nvenc -qp 10 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart "$output_file"
  18.  
  19. # Another Nvidia option
  20. # ffmpeg -y -hwaccel cuda -hwaccel_output_format cuda -i "$input_file.mov" -c:a copy -c:v h264_nvenc -b:v 10M -fps_mode passthrough "$output_file"
  21.  
  22. # Non Nvidia option
  23. # ffmpeg -i "$input_file.mov" -vf yadif -codec:v libx264 -crf 1 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart "$output_file"
  24.  
  25. echo "Conversion completed. Output file: $output_file"
Advertisement
Comments
  • gadgeteerza
    291 days
    # text 0.15 KB | 0 0
    1. Default option is the one mentioned in my video. You can also choose one of the other two options. Just ensure only one is uncommented (active) at a time.
Add Comment
Please, Sign In to add comment