# Jerky Playback



## Soapm (May 9, 2007)

I just pulled a season of Bilko from the Tivo using kmttg. When I play them using media player classic on my windows machine they play fine but when I play them on my Tivo using pyTivo they appear jerky when motion moves fast.

How can I determine what needs to be tweaked? I don't know if pytivo is causing this as it sends back to the Tivo or did kmttg have a bad setting when it encoded the shows.


----------



## Soapm (May 9, 2007)

Can someone please point me to a good video editing forum where one might understand things like telecine, frame rate conversions and other settings that might cause this phenomenon?


----------



## txporter (Sep 18, 2006)

Soapm said:


> Can someone please point me to a good video editing forum where one might understand things like telecine, frame rate conversions and other settings that might cause this phenomenon?


Good place to start would be videohelp.com. It is generally a pretty nice forum to wade into video editing. If you get really into it, then you would probably want to move onto doom9.org.

Do you have something (VideoRedo is what I use) that you can use to cut a small section of video for folks to look at (maybe 10-30s) that shows the problem that you are seeing? That is usually one of the first things that is asked for.

Nearly all television today is recorded at film rate (23.976 fps) and then pulled down to 29.97fps for broadcast. The Phil Silvers show was broadcast in the 50s though, so I am not really sure how it was shot/broadcast. I would need to look at it. If you can supply a segment of the video, I can take a look at it. Or feel free to use videohelp.com. I have done very little transcoding of older material and there are quite a few folks that sort of specialize in it on various forums.


----------



## Soapm (May 9, 2007)

Sorry, video redo along with my old editing tools like vdub etc.. all balked at the codec. It really isn't noticeable viewing on a PC but start looking at about the 30 second mark. It's noticeably jerky during movement when viewing via my Tivo.

here


----------



## txporter (Sep 18, 2006)

Will download and take a look at your sample tomorrow (in bed on iPhone now). Is this a sample after conversion or before? Need sample of Tivo file not post transcode.


----------



## Soapm (May 9, 2007)

txporter said:


> Will download and take a look at your sample tomorrow (in bed on iPhone now). Is this a sample after conversion or before? Need sample of Tivo file not post transcode.


This is post transcode. I will have to get the Tivo file tomorrow when I can fiddle with kmttg to keep it from transcoding it.


----------



## txporter (Sep 18, 2006)

Ok, great. Need it decrypted but not transcoded.


----------



## Soapm (May 9, 2007)

Sample 2 Here you go, thanks for taking the time to help...


----------



## moyekj (Jan 24, 2006)

FYI your Bilko_sample.mp4 seems to play fine with no jerkiness for me on my Premiere but does seem a lot less smooth played on my S3 OLED unit.
My guess is you have an older series 3 TiVo HD unit right? H.264 decoding improved from series 3 OLED to TiVo HD and then again from TiVo HD to Premiere platform.


----------



## txporter (Sep 18, 2006)

moyekj said:


> FYI your Bilko_sample.mp4 seems to play fine with no jerkiness for me on my Premiere but does seem a lot less smooth played on my S3 OLED unit.
> My guess is you have an older series 3 TiVo HD unit right? H.264 decoding improved from series 3 OLED to TiVo HD and then again from TiVo HD to Premiere platform.


This could be.

Soapm, I looked at your sample and it is just standard film rate material that was telecined to 29.97fps. I noted in your mp4 sample that you can still see the interlacing lines on some of the frames (what profile did you use?). If that is what you were talking about, then that can be fixed with a handbrake encoding profile. I had intended for that to be fixed with the hb_tivo_sd_crf (or hb_tivo_hd_crf) profile. However, I just checked it using kmttg (v0p8r) and it was not actually detelecining. Not sure when that changed. Anyhow, I updated the profile for it to work. Basically, you need to replace "--preset="High Profile" " with "--detelecine --decomb --vfr".

_Note: the --vfr flag can also be set to --cfr to change from variable framerate to constant framerate. I haven't looked into what exactly handbrake does for constant framerate, but I would guess that it would repair the telecined frames but not remove the duplicates (every 5th frame would be a duplicate frame resulting in a bit of judder). You can play around with it to see if it matters for you. If you do have an older S3, then it might like the 29.97fps more than the 23.976-24 fps you will get from vfr._

moyekj, since you are here in the thread, would you mind updating those encoding profiles for your next release? 

hb_tivo_sd_crf:

```
# Description (single line, keep short)
<description>
Handbrake tivo sd: mp4 container, Constant Quality (CRF=19) h.264 video, ac3 audio

# Encode command or script (single line)
# Known keywords: FFMPEG, MENCODER, HANDBRAKE, PERL, INPUT, OUTPUT, PWD, CPU_CORES, SRTFILE
<command>
HANDBRAKE -i INPUT --detelecine --decomb --vfr --large-file -e x264 -f mp4 -O -q 19.0 -a 1 -E ac3 -x keyint=48:min-keyint=4 

--denoise="weak" -v -o OUTPUT
 
# Encoded output file extension
<extension>
mp4
```
hb_tivo_hd_crf:

```
# Description (single line, keep short)
<description>
Handbrake tivo hd: mp4 container, Constant Quality (CRF=21) h.264 video, ac3 audio

# Encode command or script (single line)
# Known keywords: FFMPEG, MENCODER, HANDBRAKE, PERL, INPUT, OUTPUT, PWD, CPU_CORES, SRTFILE
<command>
HANDBRAKE -i INPUT --cpu CPU_CORES --detelecine --decomb --vfr --large-file -e x264 -f mp4 -O -q 21.0 -a 1 -E ac3 -x keyint=48:min-keyint=4 --denoise="weak" -v -o OUTPUT
 
# Encoded output file extension
<extension>
mp4
```


----------



## Soapm (May 9, 2007)

Yes, I have a tivo HD but I noticed xvid plays fairly clear for me but I still have a CRT...

i will try the new profile when I get home. I believe I use Tivo SD in kmttg but that was done using the normal profile directly in handbrake... I have all CRT's so never saw the need for going with HD profiles.


----------



## moyekj (Jan 24, 2006)

Soapm said:


> Yes, I have a tivo HD but I noticed xvid plays fairly clear for me but I still have a CRT...


 xvid will be transcoded to mpeg2 on the fly by pyTivo so what your TiVo is getting is mpeg2 which may explain why that looks OK on your TiVo HD. TiVo HD is good at mpeg2 decoding but picky about H.264 decoding. You can actually force pyTivo to transcode H.264 to mpeg2 as well if you wish by putting certain directives in a metadata file.


----------



## txporter (Sep 18, 2006)

Soapm said:


> Yes, I have a tivo HD but I noticed xvid plays fairly clear for me but I still have a CRT...
> 
> i will try the new profile when I get home. I believe I use Tivo SD in kmttg but that was done using the normal profile directly in handbrake... I have all CRT's so never saw the need for going with HD profiles.


Agree with what moyekj said about xvid. xvid will always be transcoded to MPEG2 when either pulled or pushed from pytivo.

For the mp4/H.264 files, are you pushing them from pytivo to your TivoHD or pulling?

Also, the HD comment is really based on the incoming resolution of the file, not what it is displayed at on your TV. Higher resolution files can run with a higher quality factor and still give good output video.


----------



## Soapm (May 9, 2007)

txporter said:


> Agree with what moyekj said about xvid. xvid will always be transcoded to MPEG2 when either pulled or pushed from pytivo.
> 
> For the mp4/H.264 files, are you pushing them from pytivo to your TivoHD or pulling?
> 
> Also, the HD comment is really based on the incoming resolution of the file, not what it is displayed at on your TV. Higher resolution files can run with a higher quality factor and still give good output video.


Sorry, I had to work late last night and tonight.

What constitutes resolution? Is it the 720x480 or the video bitrate? Or maybe a combination of both?


----------



## jcthorne (Jan 28, 2002)

720x480 is SD not HD.

Broadcast HD is either 1280x720 p60 or 1960x1080 i30.


----------



## moyekj (Jan 24, 2006)

@jcthorne, thanks, I updated hb_tivo_sd_crf and hb_tivo_hd_crf kmttg profiles per your post for next release.


----------



## txporter (Sep 18, 2006)

@Soapm: As jcthorne indicated, the resolution is the frame size (i.e. 720x480). 

SD = standard definition is what we were used to with NTSC broadcasts that ended in 2009 in the US. The most common resolutions for US SD to be broadcast in was 640x480 and 720x480. DVD is also SD resolution. I believe all US NTSC broadcasts as well as US DVD are run at 29.97fps.

HD = high definition is what we see now with ATSC broadcasts. Most common resolutions for HD are 1920x1080 and 1280x720. 720p transmissions are sent as 59.94 progressive frames. 1080i transmissions are sent as 59.94 interlaced fields.

@moyekj: Thanks for updating the profiles.


----------



## Soapm (May 9, 2007)

txporter said:


> This could be.
> 
> I noted in your mp4 sample that you can still see the interlacing lines on some of the frames (what profile did you use?). If that is what you were talking about, then that can be fixed with a handbrake encoding profile. I had intended for that to be fixed with the hb_tivo_sd_crf (or hb_tivo_hd_crf) profile.


I used the updated Tivo_SD profile today and it appears a lot better. There is still something about fast movement that appears as jerkiness but it's definitely a lot better and watchable now so I appreciate it very much.

I also noticed the shows look and play fine on my premier.


----------



## unitron (Apr 28, 2006)

txporter said:


> Good place to start would be videohelp.com. It is generally a pretty nice forum to wade into video editing. If you get really into it, then you would probably want to move onto doom9.org.
> 
> Do you have something (VideoRedo is what I use) that you can use to cut a small section of video for folks to look at (maybe 10-30s) that shows the problem that you are seeing? That is usually one of the first things that is asked for.
> 
> Nearly all television today is recorded at film rate (23.976 fps) and then pulled down to 29.97fps for broadcast. The Phil Silvers show was broadcast in the 50s though, so I am not really sure how it was shot/broadcast. I would need to look at it. If you can supply a segment of the video, I can take a look at it. Or feel free to use videohelp.com. I have done very little transcoding of older material and there are quite a few folks that sort of specialize in it on various forums.


Bilko, being B&W, would likely have been broadcast at a 60Hz vertical sweep, resulting in 60 fields/30 frames.

It wasn't until "Never Twice the Same Color" that they dropped it to 59.whatever for some reason connected to the 3.58Mhz color sub-carrier.

I thought actual, like they used in Hollywood, film was a straight 24 frames per second, though.

And I guess they ran the film through a flying spot scanner for the original broadcasts. CBS, if I remember correctly.

They should have had Hartman play Bilko in the movie instead of Martin.

He could have done an excellent Silvers.


----------



## txporter (Sep 18, 2006)

unitron said:


> Bilko, being B&W, would likely have been broadcast at a 60Hz vertical sweep, resulting in 60 fields/30 frames.
> 
> It wasn't until "Never Twice the Same Color" that they dropped it to 59.whatever for some reason connected to the 3.58Mhz color sub-carrier.
> 
> ...


I suspected something like that might be the case. But the sample that Soapm sent me looked like straight 3:2 telecine material.

@Soapm- Try updating the profile again and change the --vfr flag to --cfr instead. It will output 29.97fps video rather than 23.976fps. I found that TivoHDs would get a sort of shimmer effect on video with <25 fps. Running at 29.97fps might fix the problem for you.


----------



## unitron (Apr 28, 2006)

txporter said:


> I suspected something like that might be the case. But the sample that Soapm sent me looked like straight 3:2 telecine material.
> 
> @Soapm- Try updating the profile again and change the --vfr flag to --cfr instead. It will output 29.97fps video rather than 23.976fps. I found that TivoHDs would get a sort of shimmer effect on video with <25 fps. Running at 29.97fps might fix the problem for you.


You have to remember, he didn't time machine his TiVo back to 1957 to pick up a broadcast from the local CBS affiliate*, so who knows what kinds of electronic cuisinarts that video's been put through.

*Wouldn't you LOVE to be able to do that?


----------



## txporter (Sep 18, 2006)

unitron said:


> You have to remember, he didn't time machine his TiVo back to 1957 to pick up a broadcast from the local CBS affiliate*, so who knows what kinds of electronic cuisinarts that video's been put through.
> 
> *Wouldn't you LOVE to be able to do that?


Yes, I totally agree with you. Anything could have been done to the video to get it into its current state.

And I just noted your comment in the earlier reply about FILM rate. You are totally correct that FILM rate is 24 fps, and it is dropped to 23.976fps by dropping every 1000th (or 1001st?) frame to make the 3:2 telecining process to 29.97fps easier.


----------



## unitron (Apr 28, 2006)

txporter said:


> Yes, I totally agree with you. Anything could have been done to the video to get it into its current state.
> 
> And I just noted your comment in the earlier reply about FILM rate. You are totally correct that FILM rate is 24 fps, and it is dropped to 23.976fps by dropping every 1000th (or 1001st?) frame to make the 3:2 telecining process to 29.97fps easier.


So what did you do with the

+ 1TB WD10EVCS Antec MX-1

???


----------



## txporter (Sep 18, 2006)

unitron said:


> So what did you do with the
> 
> + 1TB WD10EVCS Antec MX-1
> 
> ???


Re-purposed. I had two power supplies die on my TivoHD that had the external drive attached to it. When I move to the 2TB Premiere as my main machine, I dropped my TivoHD back to 1TB. It is just my backup Tivo now.


----------



## Soapm (May 9, 2007)

Trying it now and will report back.


----------



## Soapm (May 9, 2007)

Still looks great though I have to admit with my old eyes I really don't see a difference between vfr and cfr. Perhaps the Tivo mask the difference or I don't know what to look for.


----------



## ggieseke (May 30, 2008)

unitron said:


> You have to remember, he didn't time machine his TiVo back to 1957 to pick up a broadcast from the local CBS affiliate*, so who knows what kinds of electronic cuisinarts that video's been put through.
> 
> *Wouldn't you LOVE to be able to do that?


A REALLY good antenna and about 330 trillion miles worth of RG-6 coax should do the trick.


----------



## txporter (Sep 18, 2006)

Soapm said:


> Still looks great though I have to admit with my old eyes I really don't see a difference between vfr and cfr. Perhaps the Tivo mask the difference or I don't know what to look for.


Do you have a copy of both output files still? If you download a copy of MediaInfo, you can analyze the files and see the framerate differences. The main difference between the mp4 transcode with --vfr vs --cfr is that the --vfr transcode will have variable framerate with an average fps of ~24. The --cfr transcode will have a constant framerate of 29.97fps. I was just wondering if that addressed the playback issues that you noted on your TivoHD. TivoHD show some odd playback issues with H.264/MP4 files with framerates at or below 24-25 fps.

Ideally, the --vfr transcode from Handbrake should have the original progressive frames while the --cfr transcode will likely have the original progressive frames plus some duplicate frames in order to make up the delta between the original frame count and the called for framerate (~24 frames vs ~30 frames asked for). If you are sensitive to judder (this is caused by the presence of duplicate frames in the playback stream), then you would probably find the --cfr transcode less pleasing to view. If the problem is the TivoHD playback abnormalities, then you might find the --cfr transcode looks better when viewing.


----------



## dlfl (Jul 6, 2006)

ggieseke said:


> A REALLY good antenna and about 330 trillion miles worth of RG-6 coax should do the trick.


Yeah, but that's assuming the antenna and cable end are 57 light years away. Then you have to wait (more than) another 57 years from now for the antenna signal to come down the coax. For that reason this scheme is totally impractical.

The practical scheme that would allow instant viewing is to have deployed a 165 trillion mile long cable and antenna, 28.5 years ago. Then the signal would be reaching earth right now.

There are a few other practical issues but surely we can hire some scientists from China or India to work them out.


----------



## lrhorer (Aug 31, 2003)

dlfl said:


> Yeah, but that's assuming the antenna and cable end are 57 light years away. Then you have to wait (more than) another 57 years from now for the antenna signal to come down the coax. For that reason this scheme is totally impractical.
> 
> The practical scheme that would allow instant viewing is to have deployed a 165 trillion mile long cable and antenna, 28.5 years ago. Then the signal would be reaching earth right now.
> 
> There are a few other practical issues but surely we can hire some scientists from China or India to work them out.


'No need for time travel or 30 lightyear long CATV cables with billions of amplifiers to overcome the huge attenuation involved, or the totally ludicrous notion of building a time machine. The solution is quite trivial. Just build a parabolic radio dish with a radius about 4 times that of the Earth and use it to recover the signals reflected from the debris ring around Formalhaut, silly boy.


----------



## Soapm (May 9, 2007)

ggieseke said:


> A REALLY good antenna and about 330 trillion miles worth of RG-6 coax should do the trick.


Actually I went with a more practical solution, I moved the date back on the Tivo but still waiting for the guide to update...


----------



## Soapm (May 9, 2007)

txporter said:


> If the problem is the TivoHD playback abnormalities, then you might find the --cfr transcode looks better when viewing.


I'm cool with the first changes you suggested and have been redoing all the episodes. Both looked better then it did before so I appreciate all the help.

I will keep these lessons in my notes in case I run into a situation where they might help. I love old shows...


----------



## unitron (Apr 28, 2006)

Soapm said:


> Actually I went with a more practical solution, I moved the date back on the Tivo but still waiting for the guide to update...


In that case, see if you can catch some old Milton Berle show episodes as well, or maybe something from the DuMont network.


----------



## Soapm (May 9, 2007)

unitron said:


> In that case, see if you can catch some old Milton Berle show episodes as well, or maybe something from the DuMont network.


I put them in my wish list and been forcing my Tivo to connect for the last couple of hours. I'll put them up as soon as the guide data updates.... :up:


----------



## unitron (Apr 28, 2006)

Soapm said:


> I put them in my wish list and been forcing my Tivo to connect for the last couple of hours. I'll put them up as soon as the guide data updates.... :up:


If you see the Kennedy-Nixon debate listed you didn't set the clock back far enough.

If you see Nixon's Checkers speech listed, it's too far back, but you might catch the debut of I Love Lucy.


----------

