The article he quotes mentions using multi-pass conversion, which is a good way to achieve better compression without sacrificing quality. Marty Jay helpfully mentions that sameq means same quantizer as in the input, which may not result in the same quality. The last time I transcoded video I used qscale=8.0, but I'd suggest that you experiment to find the optimum to match the quality of your input. The lower the number the better the quality, but the more space your file will take. Alternatively, you may want to use the qscale option to set the quality manually. I hope you can use zetah's suggestion above in his comment and use the -sameq switch. If you must transcode because you need to use a particular video codec codec:copy may be helpful if you don't have a reason to transcode (and it should be faster). See FFmpeg Wiki: H.264 and FFmpeg Wiki: AAC for more info.You always lose a little quality whenever you transcode from one codec to another, video or audio, but perhaps you can avoid it if you only want to change from MP4 container type to an AVI container. This allows the video to begin playing faster if it is watched via progressive download playback. -movflags +faststart is an option for MP4 output that move some data to the beginning of the file after encoding is finished.-vf format=yuv420p chooses YUV 4:2:0 chroma-subsampling which is recommended for H.264 compatibility.-b:a 160k encodes the audio with a bitrate of 160k.-c:a aac selects the audio encoder aac, which is the built-in FFmpeg AAC encoder.Use the highest value that gives an acceptable quality. ffmpeg -f dshow -videosize 1280x720 -framerate 15 -vcodec mjpeg -i video'Integrated Camera' out.avi You can specify '-vcodec copy' to stream copy the video instead of re-encoding, if you can receive the data in some type of pre-encoded format, like mjpeg in this instance. -crf 20 selects a CRF value of 20 which will result in a high quality output.Use the slowest preset that you have patience for. -preset slow selects the slow x264 encoding preset.-c:v libx264 selects the video encoder libx264, which is a H.264 encoder.Add -c:a aac: ffmpeg -i input.avi -c:v libx264 -preset slow -crf 20 -c:a aac -b:a 160k -vf format=yuv420p -movflags +faststart output.mp4
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |