Changes between Version 21 and Version 22 of Encode/YouTube
- Timestamp:
- Jun 13, 2018, 6:31:29 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Encode/YouTube
v21 v22 1 = How to Encode Videos for !YouTube and other Video Sharing Sites = 1 {{{ 2 #!html 3 <h1 style="font-size: 22px;"> 4 How to Encode Videos for YouTube, Facebook, Vimeo, twitch, and other Video Sharing Sites 5 </h1> 6 }}} 2 7 3 Since !YouTube, Vimeo, and other similar sites will re-encode anything you give it the best practice is to provide the highest quality video that is practical for you to upload. Uploading the original content is the first recommendation, but this is not always a choice due to file size or bandwidth limitations, so re-encoding may be required. This guide will show you how to create a high quality video using `ffmpeg`. 8 [[PageOutline(1, Contents)]] 9 10 Because !YouTube, Vimeo, and other similar sites will re-encode anything you give it the best practice is to provide the highest quality video that is practical for you to upload. Uploading the original content is the first recommendation, but this is not always a choice due to the file size or format, so re-encoding may be required. This guide will show you how to create a high quality video using `ffmpeg`. 4 11 5 12 First read the [[H.264]] guide; specifically the section on CRF. The examples below use the same method as shown in the encoding guide but optimized for !YouTube. 6 13 7 = = Basic Examples ==14 = Basic Examples = 8 15 9 16 Re-encode the video and [https://ffmpeg.org/ffmpeg.html#Stream-copy stream copy] the audio. The output should be a similar quality as the input and will hopefully be a more manageable size. … … 22 29 }}} 23 30 24 = = Processing During Upload ==31 = Live Streaming = 25 32 26 To satisfy their suggestion of: "Your videos will process faster if you encode into a streamable file format." 33 See [[EncodingForStreamingSites|Encoding for Streaming Sites]]. 34 35 = `faststart` for MP4/M4V/MOV files = 36 37 If uploading MP4/M4V/MOV files [https://support.google.com/youtube/answer/1722171?hl=en YouTube recommends that the moov atom should be at the beginning of the file]. You can do this with the following option: 27 38 28 39 {{{ … … 30 41 }}} 31 42 32 == Live Streaming == 43 If you already have a MP4/M4V/MOV file and want to "faststart" it then you can do so without needing to re-encode by using [https://ffmpeg.org/ffmpeg.html#Stream-copy stream copy] mode: 33 44 34 See [[EncodingForStreamingSites|Encoding for Streaming Sites]]. 45 {{{ 46 ffmpeg -i input.mp4 -c copy -movflags +faststart output.mp4 47 }}} 35 48 36 == Utilizing the included album cover/art == 49 {{{ 50 #!div style="border: 1px solid #e5e5c7; margin: 1em; background-color: #ffd;" 51 '''Note:''' For other formats, such as Matroska (MKV), `-movflags +faststart` is not necessary and will be ignored. 52 }}} 53 54 = Utilizing the included album cover/art = 37 55 38 56 Some music files contain the album cover. … … 64 82 If your music file does not contain album art then see the '''Create a video with a still image''' example above. 65 83 66 = = Using filters ==84 = Using filters = 67 85 68 86 You can use filters to create effects and to add text. This example will use the [https://ffmpeg.org/ffmpeg-filters.html#avectorscope avectorscope], [https://ffmpeg.org/ffmpeg-filters.html#showspectrum showspectrum], and [https://ffmpeg.org/ffmpeg-filters.html#showwaves showwaves] filters to create effects, the [https://ffmpeg.org/ffmpeg-filters.html#overlay overlay] filter to place each effect, and the [https://ffmpeg.org/ffmpeg-filters.html#drawtext drawtext] filter to add text: … … 80 98 }}} 81 99 82 = = FAQ ==100 = FAQ = 83 101 84 == = Encoding is too slow. What should I do? ===102 == Encoding is too slow. What should I do? == 85 103 Use a faster `-preset` value, but note that this will increase the file size when using CRF mode. See the [[H.264]] guide for more information. 86 104 87 == = My video colors are messed up in my computer's media player or the video sharing site I uploaded my video to. Now what? ===105 == My video colors are messed up in my computer's media player or the video sharing site I uploaded my video to. Now what? == 88 106 Add `-pix_fmt yuv420p` as an output option. Most (or perhaps all) non-FFmpeg based players do not support proper decoding of YUV 4:2:2 or YUV 4:4:4. !YouTube works however.
