Picking encoder / decoder technology

VIRB Edit 3.4 introduced allowing the user to pick which encoder and decoder to use.

You can select this under Settings / General / Advanced.

Encoder (only affects export / sharing):
Media Foundation: Fast, lower quality. Cannot create videos bigger than 4GB on Windows 7, and cannot create videos larger than 1920x1080 or frame rates greater than 120fps. These constraints are caused by Microsoft, so they cannot be fixed by us.
Ffmpeg: Slow (extremely slow at higher quality settings), high quality. No file size or resolution constraints. Produces smaller files than Media Foundation.

Decoder (affects export/sharing and playback):
Media Foundation: (Fast over all performance, but low quality and can't read videos that are too big) Uses graphics hardware, but with lower quality (causes some color quality loss causing videos to look gray). Does not work with videos larger than 1080p. Uses lots of memory
Ffmpeg: (Very fast on PCs with decent CPUs) Higher quality with no resolution constraints. Uses less memory. CPU power is the limiting factor on speed. Fastest performance for PCs with newer CPUs, very very slow for machines with older or slower CPUs.
DXVA: (Really really fast on laptops / notebooks) Uses graphics hardware with comparable quality to ffmpeg. Extremely fast on laptops and other devices with integrated graphics hardware. Slower on machines with dedicated graphics cards. No constraints on resolution.

Summary
Over all, if you have a laptop, DXVA is likely your best option. For PC users, if you want high quality and don’t mind waiting, use Ffmpeg for everything. If you want your video faster, use Media Foundation for everything. Using the Media Foundation decoder and Ffmpeg encoder is a good compromise between quality and speed.
  • Thanks for the comparison Falagar.

    Out of curiosity, how does the decoder affect the export? Is it a case that the recorded clips are first decoded using the decoder then encoded using the encoder to create the final video? If so, does Media Foundation only suffer the colour issues in encoding and not decoding? If both, then won't any clip decoded via Media Foundation also suffer colour loss even if encoded with FFMPEG?

    I'm just trying to understand the process. I've tried both encoders and whilst I haven't done a side by side comparison, they both looked pretty good to me.

    Thanks,
    Brett
  • best format for youtube upload?

    Not sure if this is out of scope for thread but I have been very disappointed with video quality uploaded to youtube.

    I will have to try a test with the Ffmpeg export format, but not sure that will solve the issue.

    After I export a video that is crystal clear in Virb Edit, to an MP4 file, that MP4 file still looks 95% as good on my PC. After I upload to youtube, it looks terrible and the image is often very blurry. Have tried 1080p 30fps, 720p in both 30 and 60fps, all same result. I assume the issue is on youtube, but clearly other people manage to get files uploaded in some format that stay clear after upload for sharing.
  • @wilmar13

    You may upload to Youtube at 1080, but Youtube creates a 240p, 480p, 720p and 1080p version of what you sent. If you want to see higher resolution versions of your video you have to select 1080p from their quality selection menu. Creating the higher resolution videos takes a while, so the options may not show up as soon as you upload, but do show up eventually. When you view your video for the first time on Youtube, I'd bet you are looking at the 480p or 240p version, which is why it looks so terrible.

    @brettkp
    Is it a case that the recorded clips are first decoded using the decoder then encoded using the encoder to create the final video?

    Yes, this is the general process

    Both the encoder and decoder contribute some to final quality, but the decoder matters much much more in terms of color quality. A professional might notice the color quality difference, but it isn't easy to see without doing a side by side comparison. If you do such a comparison though, the difference is actually fairly easy to see. Everything looks a little more gray with the Media Foundation decoder, and more vibrant with Ffmpeg.
  • @wilmar13

    You may upload to Youtube at 1080, but Youtube creates a 240p, 480p, 720p and 1080p version of what you sent. If you want to see higher resolution versions of your video you have to select 1080p from their quality selection menu. Creating the higher resolution videos takes a while, so the options may not show up as soon as you upload, but do show up eventually. When you view your video for the first time on Youtube, I'd bet you are looking at the 480p or 240p version, which is why it looks so terrible.



    No, it is not the displayed resolution on youtube that is the issue... force 1080p playback and it is distorted under motion, but clear with little movement.
  • @wilmar13

    Both the encoder and decoder contribute some to final quality, but the decoder matters much much more in terms of color quality.


    Thanks Purdington,

    Can you please confirm the decoder matters more for colour quality? If that's the case, then wouldn't the FFMPEG decoder be better to use, and then say the Media Foundation encoder for speed?

    Thanks,
    Brett
  • Can you please confirm the decoder matters more for colour quality?

    Yes, the decoder matters more for color quality.

    If that's the case, then wouldn't the Ffmpeg decoder be better to use

    The decoder is also one of the primary determining factor for how fast your export goes. The ffmpeg decoder is almost 3 times as slow as the Media Foundation decoder, and decoding is where a large portion of your export time comes from, so there will be a substantial speed difference in export times. The speed difference between the encoders is smaller. Exporting with the ffmpeg decoder and MF encoder took 25% longer than choosing an MF decoder and Ffmpeg encoder in my performance tests. These numbers depend heavily on the machine you are running on. Differences will be more pronounced on slower machines.

    Over all we felt that a 25% (or more) performance boost outweighed an almost imperceptible quality loss.


    @wilmar13
    My apologies, you are right. It turns out that when Youtube re encodes your videos, it does not handle our overlays well (or other HUD-like content), leading to significant quality loss. I'm told that the same video without overlays ends up looking pristine, which I realized doesn't help you at all. We're looking into what, if anything, we can do about this problem.
  • @wilmar13
    My apologies, you are right. It turns out that when Youtube re encodes your videos, it does not handle our overlays well (or other HUD-like content), leading to significant quality loss. I'm told that the same video without overlays ends up looking pristine, which I realized doesn't help you at all. We're looking into what, if anything, we can do about this problem.


    Another forum user suggested using Opaque gauges... I have not tried that yet but it makes sense.

    The same video without overlays looks a lot better IME... but not pristine. It still screws it up when there is a lot of movement... yet lots of GoPro content does not seem to suffer from this on YT. Not sure if it is the encoding/decoding used or what software is used, or if the user has better bitrate (premium subscription or whatever). Too many uncontrolled variables to draw any conclusion comparing GoPro content from other users to my own Virb stuff... but for sure the gauge overlays make the Virb stuff look significantly worse at speed on YT compared to without gauges.
  • In this thread I commented on an audio sync error. I've just had a bit more of a look at it. It appears to occur when using FFMPEG as the decoder. I can get it to appear within Virb Edit without exporting. It's very pronounced (out by several seconds). As soon as I change to the Media Foundation decoder it's in sync.

    Edit: Just checked the exported file (decode via Media Foundation, encode via FFMPEG) and found it is out of sync. I'm now trying again with Media Foundation for both. It appears that using FFMPEG at all is causing this. My sample is about 50 mins in to the exported video (haven't checked any earlier to see where it goes out of sync).

    Cheers,
    Brett
  • Hello Brettkp,
    A week or two ago I looked into that issue based on your forum post and identified (and fixed) a problem that caused audio to be out of sync. Briefly, for each clip in your project, VirbEdit would lose a small amount of audio. The more clips you have, the more out of sync it becomes. For small projects, so little was lost that it was impossible to tell, but for longer videos (closer to an hour) the loss gradually becomes significant enough to be very noticeable. It was indeed related to using ffmpeg as your encoder. How many clips does your 50 minute project have? I want to be very sure I have completely addressed this problem prior to our next release. Thank you for your help
  • Thanks Purdington!

    The video that it's most obvious in has 30 clips totalling about an hour of footage. I notice the sync problem in the 27th clip, so that would match what you've said.

    Thanks for looking in to this!

    Cheers,
    Brett