I am trying to optimize the speed of my re-encodes of HD MPEG2 captures. Really, I am doing very little to these videos. I cut the commercials with VideoRedo, and then process them back to 23.976fps and hardcode the captions.
I am trying to understand the speed differences between re-encoding 720p material and 1080i material.
720p clip avs:
fps = 15.8Code:MPEG2Source("video.d2v") SelectEven() TDecimate() Undot() TextSub("video.srt")
1080i clip avs (resizing to 1280x720):
fps = 6.6Code:MPEG2Source("video2.d2v") TFM() TDecimate() Undot() Lanczosresize(1280, 720) TextSub("video2.srt")
If I drop the TFM() [yes, I know...I don't want to do this just trying to track down fps delta]
fps = 9.9
These numbers are on my dual core laptop. On my quadcore, the difference is even greater (~50fps 720p to ~13 fps 1080i).
Is it the decoding speed of 1080i material compared with the smaller framesize of 720p? On my quadcore, the cpu utilization for the 720p re-encode is ~60-70% whereas the 1080i material is ~30-35%. It seems like it is decode limited, but I am not sure. Could I maybe benefit from using MTsource? I tried using FFMPEGSource2 (-mt version) instead of MPEG2Source, but I didn't note any speed differences.
+ Reply to Thread
Results 1 to 28 of 28
-
-
There are a couple of major reasons for the differences in encode speed. The 1080i one contains over twice the pixel count of the 720p one. Any filtering will take over twice as long. And field matching (TFM) is a lot more CPU intensive than is a SelectEven(). You can speed up the 1080i filtering in a couple of ways. One is to remove the post-processor if possible (go over it carefully before encoding as it's not always a good idea), the other is to resize in the horizontal direction before the IVTC:
MPEG2Source("video2.d2v")
LanczosResize(1280,Height)
TFM(PP=0)
TDecimate()
LanczosResize(Width,720)
Undot()
TextSub("video2.srt") -
Recommends: Kiva.org - Loans that change lives.
http://www.kiva.org/about -
Thanks, manono. That is pretty much what I was expecting. Is there any drawback to resize width in one step and then height in another?
Are you saying that you process the videos back to 23.976fps without re-encoding? How is this done? Do closed captions stay in sync if you do this? -
Last edited by edDV; 4th Mar 2010 at 12:34.
Recommends: Kiva.org - Loans that change lives.
http://www.kiva.org/about -
Dang. I need VideoRedo and Womble to team up.
Don't think I am going to drop another $100 on video editing software. Do you know how exactly Womble is able to strip the dup frames without re-encoding? I haven't seen any other software that does that.
-
No, I just use Womble to cut out commercials when I want frame accurate cuts. Womble doesn't inverse telecine. It just cuts or adds simple transitions. It's fine for MPeg2 (telecine) to MPeg2 (telecine) where the DVD player or HDTV do the inverse telecine.
If I don't need frame accuracy, I just use a TS/PS cutter like HDTVtoMPeg2 (I frame half second accuracy). The captions follow.
Come to think about it, when I inverse telecine in Virtualdub or AVIsynth, it is a recode if I go back to MPeg2. Might as well go for h.264.Recommends: Kiva.org - Loans that change lives.
http://www.kiva.org/about -
@ edDV- Yes, I would prefer encoding to x264, but I upload all my videos to my TivoHD. It doesn't play well with 23.976fps h.264 video for some reason (I had a thread earlier about shimmering subtitles). I have submitted a bug report with Tivo, so hopefully it is something they can fix.
@Abas-Avara- Yeah, I understand that most software players support softsubs. I am not watching these on a PC though. I already own VideoRedo (which I am very happy with for fixing timestamp issues and cutting commercials). I was asking about Womble because edDV initially thought it could IVTC without re-encode. -
Yep, direct 23.976 feeds are relatively new for players (e.g. Blu-Ray and 24p HDTV combos). Most players want interlace MPeg2 or AVCHD so they can inverse telecine or deinterlace themselves.
Further, broadcast telecined feeds are likely to have cadence breaks. There is no standard (technical or legal) that requires cadence be maintained.Recommends: Kiva.org - Loans that change lives.
http://www.kiva.org/about -
-
Thanks, manono. That is quite a bit faster than doing it afterwards. I also noted that you resized the height before Undot. I thought that it was normally better to apply filters before resize. If I were to do something like fft3dfilter or lsfmod or some other more complicated filter than Undot/RemoveGrain(1), is it better to resize after those or fine to resize first?
-
Yes, as a general rule you would apply filters before resizing, otherwise you might be resizing artifacts. But with undot, its so weak that the difference is probably negligible. Of course it's very situation and source specific, but applying filters to a SD video will be much faster than HD video... so you have to weigh pros/cons
Since you are re-encoding, another optin is to do your editing in avisynth as well. You could use audiodub() and specify audio in your script to keep sync. You might use avsp or even vdub to do cuts type editing
Where are your captions from? How are they staying in sync? -
Thanks, pdr. It was mostly a theoretical question anyhow. I tend to do more denoising/sharpening on SD sources. For HD, I basically do as I listed above and just run a higher bitrate.
As far as editting goes, I am really very happy with VideoRedo for commerical editing, et al. I normally use HCenc, which doesn't work with audio anyhow, so I don't really need to muck with audio in avisynth. My questions before were really raised because edDV thought Womble could IVTC without recoding....which would be pretty cool.
I missed your question about captions the first time. The captions are just those that come with the video feed. VideoRedo keeps them in sync when editting out commercials. -
Also, I have been meaning to ask. Is it ok to run TFM with MT or setmtmode? It seems like a bad idea, but I don't think I have noted a problem doing so.
-
I agree with pdr. I was just showing how you could speed up the encoding. Most filters will be faster when applied to the lower final resolution (but be very careful how you filter an interlaced source). And most filters will work most effectively at the original higher resolution. But the quality of an IVTC won't be effected by changing the width to speed it up. As for undot, I didn't even notice it when editing that script, and it probably won't make much difference as far as speed or quality, no matter where you have it in the script.
I hope you're adjusting the colorimetry somewhere along the line, either with:
BT709ToBT601()#using the BT709ToBT601 filter
or the analogous method using the ColorMatrix filter.
Is it ok to run TFM with MT or setmtmode? -
Thanks for mentioning the color change. I saw something about this in the thread about converting HD material to SD and I am confused when I need to use the Colormatrix filter. Do I use Colormatrix 709->601 whenever I am re-encoding HD material? Or only if I am down res'ing it? What about when I go from 1920x1080 to 1280x720 like I am doing here?
-
-
Ok, thought I had it until jagabo posted again. So, if I am going from HD to SD, then convert to 601. Unless I am writing to DVD, then I can do either?
-
-
Ok, thanks for the insight.
Why exactly do HD video use a different colorimetry than SD? -
Have you ever seen a retail DVD with the colorimetry set for BT.701? I don't think I have. They're all usually set for BT.601 equivalents (BT.470-2 or SMPTE 170M) or not defined at all, in which case they're decoded as BT.601. Although they're supposed to probably, I'm not at all sure all DVD players read the flag and follow it. That is, I'm not at all sure all of them can decode a DVD as BT.709 even if that was the colorimetry. I think you'd be well off not explicitely defining anything. The DGIndex Manual has this to say about it:
Colorimetry - Displays the colorimetry scheme used by the stream. Note that if the stream does not declare the colorimetry, then ITU-R BT.709* is reported for HD video, and ITU-R BT.470-2* is reported for SD video. The * character indicates that the stream did not declare the colorimetry.Last edited by manono; 5th Mar 2010 at 18:56.
-
Anonymous344Guest
Similar Threads
-
mpeg2 ts file convert to mkv or mpeg2 ts......change only video bitrate...
By jrblack in forum Video ConversionReplies: 4Last Post: 24th Jan 2011, 18:45 -
Edit MPEG2 video without encoding
By silverwolf0 in forum Newbie / General discussionsReplies: 7Last Post: 22nd Feb 2009, 13:05 -
AVI->MPEG2 (CCE Basic) encoding results in incorrect video length in pla
By binister in forum Video ConversionReplies: 8Last Post: 26th Feb 2008, 17:29 -
MPEG2 to DVD without re-encoding
By nagihcim1 in forum Newbie / General discussionsReplies: 5Last Post: 6th Sep 2007, 14:14 -
Regarding MPEG2 Encoding (DVD authoring)
By Wuhtzu in forum Video ConversionReplies: 9Last Post: 10th May 2007, 17:07