Video encoding: Difference between revisions

From VisionaireWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 36: Line 36:
== Encoding example ==
== Encoding example ==
In this example you will learn how to encode your movies with ffmpeg manually to create an Video:
In this example you will learn how to encode your movies with ffmpeg manually to create an Video:
* based on the MKV_3000Kbps_720p quality result settings
* based on the MKV_3000Kbps_720p quality result settings (720p widescreen)
* which uses the VP8 codec for video
* which uses the VP8 codec for video
* which uses the libvorbis codec for audio
* which uses the libvorbis codec for audio
* which is 2-pass-VBR encoded
* which is 2-pass-VBR encoded
* which was 16:9 (Widescreen)


For an 2-pass-VBR encoding we need to execute the same command at 2 times, nothing changed except the flag -pass (1 and 2).
For an 2-pass-VBR encoding we need to execute the same command at 2 times, nothing changed except the flag -pass (1 and 2).
Line 46: Line 47:


'''First Pass:'''
'''First Pass:'''
  ./ffmpeg -i YOURVIDEO.RAW -c:a libvorbis -b:a 160k -aq 9 -strict experimental -async 1 -c:v libvpx -b:v 2800k -bt 234k -r 23.98 -s 1280x720 -aspect 16:9 -trellis 0 -me_range 16 -i_qfactor 0.71 -b_strategy 1 -qmin 3 -qmax 51 -qdiff 4 -sc_threshold 40 -sn -pass 1 -passlogfile ./pass -threads 2 -y OUTPUT.WEBM
  ./ffmpeg -i YOURVIDEO.RAW -c:a libvorbis -b:a 160k -aq 9 -strict experimental -async 1 -c:v libvpx -b:v 2800k -bt 234k -r 25 -s 1280x720 -aspect 16:9 -trellis 0 -me_range 16 -i_qfactor 0.71 -b_strategy 1 -qmin 3 -qmax 51 -qdiff 4 -sc_threshold 40 -sn -pass 1 -passlogfile ./pass -threads 2 -y OUTPUT.WEBM


'''Second Pass:'''
'''Second Pass:'''
  ./ffmpeg -i hd_distributor_universal_100th_anniversary.m2ts -c:a libvorbis -b:a 160k -aq 9 -strict experimental -async 1 -c:v libvpx -b:v 2800k -bt 234k -r 23.98 -s 1280x720 -aspect 16:9 -trellis 0 -me_range 16 -i_qfactor 0.71 -b_strategy 1 -qmin 3 -qmax 51 -qdiff 4 -sc_threshold 40 -sn -pass 2 -passlogfile ./pass -threads 2 -y output.webm
  ./ffmpeg -i YOURVIDEO.RAW -c:a libvorbis -b:a 160k -aq 9 -strict experimental -async 1 -c:v libvpx -b:v 2800k -bt 234k -r 25 -s 1280x720 -aspect 16:9 -trellis 0 -me_range 16 -i_qfactor 0.71 -b_strategy 1 -qmin 3 -qmax 51 -qdiff 4 -sc_threshold 40 -sn -pass 2 -passlogfile ./pass -threads 2 -y OUTPUT.WEBM





Revision as of 21:36, 5 September 2012

Since Visionaire Studio 3.7 we support matroska (mkv) videos with subtitles, this is while i want to give you some tips and inspirations to use that.

We recommed google's free VP8 video codec with ogg/vorbis audio for the mkv container. These codec has an very good quality which is similar to H.264, but there are no license fees.

Tools you need

  • an video encoder / we recommed ffmpeg for it, because it has can read very much format's and convert it with an excellent quality.
  • an subtitle editor for the format: Advanced Substation Alpha (ASS) / encoded File Encoding = UTF8
  • an mkv editor like MKVToolNix

Some good result settings

You can experiment with the bitrate and quality yourself, but note: Higher Bitrates and Quality = higher CPU usage

  • MKV _512Kbps_288p Matroska video for progressive download on average 3g network connections.
VP8 - DataRate: 400 Kbps - 2 Pass VBR - 512x288 pixels
Vorbis - 64Kbps - 44100Hz - Stereo - Sample Size: 16
  • MKV_768Kbps_360p Matroska video for progressive download on fast 3g network connections.
VP8 - DataRate: 600 Kbps - 2 Pass VBR - 480x360 pixels
Vorbis - 96Kbps - 44100Hz - Stereo - Sample Size: 16
  • MKV_1200Kbps_480p Matroska video for progressive download on fast Wi-Fi network connections.
VP8 - DataRate: 990 Kbps - 2 Pass VBR - 852x480 pixels
Vorbis - 128Kbps - 44100Hz - Stereo - Sample Size: 16
  • MKV_2000Kbps_720p Matroska video for progressive download on slow broadband network connections.
VP8 - DataRate: 1800 Kbps - 2 Pass VBR - 1280x720 pixels
Vorbis - 160Kbps - 44100Hz - Stereo - Sample Size: 16
  • MKV_3000Kbps_720p Matroska video for progressive download on average broadband network connections.
VP8 - DataRate: 2800 Kbps - 2 Pass VBR - 1280x720 pixels
Vorbis - 160Kbps - 44100Hz - Stereo - Sample Size: 16
  • MKV_5000Kbps_1080p Matroska video for progressive download on average broadband network connections.
VP8 - DataRate: 5000 Kbps - 2 Pass VBR - 1920x1080 pixels
Vorbis - 160Kbps - 44100Hz - Stereo - Sample Size: 16

Encoding example

In this example you will learn how to encode your movies with ffmpeg manually to create an Video:

  • based on the MKV_3000Kbps_720p quality result settings (720p widescreen)
  • which uses the VP8 codec for video
  • which uses the libvorbis codec for audio
  • which is 2-pass-VBR encoded
  • which was 16:9 (Widescreen)

For an 2-pass-VBR encoding we need to execute the same command at 2 times, nothing changed except the flag -pass (1 and 2). The first pass writes an logfile and not the OUTPUT.WEBM video. The second pass creates the video from the Logfile which was be written by the flag -passlogfile.

First Pass:

./ffmpeg -i YOURVIDEO.RAW -c:a libvorbis -b:a 160k -aq 9 -strict experimental -async 1 -c:v libvpx -b:v 2800k -bt 234k -r 25 -s 1280x720 -aspect 16:9 -trellis 0 -me_range 16 -i_qfactor 0.71 -b_strategy 1 -qmin 3 -qmax 51 -qdiff 4 -sc_threshold 40 -sn -pass 1 -passlogfile ./pass -threads 2 -y OUTPUT.WEBM

Second Pass:

./ffmpeg -i YOURVIDEO.RAW -c:a libvorbis -b:a 160k -aq 9 -strict experimental -async 1 -c:v libvpx -b:v 2800k -bt 234k -r 25 -s 1280x720 -aspect 16:9 -trellis 0 -me_range 16 -i_qfactor 0.71 -b_strategy 1 -qmin 3 -qmax 51 -qdiff 4 -sc_threshold 40 -sn -pass 2 -passlogfile ./pass -threads 2 -y OUTPUT.WEBM


WebSites

  • FFmpeg (english) – Windows Builds
  • FFmpeg (english) – Macintosh Builds
  • MKVToolNix (english) - All Platforms