Log in

View Full Version : Loading .ts files


Trademark
11th July 2013, 02:14
I'm having trouble trying to load .ts files into avisynth proxy for avidemux to use. I used to have a script and the instructions to this years back, and I remember it required something like dgindex, and separately loading the audio and video with the script, but I can't quite seem to do it anymore.

My dgindex doesn't work anymore, and the avisynth faq page isn't quite specific enough for me on the issue.

Any helps, links to the downloads I need?

Guest
11th July 2013, 04:19
DGIndex did not just stop working. You may be referring to DGIndexNV or DGAVCIndexDI, which require a license key for your current machine.

In any case, you have a lot of options depending on the nature of your transport stream. Can you post a short unprocessed sample so that we can give you specific advice?

In general, you will need some source filters in your script, e.g. for video:

DirectShowSource()

DSS2()

MPEG2Source()

DGSource()

There are some FFMPEG based ones as well but I don't use them so can't cite the specifics.

Then there will be audio source filters too.

Music Fan
11th July 2013, 11:32
For FFMPEG based filter, use ;
FFVideoSource()
which needs ffms2.dll but I believe it uses an old libav filter which has problem with some interlaced H264 files.
That's why I use
LWLibavVideoSource()
which seems to manage it better but still has problems with PAFF H264. It needs LSMASHSource.dll, you can find it there (in L-SMASH-Works) ;
http://k4095-takuan.blogspot.de/p/blog-page_17.html
The framerate is sometimes doubled with LWLibavVideoSource (maybe only with interlaced H264) ; in this case, add repeat=true at the end of the first line like this ;
LWLibavVideoSource("E:\Video.ts", repeat=true)

Trademark
11th July 2013, 14:34
Neuron, Yes I remember using directshowsource to open my files before, and yes I am using dgindexnv. Thanks for letting me know that it was a licensing issue.

Music Fan, thanks for the lsmashsource plugin, with that I can successfully load my files with the avisynth proxy, thanks!

qwerty1983
11th July 2013, 15:19
In general, you will need some source filters in your script, e.g. for video:

DirectShowSource()

DSS2()

MPEG2Source()

DGSource()

There are some FFMPEG based ones as well but I don't use them so can't cite the specifics.

Then there will be audio source filters too.

Are these frame-accurate? I have some .ts files (h264+mp2) and the only way i have found to load them on avisynth (both video and audio) is by demultiplexing the .ts file, creating a .dga file (using dgavcdec) out of the .h264 raw stream and then using this script :

LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\DGAVCDecode.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\NicAudio.dll")
V=AVCSource("myfile.dga")
A=NicMPG123Source("myfile.mpa",normalize=false)
AudioDub(V,A)

I get frame-accurate editing with this method most of the times (if not always).


Sometimes i'm remuxing the .ts files to .avi (no reencoding) using avidemux but when i open the avisynth script with virtualdub i get a green screen.

Reino
11th July 2013, 19:09
You might want to give muxing to Matroska a try.

Guest
11th July 2013, 20:56
Are these frame-accurate? All the DG*** source filters are always frame accurate, even with pulldown and interlaced video. DSS() can also be frame accurate if the timestamps are monotonic (no time gaps or timestamp resets). The FFMPEG filters can be frame accurate in many cases as well, but again I am not very familiar with them. DirectShowSource()? Forget it.

Music Fan
11th July 2013, 21:41
You might want to give muxing to Matroska a try.
Something important to note about this : instead of opening directly the TS in MKVmerge, demux first the streams, then load them in MKVmerge.
This avoids framerate problems, especially with interlaced h264, even if one specify the framerate in MKVmerge.
I had this problem with my ts files (in interlaced h264) whose framerate was seen as variable instead of constant in MediaInfo after having put them in MKV container until I demuxed them with TSMuxer before to load audio and video in MKVmerge.
And if I remember correctly, one has to specify 50 fps (in 50hz regions, 59.94 in 60 hz regions) instead of 25 (or 29.97) for interlaced sources in the last MKVMerge versions, because this number concerns the fields and not the frames (while in TSMuxer one has to put 25 or 29.97).