What are some common video formats that can be uploaded to a webspace and how do they affect file size?

When uploading videos to a webspace, common formats include MP4, AVI, MOV, and WMV. The file size of a video is affected by factors such as resolution, bitrate, and compression. To reduce file size, you can convert the video to a more compressed format or lower the resolution and bitrate.

// Example code to reduce video file size by converting to MP4 format with lower resolution and bitrate
$original_video = 'video.avi';
$new_video = 'video_compressed.mp4';

// Use FFmpeg to convert video to MP4 with lower resolution and bitrate
exec("ffmpeg -i $original_video -vf scale=640:-1 -b:v 1M $new_video");