Log in

View Full Version : FFMPEGSource2 as replacement for DGAVCDec


LoRd_MuldeR
2nd December 2009, 15:19
@2Bdecided:
If you don't want to or can't buy DG NV Tools, then you should definitely have a look at FFmpegSource2 (http://forum.doom9.org/showpost.php?p=1347813&postcount=691) and check whether it can replace DGAVCIndex for your purpose!

pkirill
2nd December 2009, 20:11
@2Bdecided:
If you don't want to or can't buy DG NV Tools, then you should definitely have a look at FFmpegSource2 (http://forum.doom9.org/showpost.php?p=1347813&postcount=691) and check whether it can replace DGAVCIndex for your purpose!

Can you expand the knowledge? What is main difference bw
FFmpegSource2 <> DirectShowSource2 <> DGAVCIndex ?
Whay i`m getting diferent video (async) while i`m useing DirectShowSource2 ?

Thanks

LoRd_MuldeR
2nd December 2009, 20:25
Can you expand the knowledge? What is main difference bw
FFmpegSource2 <> DirectShowSource2 <> DGAVCIndex ?
Whay i`m getting diferent video (async) while i`m useing DirectShowSource2 ?

Thanks

DGAVCIndex was an Avisynth source filter purely for H.264/AVC streams, it used libavcodec's H.264 decoder and it was limited to elementary H.264 streams or TS/M2TS files. DirectShowSource and DSS2 use the DirectShow framework to decode the source, so in theory they support everything for which the suitable DirectShow filters (decoders and splitters!) are installed on your system, but they aren't always frame accurate. FFmpegSource2 is an Avisynth source filter based on the FFmpeg (libavcodec/libavformat) splitters and decoders, so it natively supports (almost) everything that FFmpeg can handle, which includes a multitude of formats (MPEG-1, MPEG-2, MPEG-4 ASP, H.264, HuffYUV, FFv1, etc) and containers (AVI, MP4, TS, M2TS, MKV, etc). In contrast to DGAVCIndex, FFmpegSource2 is still under active development.

stax76
2nd December 2009, 22:44
If you don't want to or can't buy DG NV Tools, then you should definitely have a look at FFmpegSource2 and check whether it can replace DGAVCIndex for your purpose!

This plugin contains a FFmpegSource filter but no FFmpegSource2 filter and it's not working, I gave it a try on a ARD HD sample recorded as TS by DVBViewer and compared it against other free solutions encoding with StaxRip. I'm not a HD user, just work on StaxRip integration so no interest in payware like CoreAVC and regarding NV tools, my card is ATI. Here is what my little speed test came out:


AVCSource crash
DSS DivX 1:55 min, audio sync OK
DSS ffdshow ffmpeg-mt 2:18 min, audio sync OK
DSS Microsoft 2:58 min, audio sync OK
DSS ffdshow libavcodec 3:15 min, audio sync OK
FFVideoSource 3.40 min, audio sync lost completely


I don't know which of used DS decoders can take advantage of the GPU, my GPU supports some decoding features I think but the card is rather old, ATI 2400.

Brazil2
2nd December 2009, 22:50
FFmpegSource2 filter
http://code.google.com/p/ffmpegsource/

stax76
2nd December 2009, 23:14
@Brazil2

I tried the latest (NOV 18), it crashes on my stream. I did not run tsremux like it suggests however. Do you think this could help and do you think it might be faster than DivX or has other advantages over DivX?

LoRd_MuldeR
2nd December 2009, 23:32
This plugin contains a FFmpegSource filter but no FFmpegSource2 filter and it's not working, I gave it a try on a ARD HD sample recorded as TS by DVBViewer

Works for me with the exactly same kind of source. Make sure you have Haali's Splitter installed, as FFmpegSource2 uses Haali's TS parser code, if available.

Also, if you do a speed comparison, make sure you use a build of FFmpegSource2 that was built with FFmpeg-MT, which will give a nice speed-up.

(EDIT: About audio sync lost: Check the framerate returned by FFmpegSource2 and, if required, use AssumeFPS() to correct it. I had to do this at least once)

Chengbin
3rd December 2009, 02:04
DirectShowSource and DSS2 use the DirectShow framework to decode the source, so in theory they support everything for which the suitable DirectShow filters (decoders and splitters!) are installed on your system, but they aren't always frame accurate.

I think DSS2 is frame accurate

Guest
3rd December 2009, 02:14
DSS2 relies on PTS timestamps. If they are not continuous, or if you have an elementary stream, then frame accuracy is not guaranteed.

pkirill
3rd December 2009, 09:04
DirectShowSource and DSS2 ... , but they aren't always frame accurate. FFmpegSource2 is an Avisynth source filter based on the FFmpeg (libavcodec/libavformat) ...

Are FFmpegSource2 frame accurate ?
Does it produce synced results ?

LoRd_MuldeR
3rd December 2009, 11:32
Are FFmpegSource2 frame accurate ?
Does it produce synced results ?

Since it supports a great variety of formats and containers, the answer probably is: Generally yes, but it depends...

Why not try out with your source?

pkirill
3rd December 2009, 13:03
Since it supports a great variety of formats and containers, the answer probably is: Generally yes, but it depends...

Why not try out with your source?

Sure, i`m going to try it.
One more questnion : can FFMPEGSource2 do indexing procedure for DVD Vob files (replace DGIndex functionality ) ?

Thanks

LoRd_MuldeR
3rd December 2009, 13:10
Yes, it handles MPEG-2 video and AC-3 audio, as well as the MPEG-PS/VOB container. So it should work with Video-DVD.

buzzqw
3rd December 2009, 13:49
but ffmpegsource not automatically concatenate vobs

BHH

LoRd_MuldeR
3rd December 2009, 14:00
but ffmpegsource not automatically concatenate vobs

BHH

That's what the "+" operator in Avisynth does :D

markanini
4th December 2009, 22:20
Whats the story on threading. Multicore cpu's advantaged on avc and mpeg2 like in ffdshow-tryouts(libavcodec)?

JEEB
4th December 2009, 23:25
Whats the story on threading. Multicore cpu's advantaged on avc and mpeg2 like in ffdshow-tryouts(libavcodec)?
ffmpegsource2 can be built with ffmpeg-mt, which brings frame-based multithreading in.

LoRd_MuldeR
5th December 2009, 14:23
Whats the story on threading. Multicore cpu's advantaged on avc and mpeg2 like in ffdshow-tryouts(libavcodec)?

Yes, it is the very same decoder as used in ffdshow-tryouts, namely the multi-threaded branch of FFmpeg's libavcodec ("FFmpeg-MT").

markanini
5th December 2009, 16:19
Fantastic! Thanks for the clarifying and confirming. I'll be using ffms2 for all restorations from now on.

Zep
5th December 2009, 19:24
Are FFmpegSource2 frame accurate ?
Does it produce synced results ?

nope it is not. It misses many frames and you will get out of sync problems.

Zep
5th December 2009, 19:34
ffmpegsource2 can be built with ffmpeg-mt, which brings frame-based multithreading in.

it is not frame accurate and you will get sync problems.

.ts (mpeg2) major problems with dropping video frames
and NOT keeping audio sync. NOTE: it may be fine decoding other formats.

Anyway, the MT version is far worse than the non MT version.
In all my tests, sync was going out about 400ms per 15 minutes of .ts (mpeg2)
source decoding. DGindex and other decoders decode those frames perfectly.

LoRd_MuldeR
5th December 2009, 20:23
nope it is not. It misses many frames and you will get out of sync problems.

Such generalized statement, without any info on what format/container the problem was encountered, is simply wrong.

Also: Do you have Haali Media Splitter installed? FFmpegSource2 will use Haali's splitter (as COM object) for TS files, if installed. Otherwise it falls back to it's "internal" (less stable) splitter...

Brazil2
5th December 2009, 21:15
From the user manual:
http://ffmpegsource.googlecode.com/svn/trunk/doc/ffms2-avisynth.html

Known issues

* There will appear decoding artifacts on h264 in transport streams.
* FFIndex() will silently ignore fatal decoding errors when indexing. This means that indexing a specific track may have failed even if FFIndex() succeeds.


Compatibility

* AVI, MKV, MP4, FLV: Frame accurate
* WMV: Frame accurate(?) but avformat seems to pick keyframes relatively far away
* OGM: Frame accurate(?)
* VOB: No rff flags applied
* MPG: Seeking seems to be off by one or two frames now and then
* M2TS, TS: Seeking seems to be off a few frames here and there
* Image files: Most formats can be opened if seekmode=-1 is set, no animation support

Guest
5th December 2009, 21:48
Thanks, that's useful to know.

lapinot
7th December 2009, 03:08
I just tried it on a .ts I recorded (DSL capture / PAFF stream / H264)
with AVCsource result is unwatchable,artifacts on each movement.
with FFMS2 works way better, at first glance it looked perfect... but after some scrutiny it seems to go occasionnaly nuts with some frames in...the wrong order (ie something like 1 2 3 4 7 8 5 6 9 10).
I guess it must use the internal splitter as I'm Ubuntu user (vdubmod/avisynth with wine).

Maybe I'll try to remux that h264 stream within mkv to see if it handles indexing better...

LoRd_MuldeR
7th December 2009, 03:39
On the Win32 platform FFmpegSource would use Haali's TS parser, if installed. No idea, if that can work on Linux/Wine.

TheRyuu
7th December 2009, 08:56
it is not frame accurate and you will get sync problems.

.ts (mpeg2) major problems with dropping video frames
and NOT keeping audio sync. NOTE: it may be fine decoding other formats.

Anyway, the MT version is far worse than the non MT version.
In all my tests, sync was going out about 400ms per 15 minutes of .ts (mpeg2)
source decoding. DGindex and other decoders decode those frames perfectly.

Post a sample.
And on ts/m2ts ffmpegsource never claims to be frame accurate or decode your frames in the correct order.

henryho_hk
7th December 2009, 11:17
That's what the "+" operator in Avisynth does :D

Not really.

The VOB files are broken into 1GB pieces without regard to its contents. ffmpegsource2 will open the 2nd, 3rd, etc. pieces, but silently ignoring the decode errors at the beginning. This creates skips at the "joint points".

LoRd_MuldeR
7th December 2009, 14:51
Then you can still join together the VOB's via copy /B VTS_1.VOB + VTS_2.VOB + VTS_3.VOB COMPLETE.VOB before indexing ;)

MatLz
7th December 2009, 14:56
Or simply rip the dvd in one single VOB:devil:

G_M_C
7th December 2009, 20:47
I dont want to be offencive, but this thread was mainly because AVCindex is "in discussion" atm; ffmpegsource2 can be used as alternative in the mean time.

VOB's and DVD's arent encoded in AVC last time I looked, so talk about VOB's is somewhat off-topic. But speaking of DVD's and VOB's ... what's the problem with using DGMPGIndex (http://forum.doom9.org/showthread.php?t=151026) ? Thats probably the best tool to use in this case, and you're sure it'll work on DVD-sources.

On the topic of AVC video's/clip's; I've had no problem with DSS () when i make a graph using Haali's splitter and FFDshow. But that's on linear straight source-to-target encodes, without cuts/moves/edits or what not.

MatLz
7th December 2009, 20:57
Have you ever 'trim()' avc via dss? It's impossible to get we want!

MOS-Marauder
30th August 2010, 08:43
I also tried FFmpegsource in an AVS now. As u know it cannot open an h264 Raw Stream. When i demux a .ts File and remux it to an MKV... Encode later will def. be out of sync. (Tried serveral times).

Chris