View Full Version : Deinterlace .264 transport stream to .AVI (no compression)
poisondeathray
4th November 2010, 22:09
DSS2("video.ts")
Get .avss.dll from haali media splitter package, put in avisynth plugins directory. Make sure you have haali media splitter installed with ffdshow (set to ffmpeg-mt)
If you want audio, use audiodub
vid=DSS2("video.ts")
aud=directshowsource("video.ts")
audiodub(aud,vid)
nm
4th November 2010, 22:13
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...
http://ffmpegsource.googlecode.com/svn/trunk/doc/ffms2-avisynth.html
Limitations
* Requires Haali's Media Splitter if ogm or mpeg ps/ts is to be opened.
* Haali's splitter requires transport streams to be cut at packet boundaries. Use TsRemux to fix the stream before trying to open it.
* Because of LAVF's demuxer most raw streams will fail to work properly such as elementary h264 and other mpeg video streams.
So, mux the .m2v to a container (MKV should work) and install Haali's Media Splitter for TS support.
Also note:
Known issues
* There will appear decoding artifacts on h264 in transport streams.
So you should use DSS2 or remux the streams for that case.
Didée
4th November 2010, 22:15
1) ffmpegsource2 will create an index file in the same folder where the source file resides. Do you have writing access to that folder?
2) Did you respect the following premises:
FFmpegSource2 User Manual
.
.
Limitations
* Requires Haali's Media Splitter (http://haali.cs.msu.ru/mkv/) if ogm or mpeg ps/ts is to be opened.
* Haali's splitter requires transport streams to be cut at packet boundaries. Use TsRemux (http://forum.doom9.org/showthread.php?t=125447) to fix the stream before trying to open it.
Edit: Late I was ;)
blahapa
4th November 2010, 22:57
DSS2("video.ts")
Get .avss.dll from haali media splitter package, put in avisynth plugins directory. Make sure you have haali media splitter installed with ffdshow (set to ffmpeg-mt)
Result: Cant open file: video.ts 80070003
poisondeathray
4th November 2010, 23:11
did you rename the video to "video.ts" ? or does it have another name ?
can you play the .ts video in mpc directly ?
what happens when you render the file in graph edit or graphstudio ? do the pins connect ?
try re-wrapping in tsmuxer to .m2ts (sometimes there is problem with container) , then try again
sneaker_ger
4th November 2010, 23:44
If the suggestions of the other posters fail you could also try DGMPGDec (http://hank315.nl/files/DGdecode/dgmpgdec158.zip) for the m2v and DGAVCDec (http://www.videohelp.com/download/dgavcdec109.zip) for the h264 ts.
poisondeathray
4th November 2010, 23:48
...DGAVCDec (http://www.videohelp.com/download/dgavcdec109.zip) for the h264 ts.
Not a good idea, since his AVC transport stream is interlaced
blahapa
4th November 2010, 23:49
[url]* Requires Haali's Media Splitter if ogm or mpeg ps/ts is to be opened.
* Haali's splitter requires transport streams to be cut at packet boundaries. Use TsRemux to fix the stream before trying to open it.
I have Haali's Media Splitter, I also tryed to fix .ts stream... use output formats m2ts or ts but the result is still the same...
No, my video has another name aa.ts and I really dont try to open it with the template code but with my code.
Here is the aa.ts file in ZIP (10MB):
http://leteckaposta.cz/730871560
Yes, I can play .ts directly in MPC I can also open it in VirtualDub directly. I can also import it throught AviSynth using .dga file (but the results are very bad - a lot of artefacts) and I can also import it using DirectShowSource but there are still some backward moves after import:(
Graph edit? I dont need to render this file but I can try it if it helps...
poisondeathray
4th November 2010, 23:53
I can also import it throught AviSynth using .dga file (but the results are very bad - a lot of artefacts)
This is known issue with AVC PAFF streams (type of interlacing) , and why you shouldn't use it for this
I can also import it using DirectShowSource but there are still some backward moves after import:(
This is why DSS2() was suggested. Frame accurate in a container
Graph edit? I dont need to render this file but I can try it if it helps...
Graph edit was just to diagnose your directshow filters , since you are using directshow source and directshowsource2 (DSS2) , but since directshowsource works, it shouldn't be necessary to do this
Theoretically, if DirectShowSource() works, then DSS2() should also work but you shouldn't get misplaced frames with DSS2()
sneaker_ger
5th November 2010, 00:05
Not a good idea, since his AVC transport stream is interlaced
This is known issue with AVC PAFF streams (type of interlacing) , and why you shouldn't use it for this
Didn't know that it does not work correctly with PAFF. Just had a small MBAFF stream which seemed to work fine.
Graph edit was just to diagnose your directshow filters , since you are using directshow source and directshowsource2 (DSS2) , but since directshowsource works, it shouldn't be necessary to do this
DirectShowSource can also open graph files. Create a video only graph, delete the renderer, save and open the graph file with DirectShowSource. Also use parameter "audio=false" - or "video=false" if you're creating an audio graph.
poisondeathray
5th November 2010, 00:20
Here is the aa.ts file in ZIP (10MB):
http://leteckaposta.cz/730871560
I can't download from this host. I'm getting 3-4KB/s and it times out everytime. I'm in Canada, so maybe it's a location issue
poisondeathray
5th November 2010, 00:24
DirectShowSource can also open graph files. Create a video only graph, delete the renderer, save and open the graph file with DirectShowSource. Also use parameter "audio=false" - or "video=false" if you're creating an audio graph.
Yes I know, but the point was to see if his pins connected automatically to see if there is a problem with directshowsource or filters, not to manually set up a graph. DSS2 will connect to the same filter with highest merit as directshowsource
Earlier he said he couldn't open a file at all:
When I wanted to open .ts file: Can´t open file...
But later, he said directshowsource works, so obviously it's not a directshow filter issue
sneaker_ger
5th November 2010, 00:53
I can't download from this host. I'm getting 3-4KB/s and it times out everytime. I'm in Canada, so maybe it's a location issue
I uploaded the sample to mediafire:
http://www.mediafire.com/?gdlfdlu9n69qrs5
I had no trouble opening the sample using DirectShowSource with Haali + ffdshow.
blahapa
5th November 2010, 00:56
I can't download from this host. I'm getting 3-4KB/s and it times out everytime. I'm in Canada, so maybe it's a location issue
Oh, yes... I didnt know that it could be so bad... Try this link:
http://megarapid.eu/files/1258705/aa.zip
Or I can upload it somewhere in North America... suggest the server
blahapa
5th November 2010, 01:02
I uploaded the sample to mediafire:
http://www.mediafire.com/?gdlfdlu9n69qrs5
I had no trouble opening the sample using DirectShowSource with Haali + ffdshow.
I have also no problem to open it throught DirectShowSource. But try to use Bob in AviSynth alghorithm. You´ll get what I am talking about one frame forward, one backward the motion....
poisondeathray
5th November 2010, 01:02
No it's ok, i got it from sneaker_ger's link
it works fine here too DSS2(), and directshowsource() as expected (haali + ffdshow as well)
are you sure path and filename are correct?
poisondeathray
5th November 2010, 01:03
I have also no problem to open it throught DirectShowSource. But try to use Bob in AviSynth alghorithm. You´ll get what I am talking about one frame forward, one backward the motion....
wrong field order
assumetff()
bob()
avisynth assumes bff() by default
Didée
5th November 2010, 01:29
wrong field order
avisynth assumes bff() by default
OUCH!!! http://www.cheesebuerger.de/images/smilie/boese/k022.gif
BTW, on the original sample ffmpegsource2 told me:
"ffindex: can't parse file, most likely a transport stream not cut at packet boundaries"
Using tsMuxeR(GUI), remuxing *with* "continually insert SPS/PPS", the file can be accessed correctly. (Except for ffms2 won't find the 1st keyframe or something, correct picture starts only after frame 52.)
___
Plea for DGDecodeNV: it accesses the file without any problem. :)
blahapa
5th November 2010, 01:38
wrong field order
assumetff()
bob()
avisynth assumes bff() by default
Man, thank you, this I was looking for!! I dont know AviSynth very much, I thought that another field order is some parametr in Bob... But I havent found any. So this way... Thanx again. It seems I will leave you in peace for a while:) I hope :cool:
blahapa
5th November 2010, 23:09
One more problem, with directshowsource is aviSynth reading some frames badly. Dss2 still dont work for me. I dont know why..
Blue_MiSfit
5th November 2010, 23:11
dss2 doesn't work? Have you copied avss.dll from the haali media splitter installation folder into your avisynth plugins folder?
blahapa
6th November 2010, 00:09
Yes... the er. Message is the same as above: cant open ,.. File.avs: 80070003.
i dont if this is error number or what...
poisondeathray
6th November 2010, 00:11
One more problem, with directshowsource is aviSynth reading some frames badly. Dss2 still dont work for me. I dont know why..
Can you be more specific?
What does "reading some frames badly mean" ?
Do you mean frames out of order ? Pixellation ? Other errors in decoding ? etc...?
DirectShowSource should give the same result as DSS2() except when doing seeking (e.g. scrubbing the timeline) . If you do a straight encode from start to finish, you shouldn't have any problems . There might be other issues going on here like decoding problem
blahapa
6th November 2010, 00:31
Yes, frames pixelation, gray fields in it...
yes, i need seeking because i have one grate file and i need only part of this one... I have only internet on mobile phone, we had strong winds yesterday, wifi will be fix tomorrow...
poisondeathray
6th November 2010, 00:34
Yes, frames pixelation, gray fields in it...
yes, i need seeking because i have one grate file and i need only part of this one...
But file is ok in MPC ? (no pixellation, gray fields)
What version of avisynth ? IIRC , DSS2() doesn't work with older versions. If you don't know what version, type version() for avs script and preview
blahapa
6th November 2010, 01:02
Yes, input .ts file ís fine in mpc and sometimes also in vdub, i think there is some problem when im seeking also-framer are changing numbers plus minus 10 numbers. Ver. 2.60 27 sep 2009
Blue_MiSfit
6th November 2010, 08:01
I'd suggest remuxing your TS to an MKV, since MKV works extremely well with DSS2, at least in my experience.
Seems like a nasty workaround, and definitely ugly in production, but for an academic test like this it can't be THAT bad ;)
You could also transcode your TS source into a lossless H.264 stream using x264, and store it in an MKV or an MP4, just in case there's something pathological about your source that the various open source splitters can't deal with.
Another idea, LAVF splitter: http://forum.doom9.org/showthread.php?t=156191 It's at least something else you can try. Try removing haali splitter for this to work, or maybe making a custom GRF file in GraphEdit and then loading it with DirectShowSource.
TS can be difficult to get into AviSynth, depending on the source :(
Derek
blahapa
7th November 2010, 15:19
I'd suggest remuxing your TS to an MKV
OK, I ll try... But I have not so much time for trying now.
How to mux quickly in MKV? SUPER is very slow for that...
blahapa
7th November 2010, 16:21
Guys, its again moving one frame forward and one backward...
Even assumetff(a) and than Bob (a) cant fix this.
How is it possible? Yesterday it was fine I think I have tested the video... Try this again please on your computers I really dont know what was changed in the meantime...
blahapa
7th November 2010, 16:42
Guys, its again moving one frame forward and one backward...
Even assumetff(a) and than Bob (a) cant fix this.
How is it possible? Yesterday it was fine I think I have tested the video... Try this again please on your computers I really dont know what was changed in the meantime...
Sorry guys, I didnt know, that there is e difference between:
a=directshowsource("file.ts")
assumetff(a)
bob(a)
and
directshowsource("file.ts")
assumetff()
bob()
With the last code it is importing again fine... Ok, last problem is with importing media (some gray fields etc. in some frame as is written above - I am trying x264 and lossless convert to mkv)
blahapa
7th November 2010, 17:17
And how can I get the same INTERLACED output video from x264? I tryed
x264 --crf 0 --interlaced --tff -o out.mkv in.ts
but there are still some warnings and the output video isnt seem to bee like input.
warnings:
interlace+weightp is not implemented
interlaced<1> > level limit <0>
poisondeathray
7th November 2010, 17:41
OK, I ll try... But I have not so much time for trying now.
How to mux quickly in MKV? SUPER is very slow for that...
Try mkvtoolnix
But in my experience, mkv doesn't work well with interlaced streams. You often get wrong framerate, or wrong duration
Try this again please on your computers I really dont know what was changed in the meantime...
Everything works for me on your sample stream, even dss2()
And how can I get the same INTERLACED output video from x264? I tryed
x264 --crf 0 --interlaced --tff -o out.mkv in.ts
but there are still some warnings and the output video isnt seem to bee like input.
warnings:
interlace+weightp is not implemented
interlaced<1> > level limit <0>
Try disabling weightp
--weightp 0
blahapa
7th November 2010, 17:51
But in my experience, mkv doesn't work well with interlaced streams. You often get wrong framerate, or wrong duration
Yes, mkv out from x264 is changing duration (last 3 seconds is off) and maybe framerate too....
What do you suggest (problems with wrong frames time to time)?
//one more edit: //edit: frame rate seems to be ok in mkv and also interlacing is ok but when I was controlling it point to point, there was different colors. In MKV there are colors more dark than in original .ts, so I cant use x264 MKV. I also dont know why is x264 cutting the end of file (40 frames). I could handle this but I can not handle the colors. But in worse case I can use this... But why the colours are changing??
blahapa
7th November 2010, 20:51
Another idea, LAVF splitter: http://forum.doom9.org/showthread.php?t=156191 It's at least something else you can try. Try removing haali splitter for this to work, or maybe making a custom GRF file in GraphEdit and then loading it with DirectShowSource.
TS can be difficult to get into AviSynth, depending on the source
_
I have tryed this and I could see output video from graphEdit using LAVF splitter, the result was little biut different but stil with gray fields in some frames.
Only what helped was x264:
x264 --crf 0 --interlaced --tff -o out.mkv in.ts
the output is fine but with another (more dark) colours. Is anything what I can change to fix the colours?
poisondeathray
7th November 2010, 21:11
How are you determining that it's darker? what decoder/renderer/software?
Levels might be because x264 is built with decoding patch through ffmpeg , and it might be decoding different levels (maybe full range). You can feed it .avs script and control the decoder if that's the case, but then you are back to original problem
Something is set up incorrectly on your system, because your sample clip works fine here with directshowsource, dss2
If you have compatible nvidia cuda card and $15, get dgnvtools , I can't think of anything else. DSS2 would be ideal here if you can get it to work - maybe try another computer ?
blahapa
7th November 2010, 21:49
How are you determining that it's darker? what decoder/renderer/software?
Levels might be because x264 is built with decoding patch through ffmpeg , and it might be decoding different levels (maybe full range). You can feed it .avs script and control the decoder if that's the case, but then you are back to original problem
Something is set up incorrectly on your system, because your sample clip works fine here with directshowsource, dss2
If you have compatible nvidia cuda card and $15, get dgnvtools , I can't think of anything else. DSS2 would be ideal here if you can get it to work - maybe try another computer ?
Darker = in HSV less brightnes... But I havent look at what is changing in color space exactly. If it is important, I will look...
I have put the mkv file back to the virtualdub... but I can also compare with VLC... I think that the result will be the same...
Yes, the sample I send you is corect also here, but the second samples is bad... I can send to mediafire.com..
I can try to decode it in anythign else through graphedit, what do you suggest to become same colours, ffdshow?
I have triedand it seems that ffdshow is working only with directshowsource not with dss2 that is giving me good result video for out.mkv from x264...
I dont have nVidia, I have ATI, so I cant use this and also I dont have so much time to create finall videos. Another computer wont help I think... I will send the new sample... This new sample I have cutted in VideoRedo H.264 - through Trim and copy source file...
blahapa
7th November 2010, 22:17
I have controled the colours one more time and everything seems to be fine now... I cant explain it. So I will go throught this long way to final videos, uff.. it will be long night...Maybe a lot of cuts of original .ts file will be imported in VirtualDub fine and I will have less work..
Blue_MiSfit
8th November 2010, 00:15
You shouldn't have to change the colors / levels at all. Compression doesn't affect this.
If one sample looks darker / brighter than another, you're probably having a TV vs PC levels issue on playback. Study up on this.
Derek
blahapa
8th November 2010, 00:44
You shouldn't have to change the colors / levels at all. Compression doesn't affect this.
If one sample looks darker / brighter than another, you're probably having a TV vs PC levels issue on playback. Study up on this.
Derek
Its fine know... thats probably only fake that I cant explain... I promis that I have really saw that the colours has been changed but I could make also some mistake when I was using AviSynth (convertToYV12 probably?) dont know...
I hope that everything will work fine know... Maybe last question: How is it possible, that the file "out.mkv"
/ x264 --crf 0 --interlaced --tff --weightp 0 -o out.mkv in.ts /
has for example 33 gray frames (at the begining of file) more than source file "in.ts" :)
/edit: I have lisened to you at the end, Derek "Blue_MiSfit", I used x264 and everyhing works fine... and you have it in all your posts:P Thanx
nm
8th November 2010, 00:53
Maybe last question: How is it possible, that the file "out.mkv"
/ x264 --crf 0 --interlaced --tff --weightp 0 -o out.mkv in.ts /
has for example 33 gray frames (at the begining of file) more than source file "in.ts" :)
Because lavf and lavc (or ffms2, if x264 uses that) have problems demuxing and decoding those frames from your input TS. Is this the other file that you haven't yet uploaded?
blahapa
8th November 2010, 01:29
Because lavf and lavc (or ffms2, if x264 uses that) have problems demuxing and decoding those frames from your input TS. Is this the other file that you haven't yet uploaded?
Yes, I am sorry, here it is (hair.rar):
http://www.mediafire.com/?7orifbth6jl6by3
If there will be problem witch decoding I cant see all the frames from .ts file, can I? This 35 or how many frames are added before 1st frame...
blahapa
8th November 2010, 01:34
In any case, I would not assume that the simple bob() of Avisynth is comparable to hardware boxes......
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.
This is answer to Dide from 3rd page:
I have tried tdeint because you´re right, the static areas is problem... but it didnt work fine for example for titles at the end of movie... I can also upload the result here... Maybe i can use another mode but I really dont have time to investigate which is the best and which mode and settings is good for me... logo´s flicking you cant see from 2,5 m that is the right distance from for example 1m (40 inch) diagonal TV I think...
poisondeathray
8th November 2010, 01:44
Yes, I am sorry, here it is (hair.rar):
http://www.mediafire.com/?7orifbth6jl6by3
If there will be problem witch decoding I cant see all the frames from .ts file, can I? This 35 or how many frames are added before 1st frame...
but there are blank frames at the beginning when you use a media player as well (mpc+haali+ffdshow) , so you would expect the same thing if you encoded using x264 if you were using the same decoder
blahapa
8th November 2010, 01:50
but there are blank frames at the beginning when you use a media player as well (mpc+haali+ffdshow) , so you would expect the same thing if you encoded using x264 if you were using the same decoder
Yes, blank (black) frames at the beginning... but no gray frames I have gray frames at the beginning ofthe output file:) No matter...
poisondeathray
8th November 2010, 02:00
Yes, blank (black) frames at the beginning... but no gray frames I have gray frames at the beginning ofthe output file:) No matter...
Yes I confirm this too (grey frames when input directly into x264) , but not if you use avisynth to do it
blahapa
8th November 2010, 02:08
Yes I confirm this too (grey frames when input directly into x264) , but not if you use avisynth to do it
I cant use AviSynth because when I will import hair.ts to AviSynth, I will get some frames with gray fiels in it and other errors:)
poisondeathray
8th November 2010, 02:18
Let me clarify, x264 is compiled with ffms input , but ffms has problems with transport stream = errors, wrong frame count, added frames. Even when using ffms through avisynth, it has problems
When using directshowsource (dss2) + haali + ffdshow = no problems on either clip (just black frames on 2nd clip same as when played through media player , but no grey frames)
ffms has problems with transport streams - it says so in the readme
blahapa
8th November 2010, 04:27
Let me clarify, x264 is compiled with ffms input , but ffms has problems with transport stream = errors, wrong frame count, added frames. Even when using ffms through avisynth, it has problems
When using directshowsource (dss2) + haali + ffdshow = no problems on either clip (just black frames on 2nd clip same as when played through media player , but no grey frames)
ffms has problems with transport streams - it says so in the readme
YY, right but when I wrote gray fields in last post - thats another problem - thats small gray 10x10 pixels fields in picture... Try to import 2nd sample in Virtualdub via AviSynth using whatever and try to see all non black frames - there you discover 3 ugly frames. Derek wrote here that with some types of ts could have Avisynth problem... thatsway I have to transcode this .ts to .mkv lossless via x264 and then import to Virtualdub...
Long hard way but works!!!
poisondeathray
8th November 2010, 04:35
thats small gray 10x10 pixels fields in picture... Try to import 2nd sample in Virtualdub via AviSynth using whatever and try to see all non black frames - there you discover 3 ugly frames.
I didn't see any.
blahapa
8th November 2010, 04:51
I didn't see any.
Really no error in frame? Sometimes are errors only very small.... Maybe I have some bad settings here... dont know... one .ts is ok, I can import it directly, another one I have to recompress via x264.... Dont know... maybe Videoredo, sometimes is sekvence cuted on I frames sometimes not...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.