New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
video should be H264+AAC codecs - How to do on a Ubuntu VPS
vladimirlenin
Member
in Help
Hello friends, I'm not an expert in handling server related stuff. I want to know how to encode videos in to streamable formats. Exactly "H264+AAC codecs". FFMPEG is very tricky. Can someone guide me pls...
Comments
You could use Plexus. https://github.com/Wolveix/Plexus
Developed by @Wolveix.
@vladimirlenin Convert the video with libx264 and audio to AAC two channels:
ffmpeg -i input.mp4 -c:v libx264 -crf 22 -preset:v veryfast -ac 2 -c:a libfdk_aac -vbr 3 output.mp4
Hey @randy33 Thanks. But I'm getting this error Unknown encoder 'libfdk_aac'
@vladimirlenin
Try
ffmpeg -i input.mp4 -vcodec libx264 -crf 22 -preset:v veryfast -ac 2 -acodec aac -ab 128K -strict -2 output.mp4
@randy33 thank you so much bro You are the saviour.....
@vladimirlenin
You can vary the quality of the video with presets. A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). This means that, for example, if you target a certain file size or constant bit rate, you will achieve better quality with a slower preset. Similarly, for constant quality encoding, you will simply save bitrate by choosing a slower preset.
Use the slowest preset that you have patience for. The available presets in descending order of speed are:
ultrafast
superfast
veryfast
faster
fast
medium – default preset
slow
slower
veryslow
Hey @randy33 i need one more help. How to auto convert all downloaded videos that are not in above format without executing the above command manually? Thanks
Batch command line
for i in *.mp4; do ffmpeg -i "$i" -vcodec libx264 -crf 22 -preset:v veryfast -ac 2 -acodec aac -ab 128K -strict -2 "$i_encode.mp4"; done
@vladimirlenin What kind of video do you encode btw
Thank you so much @randy33 you are awesome I messaged you the details
:P