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)

  1. Download and unzip FFMpeg
    1. In this example I have copied the FFMpeg files into C:\Program Files (x86)\FFMpeg\
  2. Check to see if H.264 is installed.
    1. Run the following commands:
      1. C:\Program Files (x86)\FFMpeg\bin>ffmpeg.exe -codecs > "C:\Program Files (x86)\FFMpeg\installed.codecs.txt"
      2. This will pipe the output of the codecs FFMpeg can use to a text file.
      3. The text file should look something like:
      4. 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 )
      5. You are looking for the last line above or similar. My system is using the libx264 encoder.
    2. 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.
  3. Run the transcoding:
    1. 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.
    2. C:\Program Files (x86)\FFMpeg\bin>ffmpeg.exe -i <inputFilename> -f mov -qscale 0 -ar 22050 -vcodec libx264 <outputFileName>
  4. Sit back and watch the action (or go have a coke, it's like watching paint dry really).
If no problems, upload and enjoy.

Happy (trans)coding.

Răspunsul a fost util?