Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

convert from avi to mp4 using ffmpeg

Tags:

html

video

ffmpeg

I want to play an avi video format file in browsers using HTML5 video code. Since the avi format file doesn't play in browsers i have to convert it into mp4 format file.

For conversion i am using the ffmpeg code in Windows.

ffmpeg -i input.avi OUTPUT.mp4

The conversion of video is completed but the video codec and audio codec isn't valid thus it fails to play to play using video tag in html5.

Please find me proper code which coverts the file. another conversion code i tried was.. ffmpeg -i input.avi -c:v libx264 -preset slow -crf 22 -c:a libfaac -b:a 128k OUTPUTAVINew.mp4 but i got error as libfaac unknown encoder please help me out and even i downloaded the **libfaac.dll** but didn't work out `

like image 574
user3217695 Avatar asked Nov 25 '25 16:11

user3217695


1 Answers

Old, but this post comes up tops in searches so...

ffmpeg should easily convert from avi to mp4 without re-encoding. (Do not specify new codecs!)

ffmpeg -i input.avi -c:v copy -c:a copy OUTPUT.mp4

Should also mention that batch conversions run most reliably when the script contains static data with each ffmpeg call on a new line (as opposed to having the script generate each call dynamically using variables).

like image 81
u2n Avatar answered Nov 28 '25 17:11

u2n



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!