Hello fellows,
I'd like to know if there's some way to convert an .avi file video to a .mp4 file with ffmpeg withe ~ the same quality.
Now, the .avi file which I'd like to convert is mpeg4 encoded not Divx or Xvid and I think this would make things easier.
Anyway these are the specification of the file:
I'd like to re-encode it in H264 with ACC sound while keeping approximately the same video quality although the file size will certainly increase.Code:Metadata: encoder : Some super fast AVI muxer Duration: 00:21:11.78, start: 0.000000, bitrate: 1154 kb/s Stream #0.0: Video: mpeg4, yuv420p, 624x352 [PAR 1:1 DAR 39:22], 23.98 tbr, 23.98 tbn, 23.98 tbc Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 160 kb/s
Thank you for your time!
+ Reply to Thread
Results 1 to 6 of 6
-
-
I would try convert with x264(=h264 encoder) constant rate/quality/quantizer factor with around 20(decrease for better quality/bigger file size) and 128k aac audio.
Code:ffmpeg -i input.avi -c:v libx264 -preset slow -crf 22 -c:a libfaac -b:a 128k output.mp4
See http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide for more examples.
But do you really have to convert? Many devices supports avi divx/xvid/mpeg4 fine.Last edited by Baldrick; 8th Nov 2012 at 14:29.
-
Thank you for your answer Baldrick.
I've tried your solution but it returns me:
Code:Unrecognized option 'c:v'
But do you really have to convert? Many devices supports avi divx/xvid/mpeg4 fine.
Any other suggestion? thanks again! -
YOu could just try remux to a mp4 with ffmpeg. No reconversion.
Code:ffmpeg -i input.avi -acodec copy -vcodec copy output.mp4
And for the c:v options I guess you need a newer ffmpeg version, http://ffmpeg.zeranoe.com/builds/ . But just the remux with acodec vcodec should work your current ffmpeg version. -
Thank you again.
My version of ffmpeg is the 0.07.13 installed via MacPorts on OSX Lion.
It seems to be the most updated version for OSX systems.
I've tried to convert my file with your suggested command but all I have is an .mp4 with lower fps and no sound...
I think another solution could be use Hanbrake using ~ the same average bitrate.
Is there other solutions to convert an .avi file to .mp4 maintaining ~ the same quality other than that?
Thanks! -
Here is the deal. If for example you were to specify a target video size you could on average specify something 40% smaller than than avi for the video portion and get the same subjective visual quality. So lets say your avi had a video bit rate of 1200 kbs. You might try re-encoding the video to 720 kbs. The problem is both mpeg4 and h264 are lossy compressions. Meaning the number of artifacts add. The 60% reduction only works if you can go back to the original source. If you already have mpeg4 encoded video layer, then any re-encoding will only make it worse. So you options are you pick a high enough quality factor that you don't notice the additional problems, or you don't re-encode. A quality factor of 20 tends to work well, as that is a level well most people don't notice the artifacts introduced by compression. Thus when you convert your video you will only notice the original mpeg4 defects.
Similar Threads
-
ffmpeg: best possible quality for 720p h264(mp4), bitrate under 2 mbps
By lisx in forum Video ConversionReplies: 0Last Post: 1st Aug 2011, 14:56 -
AVI (DV Pal) to mp4 (h264) with FFMPEG on Windows
By Zoreil59 in forum Video ConversionReplies: 3Last Post: 17th Jun 2010, 03:35 -
Not working Windows ffmpeg -i MVI_3781.AVI main.mp4
By lindylex in forum Video ConversionReplies: 7Last Post: 3rd Jun 2010, 13:50 -
ffmpeg command for mp4 to high quality dvd
By mehdi0016 in forum Video ConversionReplies: 3Last Post: 20th Apr 2010, 05:25 -
FFMPEG AVI (XVID) to IPOD Mp4, AUDIO OUTPUT is 2x Normal Speed, HELP!
By jiulonghks in forum ffmpegX general discussionReplies: 1Last Post: 20th Sep 2008, 23:35