Lossless exporting

alexanderbirman
alexanderbirman Posts: 17 Just Starting Out*
edited October 2020 in HitFilm

Hello,

recently I've read a lot of discussions about codecs, exporting, compressions, etc..., but I still haven't received an answer to a question how to stay with the same video quality as the originally filmed.

I have video that is taken with GoPro9: H.265, 1090x1080, 60Mbps, 260fps. The video is just wonderful! It's about 4 minutes long and and takes about 2GB on my HD.

I just want to cut some highlights from it and connect them to a short clip.

I've tried many variants of export, including production and all "from source" options, but the result is always 3-4 times larger on disk and in a much worse quality! It makes me crazy.

I see all the clips in youtube that are taken with GoPro and I obviously see that my results can be much-much better. So how do they do it? How do they preserve a great quality of edited videos?

How do I work lossless during all the process: from importing, through editing and exporting? Logically, the result must be in IDENTICAL quality, but significantly smaller, since I take only 30 seconds from a 4 minute video.

Thanks!

Tagged:

Comments

  • [Deleted User]
    [Deleted User] Posts: 1,995 Just Starting Out
    edited October 2020

    Hi,

    This topic has been recently discussed. Check out this thread as it holds the answer to your question

    https://community.fxhome.com/discussion/54296/lossless-video-export-format-to-later-use-in-hitfilm-again#latest

  • Triem23
    Triem23 Posts: 20,070 Ambassador

    While the thread that @kevin_n has lots of information in it, you'll discover the bottom line to your question "How do I have lossless quality at a file size smaller than the original" is "You can't."

    The h.264/h.265 codecs GoPros record in are inherently lossy - and the reason they're lossy is that they are specifically designed to throw away information to get the file size as small as possible.

    You cannot have a lossless transfer that is smaller than h.264/h.265. It's literally impossible. The linked thread will give you your lossless options, and all of them will be larger than your original file.

  • alexanderbirman
    alexanderbirman Posts: 17 Just Starting Out*

    @Triem23 , forget about "smaller file". When I stated that I want a smaller file I meant that the file is also shorter: 30 sec clip from 4 minutes video.

    GoPros record in are inherently lossy

    - when I watch the files I copy from my camera, I'm more than satisfied with their quality. GoPro does a wonderful lossy job.

    All I ask is to preserve the very same quality on the clip I cut from the original long video.

    Meanwhile, after dozen of tries with various export options, I couldn't get the wished result.

  • alexanderbirman
    alexanderbirman Posts: 17 Just Starting Out*
    edited October 2020

    On the way I understand that the Color Bit Depth has a huge impact on the color quality of the final result. Especially when I film underwater scenes of colorful fish and corals. @Triem23 , am I right?

    The Express version is limited to 8-bit integer, which is far away from the needed dynamic range...

    Another thought: after exporting GoPro Cineform RGB 12-bit, I can't push it to Youtube.

    So what conversion should I use to preserve the quality?

  • [Deleted User]
    [Deleted User] Posts: 1,995 Just Starting Out

    Colour bit depth is less of an issue of the target is YouTube. If the correction and grade is good, then you wont have to worry about that. Once you become really good at managing the other aspects of video, thats when an increase like that will give you that extra 10%. But again, YouTube and other streamers compress like crazy. Consider delivery format, its not HDR blu rays yeah?

  • alexanderbirman
    alexanderbirman Posts: 17 Just Starting Out*
    edited October 2020

    Sure it's not HDR Blue Ray, but lets compare this clip from GoPro on Youtube:


    and my clip from the same GoPro, which hurts my eyes with the pixelization:

    https://photos.app.goo.gl/M3gcg65cQmAUrDfY8

    The visual quality of the first clip - that's the target I want to learn how to achieve.


    P.S. I'm not talking about the content :)) I'm not a pro videographer :)

  • [Deleted User]
    [Deleted User] Posts: 1,995 Just Starting Out
    edited October 2020

    Your question is slightly different from whats been discussed in that thread i linked. For the most part its true.

    ---------

    The hd Hero 3+ has a signal chain capable of up to 8 bit, which resides in a 10 bit capable <container>. (video camera used by GoPro above).

    Bit depth in your case wont play a part in this since the issue is not related to colour at all, just bitrate. Increase the bitrate of your H.264 .MOV export in HitFilm and thats how youre going to achieve less pixelation, and a bigger file size. Variabler bitrate is fine, but do set the max target quite high incase a lot more data is needed.

    Infact the 1080 blu rays, can go from 15000 k bit average to 40000 in an instant back and forth if theres water, ocean, leaves, foliage, etc - to ensure a consistent viewing experience with crisp detail throughout.

  • alexanderbirman
    alexanderbirman Posts: 17 Just Starting Out*

    OK, I'll try it today and report the results.

    Thanks!

  • NormanPCN
    NormanPCN Posts: 4,081 Enthusiast
    edited October 2020

    "Sure it's not HDR Blue Ray, but lets compare this clip from GoPro on Youtube:"

    It doesn't really matter what camera was used. Content is THE important factor in efficient video compression. You video content is different than the other GoPro example given. In places where your example shows massive pixelation the content is completely and massively different than the other GoPro example given. In places of your video were pixelation is not an issue the content is more like the other GoPro example.

    Low bitrate video setups require you capture content that is capable of efficient video compression. Low bitrate is pretty much everything except Blu-ray and DVD. Cable/satellite TV are also low bitrate.

    A $50K cinema camera is going to be just as crap as a $400 GoPro with the same content that does not compress well to low bitrate.

    Your video is mostly first person (FP). This is very often a problem for video compression with forward/backward FP movement. This is because the stuff on screen is changing in scale (aka zoom). The massively pixelated beginning of your video is first person forward movement looking down at a high frequency background (sea floor). Everything in the picture is moving AND changing in scale. Hard to compress. In the other GoPro example there are examples of high frequency background but the camera is to the side and filming the swimmers moving right to left and the high freq background is a slow pan. The BG is moving but not changing in scale. Easier to predict and compress. In the other GoPro video a lot of the BG is no detail blue sea which is trivial to compress. This leaves the available video bitrate to concentrate on the swimmers (whales included 😀). Keeping the swimmer quality up.

    With first person try keep the forward/backward movement down/slower if aiming at high frequency details. Pans are usually okay.

    When you have content that does not compress well you can get your Hitfilm export to have acceptable quality by simply raising the video bitrate. Average and max bitrate. Bitrate cures all ills with video compression. This is assuming a Hitfilm "MP4" export which is AVC/H.264 video. This of course gives a larger file. Bitrate determines the file size. A 20Mbps 1080 file is the same size as a 20Mbps 4K/UHD file.

    You have no control over things like Youtube. Their video encode is what it is. Luckily they are using a better video encoder(s) than apps like Hitfilm/Premiere and you may retain better quality in their result from a quality Hitfilm upload. May... so don't bank on this.

    but the result is always 3-4 times larger on disk and in a much worse quality! It makes me crazy.

    Hitfilm exports in the AVC/H.264 video format for compressed playback type stuff. There are more codecs out there in the world than you can count. Ones actually commonly used are just a few. HEVC/H.265 is what the GoPro is encoding in. HEVC is a follow on subsequent more advanced video codec than AVC. HEVC can compress to smaller files than AVC at the same subjective visual quality level. So all else being equal, and it never is, the Hitfilm export must be larger than the source. Different video formats. AVC vs HEVC. Then their is the quality/capability of the video encoder. So even AVC to AVC, a better video encoder can do a better job at low bitrate. All cars have four tires and an engine. Not all cars handle the same (acceleration, braking and cornering). Video encoders are the same. Some "handle" better than others.

    Video encoders in cameras are pretty basic. Think about it. The camera does not have the compute power of your PC. Also, cameras MUST encode in real time. The PC can take it's time looking for as much possible compression as is possible. PC/computer encoders are universally better at finding and using the "good" kinds of video compression. Good as in little/less visible loss. There is always mathematical loss that you cannot see. So a PC AVC encoder can do as well as a camera HEVC encoder at a given bitrate. Maybe even better. Indeterminate. But a PC HEVC encoder should do better than a PC AVC encoder.

    --

    If you want the smallest file size for you own storage and playback then you will want to encode in an advanced codec like HEVC or VP9. They are widely supported by most all playback systems. Test first. For this you will want to export a very HQ file from Hitfilm. Very high bitrate AVC or Cineform 422, and then use an external encoder to get your final result. Something like Handbrake could be a good choice here. What bitrate should those exports be? Only testing with your specific material and your eyes can determine that.

  • alexanderbirman
    alexanderbirman Posts: 17 Just Starting Out*

    Well, as promised, I report my results:

    1. made an export to an uncompressed .avi file. The quality is as original, but 2 minutes clip takes.... 58GB ))))) Well, not so good.
    2. made a custom export preset (a copy of Youtube 1080p HD), in which I changed the Level from 5.1 to 5.2 and defined variable bitrate: target bitrate the same as in source video, max bitrate twice the target bitrate. The result was 880MB and a very-very descent quality. I would even say "satisfying" :)

    Here are two frames for comparison. The first is the original Youtube 1080p HD preset, the second - my custom preset.

    Especially it's seen on the top of the frame - where are many shades of blue.

    Bottom line: I'm good, discussion can be closed.

    Thanks for your patience and help, @kevin_n and @Triem23 ! Very appreciate it!


  • NormanPCN
    NormanPCN Posts: 4,081 Enthusiast
    edited October 2020

    in which I changed the Level from 5.1 to 5.2 and defined variable bitrate: target bitrate the same as in source video, max bitrate twice the target bitrate

    You can't compare or related HEVC bitrates to AVC. AVC pretty much always needs to be higher, as previously stated. But the PC encoder is better than the camera encoder, compression quality use cases, so that would affect any comparison. Camera video encoders are pretty basic.

    Bottom line, find a bitrate that gets you a desired result.

  • alexanderbirman
    alexanderbirman Posts: 17 Just Starting Out*

    @NormanPCN , wow, that's a great, detailed and comprehensible explanation. Thank you for that! Now I'll keep in mind to pay attention to what and how I'm filming...

    And another question: @kevin_n mentioned that the color depth is not a big issue. It's quite weird: 255 colors is a very poor palette... How can the impact be small?

  • NormanPCN
    NormanPCN Posts: 4,081 Enthusiast

    8-bit is not 255 colors. It is 8-bit per channel with 3 channels. So roughly 16M colors.

    Your GoPro is capturing 8-bit video. This is true of pretty much all cameras we use.

    Playback is near universally 8-bit. Damn near an absolute statement.

  • alexanderbirman
    alexanderbirman Posts: 17 Just Starting Out*

    Well, absolutely no more questions for now :))))

    Many thanks!

  • [Deleted User]
    [Deleted User] Posts: 1,995 Just Starting Out
    edited October 2020

    And another question: @kevin_n mentioned that the color depth is not a big issue. It's quite weird: 255 colors is a very poor palette... How can the impact be small?

    Understanding colours can be confusing. In your example some factors are missing to determine final colour output.

    8 bit colour being 256 colours is not taking into account all available channels. Multiplying 256 red, green and blue gives you a total of 16.7m samples. The math is simple,

    256*256*256=16.777,216

    This is also referred to as 24 bit, or 32 bit of you add the alpha channel (an additional 8 bits).

    We must also take into account that our displays are 8 bit, or 8+2 with dithering, which can work quite well. A native 10 bit display is something that costs a lot of money, dithering has turned that side of things into a grey area, but i digress.

    Glad that your output is looking much bettet to you. Bitrate is vitally important as you just learned!

  • NormanPCN
    NormanPCN Posts: 4,081 Enthusiast

    I edited and elaborated my long compression post a little.

This discussion has been closed.