Getting the error message “Request failed with status code 400” when uploading MP4 videos to Canvas?
Solution: Use FFmpeg to Convert Your Video
Canvas LMS requires specific video encoding parameters and compression to accept MP4 files. This command will help you convert your videos to Canvas-compatible format using FFmpeg.
Open your terminal and use the following FFmpeg command:
ffmpeg -i input_video.mp4 -c:v libx264 -profile:v high -level 4.0 -r 30 -c:a copy output_video_canvas.mp4
Command Breakdown:
-i input_video.mp4
— Input file-c:v libx264
— Use H.264 video codec-profile:v high
— Use H.264 High profile-level 4.0
— Set H.264 level to 4.0-r 30
— Set frame rate to 30 fps-c:a copy
— Copy audio without re-encodingoutput_video_canvas.mp4
— Output filename
Example
ffmpeg -i lesson_01.mp4 -c:v libx264 -profile:v high -level 4.0 -r 30 -c:a lesson_01_canvas.mp4