View Full Version : Deinterlace .264 transport stream to .AVI (no compression)
blahapa
26th October 2010, 21:13
Any suggestion for encoding HD video H.264 transport stream to uncompress AVI (1,244 Gbps) with DEINTERLACING?
I can do it in VirtualDub, but I can´t set any deinterlacing there. It will also help if I can do the same MPEG-2 file .m2v.
Thanks for any help in advance. Pavel
blahapa
26th October 2010, 22:04
DEINTERLACING?
Sorry guys, I´ve just found it in VirtualDub Filters... It´s fixed. :D
LoRd_MuldeR
26th October 2010, 22:34
As VirtualDub doesn't open H.264 TS streams directly, I assume you open the stream via Avisynth.
So you might want to try one of the various Avisynth Deinterlace Plugins/Scripts (such as YadifMod or TempGaussMC), which can give significant better results than VirtualDub's built-in deinterlace filter.
Moreover, if you have a NVidia card and are willig to spend 15 bucks, you could use DGDecNV/DGSource to read your source, which allows you to enable the PureVideo Hardware Deinterlacing.
Didée
27th October 2010, 00:09
But then, the PureVideo deinterlacing is ... lame. See here (http://forum.doom9.org/showthread.php?p=1433847#post1433847). Plain Yadif is also blazingly fast, and I don't see PureVideo via DGDecodeNV delivering better quality than Yadif.
Time will tell if GPU processing can fulfill the (big) claims. Right now it's mostly marketing hype. As soon as you dare to look closer, all you find is a big balloon of hot air.
nevcairiel
27th October 2010, 13:14
Would be interesting to do the same with a more powerful card then the 220/240. I would run it on my 460, but i don't have DGDecodeNV <.<
nurbs
27th October 2010, 14:07
I have a 460 and DGDecodeNV, but I don't think there would be a difference since the 220 and 240 as well as the 4xx cards all have the newest PureVideo version (VP4) which I think is what counts when doing the decoding and deinterlacing.
Still, if anyone is interested post a source and a script and I'll run it.
nm
27th October 2010, 14:36
I have a 460 and DGDecodeNV, but I don't think there would be a difference since the 220 and 240 as well as the 4xx cards all have the newest PureVideo version (VP4) which I think is what counts when doing the decoding and deinterlacing.
GPU speed matters for deinterlacing and other postprocessing that are done with the stream processors. However, GT 220 is fast enough for realtime 1920x1080/i30 deinterlacing (and simultaneous denoising) with the best methods implemented in the driver and they should be enabled automatically during 1080i playback.
On Linux with VDPAU, any deinterlacing method can be forced for any video resolution regardless of GPU speed. I can for example use the best "vector-adaptive" / "motion adaptive temporal deinterlacing with edge-guided spatial interpolation" with my laptop's 8400M GS; 1080i playback will only be slower than realtime. I haven't looked at how the CUDA API works, but I think it should allow similar setting of the methods to be useful.
Regarding the quality, I agree with Didée: Nvidia's best method is only about as good as yadif. It smears the fine details a bit less, but apparently shimmers more than yadif (according to Didées sample). Edge-directed interpolation is slightly better in test images.
LoRd_MuldeR
27th October 2010, 16:04
But then, the PureVideo deinterlacing is ... lame. See here (http://forum.doom9.org/showthread.php?p=1433847#post1433847). Plain Yadif is also blazingly fast, and I don't see PureVideo via DGDecodeNV delivering better quality than Yadif.
There are much better (quality-wise) deinterlacers than PureVideo HD's deinterlacer without any doubt.
But the fact that you get PureVideo HD deinterlacing for free (in the sense of processing time) and it still delivers quite decent results makes it an option to consider at least!
While Yadif certainly does a nice job for its speed, whether Yadif or PureVideo HD gives the preferable deinterlacing result is up for everybody's own choice ;)
blahapa
27th October 2010, 19:56
Guys (and maybe also girls here), its nice to here about this possibilities. I have ATI HD 5750 card so I cannot use this solution.
However I need the same deinterlacing method as is used in most common DVB set-top-boxes. (Do anyone know?)
It´s part of my diploma work.
No matter if I will do this via AVIsynth or VirualDub. Anyway I need to save it as uncompressed AVI. I don´t know how to do it via AVIsynth. Where I can find any library with filters for VirtualDub?
Blue_MiSfit
27th October 2010, 20:22
Set top boxes always do some kind of bob deinterlacing.
blahapa
27th October 2010, 20:55
Set top boxes always do some kind of bob deinterlacing.
Blue_MiSfit, nice to hear something from you. I have no time to try what you told me in my last problem. But this question is more or less still about the same.
I need to know which deinterlacing method is used in H.264 (as a lot of companies said "MPEG-4") set top boxes. They aren´t in use till now in my country but I think in United Kingdom has many people some.
You think it is BOB or BOB with adaptive deinterlaxing or BOB+wave compensation (I think this one is not used in H.264 set top boxes, STB would cost more) as is on this web site?
http://100fps.com/
I will use maybe Field BOB...
LoRd_MuldeR
27th October 2010, 21:18
I need to know which deinterlacing method is used in H.264 (as a lot of companies said "MPEG-4") set top boxes. They aren´t in use till now in my country but I think in United Kingdom has many people some.
This cannot be answered, because there is not the one deinterlacing method used by all set top boxes.
The H.264 Standard only covers how the H.264 decoder works. It does not cover how the video data is processed (e.g. deinterlaced) after the decoding has happened.
As Blue_MiSfit pointed out, modern set top boxes and television screens use "Bob" deinterlacers, which means from 50i input you'll get 50p output rather than 25p - nothing more, nothing less.
But that's probably the only thing in common. How the hardware deinterlacers work in detail is totally manufacturer-specific. And you can be sure that they won't tell you the algorithms they use.
In Avisynth there is a very simple bob deinterlacer, called "Bob()". But you can be sure that set top boxes use much more sophisticated deinterlacing methods to avoid the "bobbing" effect.
However I would assume that hardware deinterlacers like NVidia's PureVideo HD or the AMD equivalent don't work that much different from other companies hardware deinterlacers...
Blue_MiSfit
27th October 2010, 23:22
^^ Homerun. Couldn't say it better myself, so I won't bother :)
Derek
blahapa
28th October 2010, 15:49
OK, I see...
Now I am looking for some deinterlace filtr for VirtualDub that will not multiple datarate by 2 (HD 25p datarate is aprox. 155MB/s and I can play it with SSD disk but 310MB/s I can play only with SSD disk to PCIe slot - and I dont have 300 € to buy something like this:
http://www.ocztechnology.com/products/solid-state-drives/pci-express/revodrive/ocz-revodrive-pci-express-ssd-.html
)
I have found some deinterlace filters here:
http://software.techrepublic.com.com/thankyou.aspx?&tag=content;leftCol&docid=835393&view=835393&load=1&authId=FlNEoEQgq0CHx95TxKE6XfjEUJVk7CaONplV4l0149S7cDelmfbjiT2mBqfZxKZj
but nothing special. Video after this filtration is like from stroboskop.
Any web which will spare time to find the right filter?
AlekseiV
28th October 2010, 18:14
VirtualDub > Video > Filters > Add > Deinterlace
Use default options (it uses Yadif mode 0 order 1)
Didée
28th October 2010, 18:20
Now I am looking for some deinterlace filtr for VirtualDub that will not multiple datarate by 2
That's impossible. You have a given framesize, a given number of frames per second, and a given compression ratio (namely: no compression). Since everything is fixed, there is nothing left over to reduce. ;)
I don't know the exact "must"-s and "mustnot"-s that you are facing, so here are some options:
a) lossless compression of the output. For example, Huffyuv is a rather common compressor that will reduce the datarate into half, while keeping the result pixel-identical.
b) dont use the full framesize. 1920x1080 is quite big. Perhaps it is sufficient to show only a certain "region of interest" of the full frame.
c) reduce framerate. E.g. when you start with 30i and deinterlace to 60p, you could show the result in slow motion, by simply setting the destination fps to e.g. 30 fps (half speed) or to 15 fps (quarter speed). This has not only the advantage to cut the bitrate into half / to a quarter ... it has also the advantage that it's more easy to see how good or how bad the deinterlacing process really is.
(Have a look at the sample I had posted here (http://forum.doom9.org/showthread.php?p=1433847#post1433847) - that's zoom=200% / speed=25%, for the sole reason to make it easier to see what's really going on.)
nm
28th October 2010, 19:13
Now I am looking for some deinterlace filtr for VirtualDub that will not multiple datarate by 2
Then you can't bob and you won't get a similar result compared to set-top-boxes and deinterlacing television sets.
(HD 25p datarate is aprox. 155MB/s and I can play it with SSD disk but 310MB/s I can play only with SSD disk to PCIe slot
Do you really need lossless storage? If yes, why not compress losslessly with HuffYUV or Ut (http://forum.doom9.org/showthread.php?t=143624)? You'll save at least half of the bandwidth.
blahapa
28th October 2010, 19:27
That's impossible. You have a given framesize, a given number of frames per second, and a given compression ratio (namely: no compression). Since everything is fixed, there is nothing left over to reduce. ;)
NO, no, original file is MPEG-2 MP@HL 50 Mb/s .m2v and I need to deinterlace it and save it without compression because I need to play it together with videosequence H.264 transport stream (4 to 16Mb/s) and neutral gray without any break between the videos. Only possibility that I see is to join all the videos together in lossless AVI. If there is another way tell my. But I have tried a lot of players and no other than VLC succeded.
No framerate, resolution or other corections is possible. Core of my work is subjective test (ITU BT.500-11 if you know it).
It is possible to compress it lossless codec. Thank you Didée for this idea! It looks that this is solution for me... BUT VLC and my processor can´t keep up but I will try it on Quad core in my school tomorrow. Thanks
blahapa
28th October 2010, 20:46
Do you really need lossless storage?
As is above. I dont need lossless storage but I need lossless playing. That means lossless interpretation of videos. HuffYUV seems to bee good idea but it cost little bit processing time and Dual Core unfortunately can´t keep up evidently...
UT as is written here
http://forum.doom9.org/showthread.php?t=143624
seems to be much better in playing (VLC cant do it) but I have to find any player that will play it fluently. Mplayer can´t do it...
Any fast suggestion?
LoRd_MuldeR
28th October 2010, 21:12
NO, no, original file is MPEG-2 MP@HL 50 Mb/s .m2v and I need to deinterlace it and save it without compression because I need to play it together with videosequence H.264 transport stream (4 to 16Mb/s) and neutral gray without any break between the videos. Only possibility that I see is to join all the videos together in lossless AVI. If there is another way tell my. But I have tried a lot of players and no other than VLC succeded.
(1) I don't see why you can't use compression. If you don't want any quality degradation after the deinterlacing, you can still use a lossless compression. Compression doesn't have to be lossy!
(2) When you say you need to play those videos "together" and "without any break between the videos" what do you mean? You need to play them in parallel/side-by-side? Or time interleaved? :confused:
In both cases you could use Avisynth to join the processed (e.g. deinterlaced) videos together, either with Interleave() or StackHorizontal/Vertical(), and save the result in one video file.
blahapa
28th October 2010, 21:23
That means that when one video ends than must first frame of second video appear... thats the problem of playing videos with another compression in VLC because VLC will show desktop or everything whats behind the VLC window and after 1 or 2 second will appear second video.
Do you know where to play UT Video Codec or HuffYUV videos without any problem? Thats maybe the last what I need know...
In AviSynth I can´t join 2 videos with another compression. Show me this if I am wrong but I can´t do it here. "Splice: Video formats dont match" will appear...
poisondeathray
28th October 2010, 21:48
...Do you know where to play UT Video Codec...
Try Media Player Classic . Enter the # cores for frame divide count in the video configuration for UT video codec. So a quad core = 4 . Also, use Predict Left (optimize for decoding speed)
In AviSynth I can´t join 2 videos with another compression. Show me this if I am wrong but I can´t do it here. "Splice: Video formats dont match" will appear...
They have to be same format, same fps, dimensions, audio, sample rate etc...
Use mediainfo & copy & paste the text view of both videos here
LoRd_MuldeR
28th October 2010, 21:56
In AviSynth I can´t join 2 videos with another compression. Show me this if I am wrong but I can´t do it here. "Splice: Video formats dont match" will appear...
Avisynth doesn't handle video in compressed form at all! After the video has been loaded into Avisynth with the appropriate source filter, all you have is "raw" (uncompressed) video data. All Avisynth filters and functions operate on that "raw" video data. And that's also how Avisynth will deliver the final video to the host application, such as VirtualDub. The host application will usually compress the video again.
If Avisynth refuses to splice two clips using the "++" operator or the "AlignedSplice()" function, then that's either because the clips have different dimensions or because they have a different color format or both. Use Spline36Resize() and/or ConvertToYV12() on the clips before the splice operation to fix that. The Info() function might also be helpful to check the attributes of the clips you'd like to join.
blahapa
28th October 2010, 22:07
Try Media Player Classic . Enter the # cores for frame divide count in the video configuration for UT video codec. So a quad core = 4 . Also, use Predict Left (optimize for decoding speed)
I did all this man, I am still working on dual core computer and the result was quite fluently but still not normal. And processor wasnt working on 100 procent, it was 86 maximum. But anyway I will try it tomorrow on quadro core. I hope it will be better...
blahapa
28th October 2010, 22:23
ConvertToYV12
WELL DONE, MAN! That was the problem. Now I need to play fluently UT or Huffman video and I am lucky man! :);)
LoRd_MuldeR
28th October 2010, 22:37
WELL DONE, MAN! That was the problem. Now I need to play fluently UT or Huffman video and I am lucky man! :);)
Well, VLC Player or MPlayer should play HuffYUV AVI files just fine. MPC-HC with ffdshow installed will do to. Maybe you'd like to give the MadVR renderer a try when using MPC-HC.
However a lossless compression like HuffYUV will result in a very high data rate. Not as high as uncompressed data, but still very high.
So actually your HDD might be the bottleneck that prevents fluid playback. Again: Why does the final encode that you are going to play has to be lossless? Why not encode to H.264 or MPEG-ASP ???
If you pick a bitrate that is high enough, H.264 or MPEG-4 ASP will look indistinguishable from a lossless encode for the viewer. Still that bitrate will be MUCH lower than HuffYUV or similar.
(I would suggest to you to encode your Avisynth script with x264 using CRF-Mode at CRF=18 or even CRF=16 and then visually compare the result to a lossless HuffYUV encode)
blahapa
28th October 2010, 23:01
So actually your HDD might be the bottleneck that prevents fluid playback.
Fuuhh... it´s really quite a lot of work to explain all the diploma thesis. ITU-R BT.500-11 http://www.dii.unisi.it/~menegaz/DoctoralSchool2004/papers/ITU-R_BT.500-11.pdf
Subjective test of videos - I cannot recode it or losy compress because I need one reference videoclip and one clip from hardware H.264 coder (.ts H.264 stream)...
HuffYUV has 60 MB/s but I am not playing this 10s video from my HDD but from RAMdisk. You see? Here could not start the problems with playing. Even if I am using UT YUV420 with data rate aprox. 30 MB/s I still cannot play it fluently...
Thats players problem... As I see thats also weakness of this UT and HuffYUV codec (if someone want to use it on HD resolution). If it won´t be better on quad core tomorrow I will be pressed to use normal deinterlacing a not to use Huff or UT coding... : (
nm
28th October 2010, 23:05
In both cases you could use Avisynth to join the processed (e.g. deinterlaced) videos together, either with Interleave() or StackHorizontal/Vertical(), and save the result in one video file.
Or if he only needs to play the files, AviSynth output doesn't even need to be saved -- it can be played directly. I just tried this myself and didn't have any problems with splicing two 1080p streams one after another during playback.
So, why not simply use AviSynth for the whole deal and forget about raw/lossless temporary files?
blahapa
28th October 2010, 23:13
use AviSynth for the whole deal
nm, tell me how to play it directly on fullscreen and it will be best present for (even if I have birthday on spring) :) But I need .m2v file to deinterlace (bob) before or during playing...
edit: And what did you ment with yours: "And if it's not fast enough with H.264, link it against ffmpeg-mt" in another thread?
I found something about it:
http://ubuntuforums.org/showthread.php?t=1049449
But I thing that my mplayer uses both cores... Anyway it is too slow...
LoRd_MuldeR
28th October 2010, 23:20
Fuuhh... it´s really quite a lot of work to explain all the diploma thesis. ITU-R BT.500-11 http://www.dii.unisi.it/~menegaz/DoctoralSchool2004/papers/ITU-R_BT.500-11.pdf
Subjective test of videos - I cannot recode it or losy compress because I need one reference videoclip and one clip from hardware H.264 coder (.ts H.264 stream)...
Again: If you encode the "reference" with x264 using CRF=16 and visually compare it to the lossless original, you probably won't be able to spot the difference!
Moreover H.264 does have a "true" lossless mode as well ;)
HuffYUV has 60 MB/s but I am not playing this 10s video from my HDD but from RAMdisk. You see? Here could not start the problems with playing. Even if I am using UT YUV420 with data rate aprox. 30 MB/s I still cannot play it fluently...
Thats players problem... As I see thats also weakness of this UT and HuffYUV codec (if someone want to use it on HD resolution). If it won´t be better on quad core tomorrow I will be pressed to use normal deinterlacing a not to use Huff or UT coding... : (
HuffYUV already is stunning fast. Will be hard to find a lossless Codec that's even faster.
Or if he only needs to play the files, AviSynth output doesn't even need to be saved -- it can be played directly.
...given his filter chain is fast enough for real-time processing. Depending on the deinerlacing filter in use, this can easily be not the case.
Didée
28th October 2010, 23:39
nm, tell me how to play it directly on fullscreen
I usually do this by opening the *.avs script in a media player, then switch the media player to fullscreen.
But I need .m2v file to deinterlace (bob) before or during playing...
Why you need m2v? In regards to deinterlacing or playing back, there's no technical need for the source to be m2v. You can bob/deinterlace AVI just as well, or *mp4, or *mkv, or *wmv, or whatever.
All in all, we're close to the 3rd page in this thread, and it's still not clear what exactly you want to accomplish. Something is to be subjectively compared, and bob deinterlacing will be involved. Apart from that, everything is clear as mud.
Seriously - you are working on your diploma thesis?
blahapa
28th October 2010, 23:45
won't be able to spot the difference!
Ok, I know what you wanna tell me. Anyway... You maybe know it that there will be no difference after coding to H.264, maybe I will see the same... but maybe on 45" TV the observers can see the difference. An also my teacher will not allow me to recompress 50Mbps .m2v reference... Lossless H.264 model - it could be but where and how do it? How to join the files together and how to play it?
HuffYUV already is stunning fast.
UT is faster... but anyway too slow.
Depending on the deinerlacing filter in use, this can easily be not the case.¨
So I can´t play it directly...
Tomorrow I will know more... I am going to sleep and will tell you tomorrow how it works on quad core.
LoRd_MuldeR
28th October 2010, 23:51
Ok, I know what you wanna tell me. Anyway... You maybe know it that there will be no difference after coding to H.264, maybe I will see the same... but maybe on 45" TV the observers can see the difference.
I doubt that, really ;)
So I suggest you give it a try! And if you really can see a difference with CRF=16, successively lower the CRF even further until you can't spot the difference anymore.
Lossless H.264 model - it could be but where and how do it? How to join the files together and how to play it?
x264.exe --qp 0 --output lossless.mkv input.avs
The result can be decoded with any H.264 decoder that supports the "Predictive Lossless Coding" feature of the "High 4:4:4" profile.
As this applies to libavcodec's H.264 decoder for quite some time now, an up-to-date MPlayer or VLC Player will do the job...
nm
29th October 2010, 00:03
nm, tell me how to play it directly on fullscreen and it will be best present for (even if I have birthday on spring) :) But I need .m2v file to deinterlace (bob) before or during playing...
As Didée said, make your player open it on full screen. Speed is mostly determined by the H.264 decoder and the bobber you're using. Bob() should be fast enough during MPEG-2 decoding and its deinterlacing quality will be comparable to that of cheap hardware solutions. For a bit better deinterlacing, you could try yadif, but then you'll probably need to split filtering to multiple threads with AviSynth MT.
edit: And what did you ment with yours: "And if it's not fast enough with H.264, link it against ffmpeg-mt" in another thread?
I found something about it:
http://ubuntuforums.org/showthread.php?t=1049449
Yep. Ffmpeg-mt contains a version of libavcodec with frame-based multithreading. It's usually faster than the normal libavcodec on multicore CPUs. There are probably "mplayer-mt" Windows builds available, but I haven't looked around. FFdshow-tryouts also allows you to use this decoder.
Depending on the CPU speed, you may need to use ffmpeg-mt or some other fast decoder (Divx7, CoreAVC, DiAVC) for realtime playback of your .264 segment. They can be accessed through AviSynth's DirectShowSource2 (DSS2).
But I thing that my mplayer uses both cores... Anyway it is too slow...
Hmm. Were you playing H.264 video or what? I thought you were using it for playing the lossless huffyuv and Ut files, and I don't think MPlayer/libavcodec has a multithreaded HuffYUV decoder. Ut is a different deal since it's an external VFW (and optionally DirectShow) codec, so it should work about as fast in any VFW-compatible player.
blahapa
29th October 2010, 00:05
I usually do this by opening the *.avs script in a media player, then switch the media player to fullscreen.
Works but so slow with mpeg2 .m2v video.
M2V video is format of video part of file that you obtain when you will unwrap .MXF file that is saved from profesional player (for example Omneon
http://www.omneon.com )
I am sorry that I cannot tell everything about diploma WORK (sorry for this mistake - as our former prime minister said: "My english is not perfect") but its too much to tell and there is no place and time to do but I will try in short way...(as I was trying also before but without any success)
Next file is .ts (H.264 transport stream - I will have it from 4 Mbps till 16 Mbps - depending on how I will set H.264 hardware coder). You can become this file from streamer, which saves stream on output of hardware coder (on the input is for example Omneon).
This two video sekvences I need to play in sequence (last frame of 1st video and than fisrt of 2nd video). Also I need to put between it AVI video (I made it in Adobe Permiere) with neutral grey and caption "Sequence number 1A" ... 1B.. 2A and so on.
I need to deinterlace M2V and .TS file the same way as H.264 set top boxes do (hopefully it is BOB).
More clear? Any suggestion for that? Another way than I am going? Because I am missing after long way only normal playing of videos that were lossless compressed by HuffYUV or UT.
Thanks a lot.
nm
29th October 2010, 00:12
Works but so slow with mpeg2 .m2v video.
Which source plugin are you using for the M2V? Try something else too, since this should be the easiest part of the process.
More clear? Any suggestion for that? Another way than I am going? Because I am missing after long way only normal playing of videos that were lossless compressed by HuffYUV or UT.
Yep, both should play on a quad box.
blahapa
29th October 2010, 14:36
Which source plugin are you using for the M2V?
When I am importing it to VirtualDub via AviSynth its DGDecode. Otherwise I am opening it directly in VirtualDub.
AviSynthScript:
LoadPlugin(...path\DGDecode)
mpeg2source( path\videoclip.d2v)
Bob
D2V is made in DGIndex.
But I dont think that this is relevant for speed of decompression.
Yep, both should play on a quad box.
Quad BOX: result is the same even when I was coding it for 4 core... Video is not playing fluently. Processor works on 46 procent.
Maybe I need another UT or HUFF decoder. Till now I am using UTvideo-8.4.0-x86 and Huffman from ffdshow_rev3562_20100907
Any new version of theese codecs? Another player than Media Player classic? It is really strange... Thanks
nm
29th October 2010, 14:45
When I am importing it to VirtualDub via AviSynth its DGDecode. Otherwise I am opening it directly in VirtualDub.
AviSynthScript:
LoadPlugin(...path\DGDecode)
mpeg2source( path\videoclip.d2v)
Bob
D2V is made in DGIndex.
But I dont think that this is relevant for speed of decompression.
It may be relevant when we're talking about direct playback of the AviSynth script. Try FFMS2 instead, as Didée shows here: http://forum.doom9.org/showpost.php?p=1454089&postcount=15
Quad BOX: result is the same even when I was coding it for 4 core... Video is not playing fluently. Processor works on 46 procent.
So you tried changing the "Frame divide count" option in Ut? Did you also check "Optimize for decoding speed (Predict left)"? Maybe even more threads might help? Maybe there's an I/O bottleneck?
For HuffYUV, make sure you're using a multithreaded implementation. FFdshow isn't, AFAIK.
Blue_MiSfit
30th October 2010, 05:11
blahapa,
Listen.
You don't need lossless video. I understand you want the playback to look just like the original videos, but that doesn't mean you need to be mathematically lossless.
What you want is PERCEPTIBLY lossless video. Enter x264.
Encode your video at CRF15, and try spotting a difference between the source and the encode, then come back and tell me you need lossless ;)
I guarantee that a CRF15 encode will play back perfectly in Media Player Classic HC ;)
If you're on a Mac, ProRes is the codec of choice for this kind of work. DNxHD when you have Avid software installed on Windows or Mac, and CineForm if you're a Premiere user. Cineform is probably the best overall solution for this kind of thing.
Still, x264 should be more than adequate.
Derek
blahapa
30th October 2010, 22:58
I guarantee that a CRF15 encode will play back perfectly in Media Player Classic HC
I did it and.... the result is still the same, maybe worse. But media player was using exactly 50 proc. of my processor - it seems like it is using only one core. Is it possible to compress it with x264 with multithread or multicore support?
you can see screen, how it was here:
http://leteckaposta.cz/849797986
x264 --crf15 -o output.mkv AVSfile.avs
And I cannot use Media player Classic Home Cinema but the normal one. HC cannot read output file...
poisondeathray
30th October 2010, 23:06
Are you using ffdshow for the decoder for MPC? (I see the task tray icon in your screenshot)
Set h.264/avc decoding to ffmpeg-mt for multithreading decoding in the ffdshow configuration
For encoding, the source filter is not multithreaded if you used DGIndex and dgdecode.dll and may be a bottleneck
Didée
30th October 2010, 23:58
Yes, decoding via ffmpeg-mt within ffdshow surely is a good idea.
To further reduce decoding complexity, include --no-cabac into the commandline for encoding. CABAC needs quite some processing power, both for encoding and decoding. The higher the bitrate, the more CPU time is needed for CABAC. And you have a pretty high bitrate.
Blue_MiSfit
31st October 2010, 04:09
And I cannot use Media player Classic Home Cinema but the normal one. HC cannot read output file...
This makes no sense whatsoever.
MPC-HC is just a newer version of MPC, with many many many MANY improvements, and supports much more "out of the box".
If you're not getting realtime decoding, and are seeing exactly 50% CPU usage, then you're using vanilla libavcodec for decoding. This happens with old versions of ffdshow or MPC. You need to be using ffmpeg-mt, as configured by default in newer builds.
1) Remove MPC, haali splitter and ffdshow
2) Get latest MPC-HC and ffdshow-tryouts from xvidvideo.ru, get latest haali splitter from http://haali.su/mkv/
3) Install with defaults
4) Configure MPC-HC to use haali renderer if your GPU is very slow. The current default (VMR9 on XP and EVR-CP on Vista / 7) can be tough on older / integrated GPUs and slow playback unnecessarily. Haali isn't perfect, but is usually VERY fast.
The advantage of H.264 is that it's MUCH easier to play back in real-time than (for example) the lossless codecs you've described here, mainly due to the fact that everyone is interested in playing back HD H.264 :)
After following these steps, if you're still seeing poor decode performance, you can try re-encoding with --no-cabac, as suggested by Didee. This will make the stream MUCH easier to decode on slower CPUs. Still, a modest dual core (or any quad) should handle up to 1080p30 of at least ~30mbps (rough estimation) without skipping a beat, even with CABAC.
On the encoding side, x264 is multithreaded by default. You're using a recent build from x264.nl, right? You can use a faster preset if the default is too slow for you.
Derek
nm
31st October 2010, 11:19
The advantage of H.264 is that it's MUCH easier to play back in real-time than (for example) the lossless codecs you've described here, mainly due to the fact that everyone is interested in playing back HD H.264 :)
Lossy H.264 is easier to decode because the bitrates are much lower than with lossless codecs. Lossless H.264 is harder than multithreaded HuffYUV and Ut.
After following these steps, if you're still seeing poor decode performance, you can try re-encoding with --no-cabac, as suggested by Didee. This will make the stream MUCH easier to decode on slower CPUs. Still, a modest dual core (or any quad) should handle up to 1080p30 of at least ~30mbps (rough estimation) without skipping a beat, even with CABAC.
Blahapa is trying to play 1080p50 (or maybe 60p?), so he'll need to either drop CABAC or use a quad core. Hardware decoding on Nvidia/Ati (only Radeon HD >4xxx) GPUs through DXVA/CUDA is also possible.
Blue_MiSfit
1st November 2010, 02:22
Yeah, double rate progressive at CRF15 will probably require a quad to play smoothly, with CABAC and deblock. You can disable both and you should be fine.
Derek
blahapa
3rd November 2010, 09:01
Set h.264/avc decoding to ffmpeg-mt for multithreading decoding in the ffdshow configuration
Thank you, poisondeathray, for this suggestion, that really helped. And thanx also Didée, --no-cabac also helped.
I also realize that if I use compression HuffYUV (but from ffdshow, not the other one) from Virtualdub directly, VLC is playing video finally fine with quad core. So I need only 64 GB SSD disk to play the videos (cca 75 MB/s) :)
Oh, I think that I forgott send my last answer, Derek, I wrote it but wanted to write last modification and didnt send:)
I will try to reinstall codecs and MPC as you wrote if it will be needed. Till now it seems I will you another solution (above).
Of course I know that most people will use H.264. Thats also subject of my thesis and I went throught a lot of theory about H.264 coding and decoding...
The only problem know is to use Bob for h.264 transport stream. If I am importing it into Virtualdub directly and then I am using built in deinterlacing than is everything fine but if I wanted to use AviSynth:
a=DirectShowSource("E:\aa\a.ts")
Bob(a)
And then save as AVI (no matter which compression) it seems like some frames go forward and some backward the movement in the picture. So I have tried to alternate field order in gunnar Thalin smooth deinterlace filter the result was different but still was it 2 frames forward and two back...
Any idea? I can just import the file directly:
a=DirectShowSource("E:\aa\a.ts")
return a
and than use Rafal Fraczek Yad deinterlace filter I have tried to control it point by point and the results are quite good - Rafal is using some prediction in picture but I dont know if the result video wont be total different from HD set-top-box with Bob+something(blur, sharpen - who knows) deinterlace because it is yadiff and frame rate will stay at 25fps. Maybe I can use built-in Bob doubler deinterlace filter - it semm it is only bobing nothing else...
Rafal Fraczek Yad deinterlace filter - download:
http://download.chip.eu/pl/download_getfile_pl_3561980.html?s=http://dl01.chip.eu&f=/155626/vd10.zip&t=4cd11613&sign=c26603c41f3313f950aa06cdc11d5bc1&dl_type=dl_hs&lang=pl#
http://download.chip.eu/pl/VdYad-1.0_3561964.html
Here are some informations in english:
http://software.techrepublic.com.com/abstract.aspx?kw=deinterlace&docid=835393&tag=tr-left
Didée
3rd November 2010, 09:53
Pardon if I sound penetrant, but I still don't see clearly what you are (will be) compairing to what.
The "reference" seems to be "deinterlacing like set-top boxes are doing". Now,
a) different boxes supposedly will implement different techniques
and from what I gathered,
b) you don't even have the output stream of a settop box, but are going to somehow similate it?
When the theoretical anchor is vague/nebulous, and that anchor isn't even available but is to be simulated, then I wouldn't have much faith in the comparison. You simply cannot compare software bob/deinterlacing to hardware deinterlacing when you don't have a stream produced by that hardware. The difference between what a box is doing and your simulation, that difference might as big (perhaps even bigger) than the difference between two different and unrelated software filters!
I just want to prevent that you end up doing a comparison that's totally pointless. But for that, it must be clear what you're going to compare with what.
blahapa
3rd November 2010, 10:05
Yee, the reference is from Omneon player 50 Mbps MPEG2 and video to compare is .ts from H.264 coder (cca 6-14 Mbps).
Exactly, I cant compare output from h.264 set top box because I and my school dont have any, so I have to guess using information from internet. Or if anyone have some video sample. how is the picture from h.264 coder it will also help. But more important is the way of deinterlacing in that set top boxes...
Didée
3rd November 2010, 10:22
In any case, I would not assume that the simple bob() of Avisynth is comparable to hardware boxes. Bob() is a very generic filter - in other words, it's about the most simple / most dumb method that only exists.
I'd guess that using tdeint, like source.tdeint(mode=1) would be more close to the deinterlacing of settop boxes. At least it has detection of static areas (station logos usually don't flicker like hell when shown by a settop box, or do they?), and the 3D-kernel helps on slight (subpixel) motion.
When you want to include a high anchor from the "offline processing" (i.e. slower than realtime) side, then there is TempGaussMC, respectively QTGMC.
For loading the source into Avisynth, watch out for FMMS2 (ffmpegsource2). With DirectShowSource, you simply don't know what is going on behind the lines. One knob turned wrong, and the source already gets pre-processed before you get your filtering fingers on it.
But once more - you might have a fine source there, but it doesn't help for your basic goal. All you can do is compairing different software deinterlacers against each other. You can not compare against "hardware processing" when you simply don't have it! Any assumption about how HW processing probably is working might be completely off and wrong. You just can't know, simple as that.
blahapa
4th November 2010, 21:53
When you want to include a high anchor from the "offline processing" (i.e. slower than realtime) side, then there is TempGaussMC, respectively QTGMC.
For loading the source into Avisynth, watch out for FMMS2 (ffmpegsource2).
OK, no matter if it will be exactly like on STBoxes. I will use Bob. Its enough for me because this is not main goal of the work.
I have tried ffmpegsource2 but when I wanted to import m2v file I will get en error FFIndex: failed to open file.m2v for writing.
When I wanted to open .ts file: Can´t open file...
Whats wrong again? It really starts driving me mad. If anyone knows how to import this .ts file into the VirtualDub or x264 via AviSynth and in the result will be no backward steps when I am playing it frame by frame, please tell me...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.