Mplay examples vf2/1/2024 ![]() The commands we have to add for this are: -vf scale=3840x2160,setdar=16:9 -r 30 Resize video to the moment, the most common playback resolution for 360º video is the UHD resolution of 3840x2160 at 30 frames per second. For example, when we scaled a 4096x4096 video down to 3840x2160 pixels, the height of the output video showed correctly as 21 60 pixels, but the stored_height was 21 76 pixels for some reason, which causes issues when trying to play it back on Android 360º video players. We noticed one strange artefact when using h264_nvenc and hevc_nvenc in combination with scaling. There is unfortunately no hardware acceleration support in FFmpeg for the VP9 codec. If you get any error messages, either your FFmpeg version or your GPU does not support hardware acceleration, or you are using an unsupported -pix_fmt. To use hardware acceleration for H.265/HEVC, use hevc_nvenc instead: ffmpeg -i input.mp4 -c:v hevc_nvenc output.mp4 You use this powerful feature by changing the libx264 codec to h264_nvenc: ffmpeg -i input.mp4 -c:v h264_nvenc output.mp4 We just saw how to encode to H.264 using the libx264 codec, but the latest Zeranoe FFmpeg builds for Windows now support hardware accelerated encoding on machines with Nvidia GPUs (even older ones), which significantly speeds up the encoding process. Sweet huh! They do take way longer to encode though and are not as widely supported as H.264 yet. ![]() This is because the latter ones are advanced codecs which output the same visual quality video at about half the bitrate of H.264. You may have noticed we also halved the video bitrate from 30M for H.264 to 15M for H.265/HEVC and VP9. We also added -threads 16 to make sure FFmpeg uses multi-threaded rendering to speed things up significantly: ffmpeg -i input.mp4 -threads 16 -c:v libvpx-vp9 -b:v 15M -pix_fmt yuv420p -c:a libvorbis -b:a 192K output.webm IOS 11 and OSX 11 now support HEVC playback, but you have to make sure you use FFmpeg 3.4 or higher, and then add -tag:v hvc1 to your encode, or else you won't be able to play the video on your Apple device.įor VP9 we have to change both the video and the audio codec, as well as the file extension of the ouput video. To tanscode to H.265/HEVC instead, all we do is change libx264 to libx265: ffmpeg -i input.mp4 -c:v libx265 -b:v 15M -pix_fmt yuv420p -c:a aac -b:a 192K output.mp4 However, a more reasonable example, which includes setting an audio codec, setting the pixel format and both a video and audio bitrate, would be: ffmpeg -i input.mp4 -c:v libx264 -b:v 30M -pix_fmt yuv420p -c:a aac -b:a 192K output.mp4 The simplest example to transcode an input video to H.264: ffmpeg -i input.mp4 -c:v libx264 output.mp4 -t sets the time or duration of the output.-ss seeks to the given timestamp in the format HH:MM:SS. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |