Hello,
Is there a more efficient way to restore missing frames besides rendering both ChangeFPS & SRestore when converting video clips (1080i to 1080-24p)?
I’m working with a US BD that has film and video. Original video clips are late 60’s UK so I assume PAL 25i.
Delivery is BD, ideally 1080-24p, but will settle for 720-60p if needed. Oddly enough some of the film clips are 1080i 29.97fps (I’d expect all film clips to be 23.976). I converted the video clips using the script(s) below (interchanged SRestore & ChangeFPS), but get a few missing frames at different areas of each render. I even tried AssumeFPS but that seemed to have the most missing frames.
Is there a better script to convert? Lining up both AVI's in my NLE and switching between the two has not been fun.
v =LWlibavVideoSource("Revolution.m2ts")
a =LWlibavAudioSource("Revolution.m2ts")
AudioDub(v,a)
AssumeTFF()
QTGMC(preset="draft") #draft is just for testing
SRestore(23.976)
prefetch(8)
+ Reply to Thread
Results 1 to 30 of 39
-
-
Haven't looked at the source, but reading:
I even tried AssumeFPS but that seemed to have the most missing frames.
You could try whether using LWlibavVideoSource with hardware decoding helps, otherwise using another source filter is advised.users currently on my ignore list: deadrats, Stears555, marcorocchini -
Last edited by Sharc; 22nd Mar 2025 at 06:06. Reason: file attached (video only)
-
Ya I wouldn't think that clip was telecined, as it's clearly video-sourced and not film. But there are other clips on the BD that are film-sourced yet are 29.97fps. I want to have all clips @1080-24p and burn a BD.
-
That clip content is 25fps. It's a field blended 25p content to 29.97i conversion. Srestore is dropping 1 good frame every second at 23.976 fps. It should be Srestore(frate=25)
You have a difficult decision if you want it all 24fps . Most people wouldn't want to mess with the audio for concerts, because you'd have to slow it down after deblending, and resample the audio to make it 24p. The only decent option for smooth 24fps on a source like that is to retime it using RIFE or similar after deblending to unique frames, at the risk of generating new artifacts from interpolation .
Otherwise for NTSC area BD, you leave it at 29.97i , either with blends or duplicates. Blends are what it used in the first place to make it compatible. At least the audio is preserved, so this is what is typically used for commercial releases for 25p content for NTSC area releases
For the film segments, you'd IVTC and join . This suggests the rate should be 24000/1001, not 24/1 - Otherwise you need to retime the audio. -
I am confused on how the same disc can have clips with two different frame rates. As you mentioned, the clip I posted is 29.97i, but other clips are 23.976p.
I thought about making the project 60p but would be limited to 720 due to BD standards. Or I suppose I could convert the film clips to 25p? But I'm guessing that wouldn't be ideal.
I'm not familiar with RIFE. I'll have to see if I have that plugin.
When you say "join" for IVTC segments, what do you mean by join? -
Looking at the clip, the source seems to be 25fps, assuming that is correct (a scene with horizontal movement would have been better to figure this out), you could, for example:
- go for 25fps and then decide how to get to 24fps
- bob deinterlace, replace the duplicates with interpolations and go for 60fps
- bob deinterlace, keep the duplicates and go for 60fps
users currently on my ignore list: deadrats, Stears555, marcorocchini -
Different titles on a disc can use different framerates
You can have a mix of 23.976pN (native progressive) and 23.976p in 29.97i (3:2 telecined), as well as interlaced content, or any combination
Even within the same title, you can have mixed content, when the container is 29.97i. It's essentially the same rules as DVD. By repeating fields, you can represent different content frame rates all within a 29.97i stream.
I thought about making the project 60p but would be limited to 720 due to BD standards.
But "60p" gives you some of the same difficulties, because 25 is not evenly divisible into 60 . One benefit is you take field matching or deinterlacing out of the equation by the equipment for a 1080i29.97 BD. The viewing will be more consistent to what you make
Or I suppose I could convert the film clips to 25p? But I'm guessing that wouldn't be ideal.
When you say "join" for IVTC segments, what do you mean by join? -
Selur: I'm guessing duplicate frames would look better than missing frames, whichever rate I end up using.
poisondearthray: I thought I had to convert everything to the same rate in order to not see any interlace artifacts? Ideally I'd like all clips progressive. Are you saying I can have a mix of 1080i and 1080p on the same disc? But I tried that years ago.
I attempted this project back in '15 when the BD was released, before I had AVISynth. I simply ripped the selective clips, and burned a 1080-24p BD from my NLE and it looked terrible from what I remember (I tossed the disc soon after). I attributed it to some clips being interlaced and some progressive? -
What do you mean "interlace artifacts" ? If you mean combing, you shouldn't see that on BD
If it's being deinterlaced, you might see DEinteralcing artifacts - such as jaggy lines, stair stepping, aliasing. The quality depends on the equipment
If it's 100% progressive 23.976 content, telecined, (aka "23.976p in 29.97i") it should be handled correctly 99.9% of the time. The equipment will inverse telecine and you will get all progressive frames in full quality
Ideally I'd like all clips progressive.
Are you saying I can have a mix of 1080i and 1080p on the same disc? But I tried that years ago.
That's why some of the other film segments you mentioned were 29.97i. It's "23.976 in 29.97i" or telecine
I attempted this project back in '15 when the BD was released, before I had AVISynth. I simply ripped the selective clips, and burned a 1080-24p BD from my NLE and it looked terrible from what I remember (I tossed the disc soon after). I attributed it to some clips being interlaced and some progressive?
But when you have mixed content, it has to be all contained within a 29.97i stream. Same rules for DVD or Broadcast TV -
The original BD I made had terrible combing on some clips, which I'm guessing were the clips at 29.97i being how I rendered the disc @24P for all with no conversion for 29.97 to 23.976.
The clips on the official BD were probably scanned and restored in '14, but depending on the market might depend on which frame rate they chose? I have a music dvd of another UK band with video-source material. The UK dvd release is PAL which is of course 25, and the same US dvd is 29.97. There isn't any conversion on the PAL disc as it's the same frame rate as the master.
I'm still confused on two different rates on the same disc. I don't plan on having different rates within the same title (same song) but didn't know I can represent 1080p within 1080i stream, if I understand you correctly? -
It has to be that way, because NTSC DVD does not support 25fps , just like NTSC BD does not support 25fps . All NTSC area releases will be 29.97i. BD is different than DVD and broadcast TV in that it supports native progressive 23.976pN and 24pN. But not 25pN, not even PAL area. PAL area BD's use 25p in 25i encoding or 2:2 pulldown. All PAL equipment can handle this without deinterlacing. The image is weaved and you get full quality
I'm still confused on two different rates on the same disc. I don't plan on having different rates within the same title (same song) but didn't know I can represent 1080p within 1080i stream, if I understand you correctly?
23.976p in 29.97i is 3:2 pulldown . It's the same thing done on DVD for film content , or for film content on broadcast TV (not streaming) .
https://en.wikipedia.org/wiki/Three-two_pull_down
25p content would typically use 3:2:3:2:2 pulldown for a 29.97i stream
The underlying content frame rate is represented in the pattern of field repeats
Ideally, a playback chain would remove pulldown and you'd get the original progressive frames. For 3:2 pulldown it should work correctly 99.99% of the time, because it's a common cadence. 3:2:3:2:2 is less common but still should work ok 99% of the time . Almost all PAL areas 25p music/concerts use this method for NTSC area releases.
Worse case on playback is deinterlacing occurs instead of pulldown removal. It's actually not that bad, unless you started with high quality source, or specific content like lines at certain angles . You're already deinterlacing as a precursor for deblending - if you had a full quality image the effective vertical resolution would reduced in half. You cannot see the degradation on your source because it's relatively low quality to begin with
Other potential problems are when you switch cadences - it might take a few frames for correct detection, you might get some glitched frames during those transitions. e.g. lets say you mixed 23.976p content and 25p content all in a 29.97i stream on the same title. It's all 29.97i, but the pulldown removal detection might get confused for a half second.
Native progressive encoding , such as 23.976pN almost never gets those problems. It has the least chance for playback errors. In the 720p59.94 case - because everything is progressive, instead of field repeats, you use frame repeats. So in the 23.976p in 59.94p case, you'd have triplicates and duplicates. 1080p59.94 is not supported by BD officially (although some players might play it) . -
Yes my NLE & BD authoring programs (Vegas Pro & DVD-Architect) don't recognize 1080 60p, and I want menus, so my options are 1080i 29.97, 1080p 23.976, or 720 60p. I think some players read 1080 60p MKV files but I don't think you can have menus.
I sort-of understand the factory disc having two different frame rates for different titles, and I'm guessing the player will recognize flags to play the film clips at 24p (and video at 29.97). My tv upscales everything. That's why I really don't want to have to use 720 60p, as it will be upscaled to 1080 60p. If I burn at 1080 24p, no upscaling.
Your description of possible playback errors is another reason why I thought I need everything at the same rate.
Is it better to have this project at 29.97? Keep the video-sourced clips at 29.97, and somehow convert the films clips to 29.97? -
It's because 1080p59.94 is not supported of the BD spec, so you cannot author a disc like that and no authoring tool will allow you
I sort-of understand the factory disc having two different frame rates for different titles, and I'm guessing the player will recognize flags to play the film clips at 24p (and video at 29.97).
My tv upscales everything. That's why I really don't want to have to use 720 60p, as it will be upscaled to 1080 60p. If I burn at 1080 24p, no upscaling.
Also, the quality of TV upscaling can be good or bad, or anywhere in between . Some of the AI chip upscalers can produce very good results. But just standard low quality upscaling on this clip from 1280x720 will look basically the same
Is it better to have this project at 29.97? Keep the video-sourced clips at 29.97, and somehow convert the films clips to 29.97?
But pros/cons to each method
You have 25p (well, deblended back to 25p), and 23.976p content (some of it telecined as 29.97) , correct ? Nothing else in terms of content ?
RIFE is significantly better than MVTools2 interpolation. If the artifacts are tolerable, I'd probably go 23.976p native progressive for everything , like you initially wanted. You don't know until you run some tests . I took a quick look and it was ok on that clip on a few frames, but that doesn't mean all clips will be ok. Beware that some situations cause massive artifacts for all interpolation engines - a common one is repeating patterns like picket fences. Ok maybe picket fences are not common in concerts, but even something like a mesh background, repeating tiles in the background, anything similar can elicit bad artifacts -
Correct. AFAIK the video-sourced stuff is originally 25i, now 29.97i and the films clips are 24.000 now 23.976, with some film clips now 29.97i. Not sure why some film clips are 29.97, esp when they have multiple versions of the same video clip; Version one 24p, Version two 30i etc. And they look identical, so not like they lost the negative but all they had was a 2-inch video transfer.
Still confused how to have different rates within the 29.97 stream.
If I convert the .m2ts to .AVI via AVISynth, then use that .AVI in Vegas to render to .AVC to burn, how is any program or player going to read any pulldown since I totally processed the original m2ts file? -
-
But are those film clips clean, just telecined ? or some other process
Not sure why some film clips are 29.97, esp when they have multiple versions of the same video clip; Version one 24p, Version two 30i etc. And they look identical, so not like they lost the negative but all they had was a 2-inch video transfer.
Still confused how to have different rates within the 29.97 stream.
In general, you use different patterns of field repeats. 29.97i means 59.94 fields/s . On playback, the fields are matched and the duplicates removed to make the original progressive frames. There are always duplicated fields in the telecined stream, because the content frame rate is less than the field rate of 59.94. Only interlaced content uses all the fields (during a scene with motion, all fields are different)
A simple example - if you had 6 FPS content (well, 5.994 fps), you'd have 10 repeat fields or 5 repeat frames in a row. 5.994 * 6 = 29.97
For your case, you take the either 23.976 stream, or recovered 25p stream, and you "interlace it" , or put it in fields with repeats. The ChangeFPS duplicates frames, the next line creates a 29.97i Top Field first stream . You encode it 1080i29.97 TFF
Code:. . ChangeFPS(60000,1001) AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
The equipment has cadence detection. Here is a random review. Look at chart where they list various cadences and pass/fail
https://www.audioholics.com/blu-ray-and-dvd-player-reviews/oppo-bdp-83-universal-blu-ray
Cadence 2:2 Video
Cadence 3:2:3:2:2 Vari-speed
.
.
3:2 is basically 100% pass on all playersLast edited by poisondeathray; 22nd Mar 2025 at 19:34.
-
-
Excellent rhetorical question.
I rendered the same section of the m2ts clip using your added code. The new AVI is 29.97 and Vegas does treat it as Progressive. Do I convert all clips using this script, and have them in a 1080i template in Vegas? Is this what a 23.976p file within a 29.97i stream is?
Thanks for the Oppo link. I didn't know some manufactures list how their player read cadences. My UHD player is Sony UBP-X1100ES.Last edited by clashradio; 23rd Mar 2025 at 05:58.
-
I would seriously check, because all sorts of bad things happen along the way
I rendered the same section of the m2ts clip using your added code. The new AVI is 29.97 and Vegas does treat it as Progressive. Do I convert all clips using this script, and have them in a 1080i template in Vegas?
In vegas, you would need to interpret the file as interlaced TFF, and export using the same settings
Is this what a 23.976p file within a 29.97i stream is?
The other 25fps srestore sections would be "25p in 29.97i" - you still need separate double rate deinterlace + srestore script for that
Thanks for the Oppo link. I didn't know some manufactures list how their player read cadences. My UHD player is Sony UBP-X1100ES. -
@clashradio: In case you want to try here a script example using RIFE for 23.976p temporal interpolation of your blended .m2ts
(Attachment is video only).
Code:LWLibavVideoSource("stream.m2ts") assumeTFF() QTGMC(preset="fast") srestore(frate=25.0) RGB=z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:limited=>rgb:709:709:full") #RGB float required by RIFE RIFE=RGB.RIFE(gpu_thread=1, model=25, fps_num=24000, fps_den=1001, sc=true, sc_threshold=0.3) #model=25, or your choice YV12=RIFE.z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:full=>709:709:709:limited") #back to YV12 for blu-ray return YV12
-
I would seriously check, because all sorts of bad things happen along the way
How did render a m2ts ? In vegas ? Did you frameserve in ? Or use some other program ?
In vegas, you would need to interpret the file as interlaced TFF, and export using the same settings
The other 25fps srestore sections would be "25p in 29.97i" - you still need separate double rate deinterlace + srestore script for that.
That would mean either 23.976p for all (with the 25p conversion to 23.976 retimed using RIFE); or 720p59.94 (with repeat frames, 2 different patterns for the 23.976p and 25p srestored sections) . If you had some higher quality source, I would hesitate to use 720p too, but this is far from a 1080 quality source
Unfortunately the uploaded m2ts file (for that particular clip) is all we have as far as quality. The source is from the BD and the rez is pillarboxed (1920x1080). The film clips look totally awesome. -
When you rendered an AVI, it wasn't flagged as TFF, so vegas interprets it as progressive. You would need to right click and adjust the properties to interpret it as interlaced TFF, and export it as interlaced TFF, not just the template for the project properties. That's 3 things you need to check: file interpretation, project properties, export settings
Many types of intermediate AVI files will not have field order flags, so interpreting as progressive is quite common
Yes you need 2 different scripts. eg. You wouldn't use srestore on a film clip already at 23.976, nor would you use it on film clips that were 23.976 but telecined to 29.97
For the 25fps field blended sample
Code:#source filter #some double rate deinterlacer Srestore(frate=25) #now you have 25p unique deblended frames # duplicate frames from 25p to 59.94p ChangeFPS(60000,1001) # rearrange to fields 29.97i, TFF AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
I've made a few 720 60p discs that not all players recognize. -
For RIFE, (or QTGMC , or any slow filters) - you can speed up processing by cropping the pillarbox borders, then back at the end
Note that sometimes srestore will mix up frames. It requires linear access. I would use it with caution with prefetch(some value). It's important to preview and encode linearly with srestore; if you jump around you can get the wrong results - it requires a few frames to lock into the pattern. Sometimes adding Preroll(some value) helps -
@Sharc: Thanks for the render. My version of Vegas (Pro 16) does recognize your clip. You mentioned it's not BD compliant; I'm guessing it's because it's mp4 and not MPEG2 or AVC. Although I get errors if I run your script "there is no function named z Convert Format"
Vegas has an option to "Adjust source media to better match project or render settings". But you don't mean right-click on the AVI file correct? All that allows for is which program to open up the file. Or Advanced tab has option "allow this file to have contents indexed in addition to file properties". I don't know how to flag the AVI as TFF, which I think is what you mean by "file interpretation"?Last edited by clashradio; 23rd Mar 2025 at 10:59.
-
It is mpeg4 AVC and resolution and framerate compliant, but blu-ray is more restrictive on other encoding parameters, especially on buffer management (VBV). In this example I didn't take care of full BD specs compliance. A BD disc authoring app would most likeley reencode the file just to make it truly BD specs compliant.
More info on blu-ray compliant encoding here:
https://forum.doom9.org/showthread.php?t=154533
http://web.archive.org/web/20211016213149/http:/www.x264bluray.com/home/1080i-p
I am not familiar with Vegas options in this respect.Last edited by Sharc; 23rd Mar 2025 at 11:10.
-
-
@Sharc: does the error I'm getting mean I don't have that plugin installed? "there is no function named z Convert Format" I assume I can't just replace that section of the script with ColorMatrix? I don't have to worry if your script is BD complaint, as I'm going to render that file to AVC with Vegas. But I'd prefer an AVI vs MP4.
Also I just noticed in your MP4 the first 19 frames are the same?
Once I right-click on the clip in the bin, I change the field order to UFF, keeping the Project Properties as progressive?Last edited by clashradio; 23rd Mar 2025 at 13:53.
-
It's from avsresize
http://avisynth.nl/index.php/Avsresize
You need to use RGBS (float) for RIFE, so you cannot use ColorMatrix only
Once I right-click on the clip in the bin, I change the field order to UFF, keeping the Project Properties as Progressive? -
I downloaded avsreszie but still get the same error.
When I drop the file in Vegas, it sees it as progressive. Is by changing the properties of the project and clip how you get a clip with a different frame rate to be in a desired stream?
Would it be easier, or better to try to figure out Sharc's script and render the video clips to 23.976? Then I could use the original m2ts files (the ones at 23.976) in the Vegas timeline as well without needing to convert those to an AVI file.Last edited by clashradio; 23rd Mar 2025 at 14:32.
Similar Threads
-
Complementing missing frames
By Bencuri in forum EditingReplies: 3Last Post: 23rd Oct 2024, 19:31 -
the best settings for DVD PAL Anime conversion. srestore, ivct, tdecimate?
By iamp in forum Newbie / General discussionsReplies: 1Last Post: 18th Aug 2024, 09:43 -
Can you use srestore to remove blends then rife to rebuild removed frames?
By LaserBones in forum Newbie / General discussionsReplies: 7Last Post: 2nd Jan 2024, 17:21 -
Upscaling after sRestore leads in huge artefacts & sRestore with Vapoursynt
By Platos in forum RestorationReplies: 18Last Post: 27th Apr 2023, 17:03 -
Can't re-render video without it outputting the wrong amount of frames
By Rathma in forum Newbie / General discussionsReplies: 6Last Post: 9th May 2021, 21:46