使用php ffmpeg将720p Mp4转换为480p

I need to covert 720p or 1080p video to 480p mp4 video , i found below code

ffmpeg -i input -vf scale=-1:480 -vcodec mpeg4 -qscale 3 output.mp4

and please help me , i am unable to give it INPUT VIDEO ex.

$video='/path/to/mp4/video';
exec('ffmpeg -i $video -vf scale=-1:480 -vcodec mpeg4 -qscale 3 output.mp4');

why above code is not working

i used that code and it worked flawless. maybe you werent in the dir with the vid files? or something? you should replace YOURVID.mkv with your file OR /path/to/your/file.mkv as well as replace /path/to/output.mkv with the file name or a file path to the converted output 480p file. easiest thing to do though is be in the dir with the original 720p/1080p video and just use the filename.mkv then output it to that same dir by just using an output.file.name.mkv and not a path. then all files will be in that one directory. i may have over explained it. sorry. lol. and THANK YOU for posting this. it did, indeed, work great for me on my freebsd machine with ffpmeg installed.

ffmpeg -i YOURVID.mkv -vf scale=-1:480 -vcodec mpeg4 -qscale 3 /path/to/new/output.mp4

I have an old 32bit Intel Atom Acer netbook, its not much good for anything. I have batocera installed on it and i need 480p video to play on it.

P.S. with a 320GB HDD, the prev mentioned netbook, some retro game roms and some 480p video files makes an excellent mobile entertainment center.