Dropping from 60p to 30p with Handbrake

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
glenpinn
Posts: 39
Joined: Wed Mar 14, 2012 2:26 am

Dropping from 60p to 30p with Handbrake

Post by glenpinn »

Hi everyone, i have been messing about with Handbrake lately with joining various files together which have different framerates and bitrates.

Today i decided to test Handbrake see how it goes when dropping a 4k/60p AVC file to 4k/30p AVC as i had done this using another program and the output file seemed to play back quite much like the 60p source file, which surprised me as the video was a scene in which the camera was doing a full 360 degree pan of a beach resort, and i expected the output 30p file to be somewhat jerky because of the dropped frames.

I completed the conversion with Handbrake, i selected the Matroska H.264 MKV 2160p60 profile, i changed the framerate to 30 and selected Peak framerate, and i selected MP4 as the output format, i also did another output using constant framerate as well.

When the jobs were completed, the 30p files were both jerky on playback compared to the file from the other program that i used, so i am wondering if i need to select a different output profile or alter my settings so there is not so much jerkiness on playback.

Normally i would never drop a video output to a lower framerate, but this was just something i wanted to try with Handbrake seeing how well it worked in the other software.

Cheers
glenpinn
Posts: 39
Joined: Wed Mar 14, 2012 2:26 am

Re: Dropping from 60p to 30p with Handbrake

Post by glenpinn »

Also, should i be using the normal version, or the Nightly version ?
Deleted User 13735

Re: Dropping from 60p to 30p with Handbrake

Post by Deleted User 13735 »

Changing from 60p to 30p in Handbrake decimates every other frame. All else being equal the jerkiness is caused by your camera's shutter speed.

Framerate conversion is better done in an NLE, which can do such things as resampling, motion blur, and temporal field processing to smooth things out.
glenpinn
Posts: 39
Joined: Wed Mar 14, 2012 2:26 am

Re: Dropping from 60p to 30p with Handbrake

Post by glenpinn »

The 4k/60p file from the camera was very smooth, but i know from experience with the GoPro that if i shot the same video at 30p there would have been some jerkiness in that file because of the panning.

I was just surprised at how much difference there was between Handbrakes 30p output and the output from the other software, which i simply used one of their built in presets, but i just had to change the default output framerate from Same as Source to 30p.

The other output was smooth, almost like the the source file.

So i assume that there is nothing i can do in Handbrake to avoid the jerkiness ?

Also, i have no idea what speed the shutter is set to in the GoPro as i use the "Auto" mode when filming.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Dropping from 60p to 30p with Handbrake

Post by mduell »

Completely different algorithms produce completely different output, go figure.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Dropping from 60p to 30p with Handbrake

Post by BradleyS »

Ideally, HandBrake should drop every other frame in this case. I wonder whether something is causing that to not be the exact case.
Deleted User 11865

Re: Dropping from 60p to 30p with Handbrake

Post by Deleted User 11865 »

We do have code for "smart" frame dropping written by John, maybe it's selecting the wrong frames to drop in that case?
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Dropping from 60p to 30p with Handbrake

Post by mduell »

BradleyS wrote: Fri Jun 19, 2020 12:07 am Ideally, HandBrake should drop every other frame in this case. I wonder whether something is causing that to not be the exact case.
If only we had a log or something to see what actually happened.

Nah, that's be crazy.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Dropping from 60p to 30p with Handbrake

Post by BradleyS »

Rodeo wrote: Fri Jun 19, 2020 12:54 am We do have code for "smart" frame dropping written by John, maybe it's selecting the wrong frames to drop in that case?
My suspicion indeed.
glenpinn
Posts: 39
Joined: Wed Mar 14, 2012 2:26 am

Re: Dropping from 60p to 30p with Handbrake

Post by glenpinn »

I replicated the output and have included the Log File download link below, along with the download links below for the source file, plus the output from Handbrake and the other output using the other software that i used.

And it was a 1080 file not a 4k, i just get used to typing 4k because that is the mode that i usually shoot in.

Source File = 1080 @ 59.94fps (short clip cut from a GoPro 7)
https://ln.sync.com/dl/6323988c0/bb3g9m ... c-cd4ytyx5

Alternate Software 1080 @ 29.97fps
https://ln.sync.com/dl/34b2ab820/fm2tnb ... x-v6y6w7ms

Handbrake 1080 @ 29.97fps
profile used is "Matroska H.264 MKV 1080p30" with the framerate changed to 29.97 - constant framerate - output to MP4
https://ln.sync.com/dl/f94ebe140/jfta4h ... h-ydieztxr

Handbrake Log File
https://ln.sync.com/dl/d8c840bf0/k69ebb ... q-grpg8jan

If there is something that i did incorrectly, please let me know and i will try and fix it.
glenpinn
Posts: 39
Joined: Wed Mar 14, 2012 2:26 am

Re: Dropping from 60p to 30p with Handbrake

Post by glenpinn »

You should be able to play the 3 files from the links if you don't want to download them, they are only small files.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Dropping from 60p to 30p with Handbrake

Post by mduell »

Try without decomb, your 60fps source should be progressive not interlaced.
glenpinn
Posts: 39
Joined: Wed Mar 14, 2012 2:26 am

Re: Dropping from 60p to 30p with Handbrake

Post by glenpinn »

Hi, i just tried it again with the Interlace Detection left on Default and Deinterlace mode turned Off rather than the default of Decomb, and it is still jerky

I tried with Interlace detection turned off as well and it is still jerky.

Cheers
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Dropping from 60p to 30p with Handbrake

Post by JohnAStebbins »

Thanks for the sample. There's definitely a problem here. I'm a bit busy entertaining guests, so it'll be a couple days before I can work out a solution and do some regression testing to be sure I don't break other use cases. Stay tuned, I'll let you know when there's something to try out in the nightly build.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Dropping from 60p to 30p with Handbrake

Post by BradleyS »

8)
glenpinn
Posts: 39
Joined: Wed Mar 14, 2012 2:26 am

Re: Dropping from 60p to 30p with Handbrake

Post by glenpinn »

Thanks a lot John, i shall await for any new developments that you might come up with.

Remember, i don't usually convert video files to lower framerates, i was more curious as to what was happening with Handbrake because i was getting this jerkiness.

When i try to recode a file by doubling the source file framerate it seems to work quite well.

Anyway, i just tried to convert a short 4k/59.94p HEVC video sample from my GoPro to 4k/29.97p AVC and i still got the jerkiness (shudder) on playback as well.

Log file and sample files are below.

1 - Source File - GoPro 7 4-59.94p HEVC @ 61Mbps
https://ln.sync.com/dl/e5e133370/6smim8 ... u-ahchvypx

2 - Handbrake 4k-59.94p HEVC to 4k-29.97p AVC
https://ln.sync.com/dl/baf241450/ubjp5b ... k-5r83ff8s

Log File
https://ln.sync.com/dl/52c95eaa0/b6xym8 ... f-rzq3p275
Deleted User 13735

Re: Dropping from 60p to 30p with Handbrake

Post by Deleted User 13735 »

  • I used an editor to encode your source to 29.97p without resampling, the same as Handbrake does. The resulting stutter was the same as Handbrake, indicating there may be nothing wrong with the way Handbrake handles it.
  • Your source was shot at an extremely fast shutter speed in 59.94p, as evidenced by the sharp detail in the bricks during panning. It's essentially stop-motion for sports.
  • If I then add just 2% motion blur to the video buss, I get this result, which you may or may not like, but it does cure some of the stutter.
  • Again, without temporal interpolation (smoothing), Handbrake does exactly the same as any other encoding engine with your source.
  • https://drive.google.com/file/d/14FPSHI ... sp=sharing
Last edited by Deleted User 13735 on Mon Jun 22, 2020 5:51 pm, edited 1 time in total.
glenpinn
Posts: 39
Joined: Wed Mar 14, 2012 2:26 am

Re: Dropping from 60p to 30p with Handbrake

Post by glenpinn »

@ musicvid

I should have posted the following link in my previous post, just so you could compare the Handbrake output to this one where i used my Alternate software.

GoPro 4k/59.94p HEVC file output to 4k/29.97p AVC
https://ln.sync.com/dl/b2f450e50/kwzynp ... j-jifg8sna

GoPro cameras are action cameras, designed for shooting fast action sports, and that is why i use one for filming my videos, they seem to be able to handle fast motion very well, and another reason for shooting video at 60p (59.94) is because most of my video is Run-n-Gun type shoots where i have the camera mounted on a small hand rig that i carry with me while on holidays etc.

I have no idea what the shutter speed would be on my GoPro 7 either, i shoot video in AUTO mode and change none of the settings, but not being an expert in this field, i still don't see how the shutter speed has any bearing on the jerky playback after dropping the framerate with Handbrake, or why it also does it when using several other editing/encoding tools as well, all i know is that there must be something in my alternate software that is able to prevent this jerkiness, as it appears to be the only tool out of 6 that i tried where the jerkiness does not happen.

Also, you in particular should already know which alternate software i use besides Handbrake, so maybe you should try that software and see what results you get with that, and PM your findings to me or post them in here (i know you don't accept PM's yourself but i do)

Again i am not doing this to deliberately compare different software or encoders, nor am i attempting to flog or promote any other software, i use both hand in hand and i am merely pointing out that there must be an issue somewhere, either with me and the settings that i am using or not using, or with Handbrake itself and the way it works, and John Stebbins above is going to look into it for us, which is great, as he now has the related log files to work with.

Cheers
glenpinn
Posts: 39
Joined: Wed Mar 14, 2012 2:26 am

Re: Dropping from 60p to 30p with Handbrake

Post by glenpinn »

@ musicvid

I downloaded that file you posted, and it was horrible to playback, as soon as i launched it, the Audio was squeeling quite badly all the way thru, and in places the video seemed quite smooth, but in many parts it just fell apart, with very mild to heavy jerkiness (jittering) going on.

I don't know what editing tool or settings you used, but i would like to see what others in this Topic think after playing it back from their own laptop or computer media players.

I usually use MPC-hc but i did try it in VLC as well, same result in both, but there is no way i could use an output like that.

Also, your output bitrate was 118Mb/s which is way over what i think it should be, and the file size is huge because of that (311mb)

With Handbrake i would probably use RF22 on a conversion like that, which would give me a bitrate of around 45Mb/s which is probably very acceptable for a file like that.

The encode done by my Alternate software automatically outputs that 4k/60p HEVC file (61Mb/s) to AVC at around 50Mb/s by default using the profile i created, i can change it to something else if i wanted to.

This is a screenshot of you file using MediaInfo, i noticed that you changed the Audio to PCM.

Image
glenpinn
Posts: 39
Joined: Wed Mar 14, 2012 2:26 am

Re: Dropping from 60p to 30p with Handbrake

Post by glenpinn »

Sorry here is the link for the screenshot of you file using MediaInfo

https://ln.sync.com/dl/7a3308020/g2m7sk ... t-qywrzk98
glenpinn
Posts: 39
Joined: Wed Mar 14, 2012 2:26 am

Re: Dropping from 60p to 30p with Handbrake

Post by glenpinn »

@ musicvid

Actually i just played that file of yours again several times, and i should explain my findings in a better way than i did in my previous post, as it is somewhat different to the way the Handbrake version plays, which is just plain jerky from start to end.

There are a few moments of mild jerkiness, probably 50% of what the jerkiness is like in the Handbrake version (to my eyes) but the rest of it, although it appears to be smoother than the Hanbrake version, there is a fair bit of mild Shimmering going on (not jerkiness) but it is still very difficult for me to look at, and there would be no way that this result would be anywhere near acceptable for my own personal use.

Hope this helps.
Deleted User 13735

Re: Dropping from 60p to 30p with Handbrake

Post by Deleted User 13735 »

If you shoot action at 60 fps and decimate every other frame, the shutter speed will be approximately 2x as fast as if it had been shot at 30 fps, all else being equal. That causes the stutter.

My little experiment with motion blur was XAVC-S, a commercial encoder. Sorry that it doesn't suit your player, but I don't have time to redo it. The momentary stops are a result of discontinuous panning technique. It's but a low level form of temporal smoothing.

Your alternate encode also uses temporal processing, better than my example, and that is a feature that Handbrake does not have, but it is not a fault. As I said, HB drops or dupes frames, not anything else. And it performs that function correctly. I would be interested in knowing the name of your alternate encoder, so I can test it. It's what I do.

So for you, the elegant solution i s to encode at the frame rate you shot. Lacking that, you can reframe your question as a Feature Request to the developers, asking for "temporal smoothing" or "optical flow" processing in a future version.

Take note that this would not be a trivial request. It would take under-the-hood work, and is typically a feature for nonlinear editor$, which Handbrake has never purported to be nor to imitate. Appealing to Developer interest is what you need to do here.

I hope this sheds some light on your observations. Here is some background reading to help bring you up to speed on shutter speeds and angles, such as are used by your GoPro. Good luck with your feature request.

https://www.polarprofilters.com/blogs/p ... ects-video

https://www.spivo.com/blogs/news-update ... 20movement.
glenpinn
Posts: 39
Joined: Wed Mar 14, 2012 2:26 am

Re: Dropping from 60p to 30p with Handbrake

Post by glenpinn »

It's not your fault that your experiment file does not suit me or my player, it is what it is, and i also understand that it is also not the fault of Handbrake either.

As i previously mentioned, my Alternate software developers have seemingly managed to add a feature to it's encoder in such a way that it prevents the jerkiness or shimmering when dropping the output framerate, and it seems to work very well in my opinion, as i can barely tell the difference (if any) between the source file and the output file to be honest.

In the end, i have never had any real reason for wanting to output any source files at a lower framerate, it does not make any sense in most cases, which is why i shoot all my video at 50 or 60fps but i generally can't stand watching any video, especially action type video that is shot in anything under 50fps, 25p and 30p just doesn't cut it for playback without any jerkiness, unless you are able to smooth it out during the output process.

I am just curious to see what John comes up with.

Cheers
Deleted User 13735

Re: Dropping from 60p to 30p with Handbrake

Post by Deleted User 13735 »

Yes, looking closer, I do see some stuttering in the Handbrake version that is not present in my non-resampled NLE test, so perhaps Mr. Stebbins can share some light on that. It's not really something I would do in the course of normal production.

I spend a lot of my retirement time testing encoders for commercial users and post production. If you don't feel comfortable naming your alternate encoder here, could you please send it in a PM? Thanks, I would like to test it as well.

Do follow up with your progress. I get occasional requests for this type of help, and yet I haven't been able to afford Twixtor.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Dropping from 60p to 30p with Handbrake

Post by mduell »

Filters exist that blur the frames to make low framerate content more tolerable when it was shot with a high shutter speed. HB hasn't implemented those.
Post Reply