Biblioteca de cunoștințe
Transcoding video to web-ready format Tipărire
In this example I will run a transcode of an mp4 with a high bit-rate to a quicktime/mov file, encoded with H.264, with a lower bit-rate and smaller file size.
You will need:
FFMpeg: http://ffmpeg.zeranoe.com/builds/
H.264 encoding codec: x264 Windows build (32 bit)
Happy (trans)coding.
You will need:
FFMpeg: http://ffmpeg.zeranoe.com/builds/
H.264 encoding codec: x264 Windows build (32 bit)
- Download and unzip FFMpeg
- In this example I have copied the FFMpeg files into C:\Program Files (x86)\FFMpeg\
- Check to see if H.264 is installed.
- Run the following commands:
C:\Program Files (x86)\FFMpeg\bin>ffmpeg.exe -codecs > "C:\Program Files (x86)\FFMpeg\installed.codecs.txt"
- This will pipe the output of the codecs FFMpeg can use to a text file.
- The text file should look something like:
-
Codecs:
D..... = Decoding supported
.E.... = Encoding supported
..V... = Video codec
..A... = Audio codec
..S... = Subtitle codec
...I.. = Intra frame-only codec
....L. = Lossy compression
.....S = Lossless compression
-------
(There's many, many codecs. I'll skip to the relevant section).....
DEV.L. h261 H.261
DEV.L. h263 H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2
D.V.L. h263i Intel H.263
DEV.L. h263p H.263+ / H.263-1998 / H.263 version 2
DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (encoders: libx264 libx264rgb ) - You are looking for the last line above or similar. My system is using the libx264 encoder.
- If you don't see an E on the line that has H.264 / AVC / MPEG-4 AVC... you will need to install the H.264 encoder.
- Run the following commands:
- Run the transcoding:
- Use this command, replacing the stuff in <> to the relevant file names.
- since I have libx264 installed, I use libx264. Use one of the encoders from the output above.
C:\Program Files (x86)\FFMpeg\bin>ffmpeg.exe -i <inputFilename> -f mov -qscale 0 -ar 22050 -vcodec libx264 <outputFileName>
- Use this command, replacing the stuff in <> to the relevant file names.
- Sit back and watch the action (or go have a coke, it's like watching paint dry really).
Happy (trans)coding.