Log in

View Full Version : FFmpegSource


Pages : 1 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

buzzqw
15th September 2007, 11:51
search for all avcodec-51.dll in your disk and delete all BUT this correct dll in windows\system32

on of these dll could be on a windows path directory

BHH

Mtz
15th September 2007, 12:58
Deleted, but the same problem. Before updating to 1.11 or 1.12 I neverhad problems, even if I had old dlls on system.

Mtz
20th September 2007, 21:34
Can somebody give me a link with an old version (from spring) of the ffmpegsource? I want to test the old avcodec-51.dll.

buzzqw
21st September 2007, 07:27
look here http://www.64k.it/andres/dettaglio.php?sez=avisynth

BHH

Mtz
21st September 2007, 19:54
Thanks! Tried all versions and no luck. :( I think I'll reinstall my OS.

Myrsloik
6th October 2007, 21:03
New version with some minor fixes for timecodes and flv video.

Lele-brz
18th October 2007, 08:28
my 2 cents about ffmpeg libraried dlls.
Would it be possible to use the statically compiled version of them, so the ffmpegsource.dll will be self-contained.
What I noticed is that sometimes if on the machine there are other ffmpeg dlls it can link against them.
thanks

bye

Myrsloik
19th October 2007, 00:25
I hope you understand technobabble because that's what you just asked for...

Statically compiling with vs2005 is impossible, it doesn't use the same runtime library as mingw. Going back to vc6 isn't much fun either but it could work. I don't feel like doing all the work to find out but the source is available if anyone really wants to try it.

The other alternative is to use mingw. But then it has to be converted to a "c" plugin which in my last attempt failed miserably. Mostly since _fseeki64 and its friends only exists in msvcr80.dll and it didn't want to link it properly. For even more obscure reasons it didn't seem to fully appreciate haali's code either. But it was all statically linked and annoying to debug.

Then there's the lesser evil kind of solution. Link the ffmpeg dlls by symbol names instead of by ordinal. This would in theory make it possible to replace all dlls without recompiling and share the same set between all programs (major version changes excluded). This is however greatly discouraged and done by no one since the generated import libraries on windows link by ordinal. Fortunately I don't use my own plugins that much so why bother...

Farewell cruel world?

akupenguin
19th October 2007, 09:19
The other alternative is to use mingw. But then it has to be converted to a "c" plugin which in my last attempt failed miserably. Mostly since _fseeki64 and its friends only exists in msvcr80.dll and it didn't want to link it properly.
Is there a difference between _fseeki64 and fseeko64? The latter works in mingw.

Myrsloik
19th October 2007, 18:18
I guess the difference is that one is microsoft approved and the other isn't. One day I really should learn this C (with and without ++) stuff.

Chainmax
22nd October 2007, 02:40
I want to open a DXA video in Avisynth, do I need anything else than FFMPEGSource?

Myrsloik
26th October 2007, 01:56
This Is A Version Only Intended For Testing, Idiots Should Skip This Post

This test version uses a new way to decode audio without using a huge uncompressed audio cache. Matroska files need no additional space and all other containers have the original demuxed audio track stored in c:\ffmpegsource.cache (this test version only).

The decoding results seems to be identical (dithering/other parts of codecs that prevent it but makes no difference) when run multiple times when compared to itself. It does however differ a lot from ffmpegsource(atrack=-1) and I have no idea why that is. There are at least no audible artifacts (to me) so report if it works properly.

Usage:
FFAudioSource(string source)

Link (http://ivtc.org/new/beta/FFMpegSource_audio_test.rar)

Wilbert
27th October 2007, 13:39
@Myrsloik,

Recently MLP decoding was added: ffmpeg-mailinglist (http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2007-October/thread.html#36628). Could you add this to FFAudioSource? I would be very grateful!

Myrsloik
27th October 2007, 18:10
I tried to compile a newer ffmpeg the usual way but I get this error:

gcc -shared -Wl,--output-def,avformat-51.def -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base -Wl,--warn-common -Wl,-rpath-link,"/c/libraries/ffmpeg"/libavcodec -Wl,-rpath-link,"/c/libraries/ffmpeg"/libavformat -Wl,-rpath-link,"/c/libraries/ffmpeg"/libavutil -o avformat-51.dll allformats.o cutils.o os_support.o sdp.o utils.o avio.o aviobuf.o raw.o aiff.o riff.o amr.o apc.o ape.o asf.o asfcrypt.o au.o avidec.o avs.o vocdec.o voc.o bethsoftvid.o c93.o daud.o dsicin.o dv.o dxa.o electronicarts.o ffm.o flic.o flvdec.o 4xm.o gifdec.o gxf.o idcin.o img2.o ipmovie.o matroskadec.o matroska.o mm.o mmf.o mov.o isom.o mp3.o mpc.o mpeg.o mpegts.o mtv.o mxf.o nsvdec.o nutdec.o nut.o nuv.o ogg2.o oggparsevorbis.o oggparsetheora.o oggparseflac.o oggparseogm.o rtsp.o rmdec.o idroq.o segafilm.o siff.o smacker.o sol.o psxstr.o swf.o thp.o tiertexseq.o tta.o txd.o sierravmd.o wav.o wc3movie.o westwood.o wv.o yuv4mpeg.o file.o http.o rtpproto.o tcp.o udp.o -L"/c/libraries/ffmpeg"/libavutil -lavutil -lavcodec -L"/c/libraries/ffmpeg"/libavcodec -lz -lm -la52 -lfaad -lws2_32
c:/libraries/ffmpeg/libavcodec/libavcodec.a(cscd.o): In function `decode_frame':
c:/libraries/ffmpeg/libavcodec/cscd.c:161: undefined reference to `lzo1x_decode'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(nuv.o): In function `decode_frame':
c:/libraries/ffmpeg/libavcodec/nuv.c:168: undefined reference to `lzo1x_decode'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(cook.o): In function `scalar_dequant_float':
c:/libraries/ffmpeg/libavutil/random.h:45: undefined reference to `av_random_generate_untempered_numbers'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(cook.o): In function `cook_decode_init':
c:/libraries/ffmpeg/libavcodec/cook.c:1069: undefined reference to `av_init_random'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(mpc.o): In function `mpc7_decode_frame':
c:/libraries/ffmpeg/libavutil/random.h:45: undefined reference to `av_random_generate_untempered_numbers'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(mpc.o): In function `mpc7_decode_init':
c:/libraries/ffmpeg/libavcodec/mpc.c:83: undefined reference to `av_init_random'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(nellymoserdec.o): In function `decode_init':
c:/libraries/ffmpeg/libavcodec/nellymoserdec.c:401: undefined reference to `av_init_random'
c:/libraries/ffmpeg/libavcodec/libavcodec.a(nellymoserdec.o): In function `nelly_decode_block':
c:/libraries/ffmpeg/libavutil/random.h:45: undefined reference to `av_random_generate_untempered_numbers'
collect2: ld returned 1 exit status
make[1]: *** [avformat-51.dll] Error 1
make[1]: Leaving directory `/c/libraries/ffmpeg/libavformat'
make: *** [lib] Error 2

It seems like it can't find the libraries it's compiled itself or something similar. No idea what to do about it.

Myrsloik
28th October 2007, 04:25
New compile of the test version. Includes a recent ffmpeg and it's now statically linked (flac cache not enabled since it didn't want to link).

Link (http://ivtc.org/new/beta/FFMpegSource_audio_test.rar)

Wilbert
28th October 2007, 14:07
Thx! I got it working for AAC and MP4/AAC, although i didn't test it very well. It seems that the MLP/TrueHD patches are not added to the SVN yet, but i will keep an eye on it.

tateu
29th October 2007, 20:43
@Myrsloik,

You might want to try "strip -x libavcodec.a" on all the ffmpeg libs for the static compile. In my tests, that cuts the resulting dll size down to about 3MB.

Wilbert
30th October 2007, 22:26
@Myrsloik,

Kurtnoise created a patch for E-AC3/MLP (ffmpeg)! Could you incorporate that in FFAudioSource?

patch: http://kurtnoise.free.fr/index.php?dir=misc/

Thanks again!

Myrsloik
30th October 2007, 22:35
If I did you would have no motivation to get it integrated into the main branch. The source is still available if someone really wants to make their own build with an "improved" ffmpeg and I don't mind answering compilation questions... AS LONG AS YOU CLEARLY LABEL IT AS NOT COMPILED BY ME. You could even get your own link in the first post! Apply now!

Kurtnoise
1st November 2007, 09:23
@Wilbert: Done... (http://kurtnoise.free.fr/index.php?dir=misc/&file=FFmpegSource_r10891.7z) but not tested. :)

@Myrsloik: why using FLAC as external lib ? FFmpeg has his own FLAC decoder...

Leak
1st November 2007, 11:13
@Myrsloik: why using FLAC as external lib ? FFmpeg has his own FLAC decoder...
I was under the impression he also needed a FLAC encoder for the audio cache - does ffmpeg do FLAC encoding as well?

np: Prefuse-73 - Every Party Has A Winner And A Loser (Unrest)

Kurtnoise
1st November 2007, 11:55
I was under the impression he also needed a FLAC encoder for the audio cache - does ffmpeg do FLAC encoding as well?
yes it does...

Wilbert
1st November 2007, 22:16
@Kurtnoise13,

http://rapidshare.com/files/66801815/ffmpeg_samples.zip.html contains some samples: AAC, MP4/AAC and MLP.

The AAC, MP4/AAC played, but the sound was a bit garbled.

The MLP (44.1 kHz, 16 bit) didn't play at all, it gave the error: 'Audio decoding error'. Script:

v = BlankClip()
a = FFmpegSource("D:\Install\dvd-audio\TheCorrs\DVDAExplorer\Acapela1.mlp", vtrack=-2, atrack=-1)
AudioDub(v,a)


http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2007-October/036639.html contains a raw-mlp support patch. I don't know whether that was included in your patch? (Perhaps related, perhaps not :))

Myrsloik
2nd November 2007, 00:33
The reason is very simple, I'm lazy.

Actually libflac has a nice api that allows sample accurate seeking all the time and is extremely simple to use. With libavformat seeking is much less fun and where you end up is usually a bit uncertain (if it wasn't, someone else probably would've made ffmpegsource before me).

Kurtnoise
2nd November 2007, 14:45
I don't know whether that was included in your patch? (Perhaps related, perhaps not :))
Yes, you're right. I forgot this. New build uploaded. Should be fine now...:)

About aac multichannel files, dunno why it doesn't work properly actually...I'll try something else later.

Wilbert
2nd November 2007, 22:37
Yes, you're right. I forgot this. New build uploaded. Should be fine now...
It works, i'm so excited!!!!!!!! Thanks you very much!

One additional request though :) 24 bit stuff is reported as 16 by AviSynth. I'm not sure whether it is converted to 16 bit down the road, or if the patch doesn't support 24 bit. I got an example here:

http://rapidshare.com/files/67023394/ffmpeg_samples2.zip.html

Perhaps you can look at it. If the patch doesn't support it, i will contact Ian Caulfield.

Myrsloik
2nd November 2007, 22:49
From avcodec.h:

/* Currently unused, may be used if 24/32 bits samples are ever supported. */
/* all in native-endian format */
enum SampleFormat {
SAMPLE_FMT_NONE = -1,
SAMPLE_FMT_U8, ///< unsigned 8 bits
SAMPLE_FMT_S16, ///< signed 16 bits
SAMPLE_FMT_S24, ///< signed 24 bits
SAMPLE_FMT_S32, ///< signed 32 bits
SAMPLE_FMT_FLT, ///< float
};

Further down...

/**
* audio sample format
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
enum SampleFormat sample_fmt; ///< sample format, currently unused

Wilbert
2nd November 2007, 23:11
That sounds bad. Does that mean that outputting 24 bit is still not supported in ffmpeg?

tebasuna51
3rd November 2007, 01:36
That sounds bad. Does that mean that
outputting 24 bit is still not supported in ffmpeg?
Yep, ffmpeg convert anything to 16 bit and preserve the original channel mapping (of course the ac3/aac multichannel conversions are wrong channel mapped).

I think we need preserve the original precision (bitdepth) and use a standard channel mapping for decoder-encoder compatibility.

Wilbert, don't know this thread (http://forum.doom9.org/showthread.php?p=1043284#post1043284)?
Justin answer about ffmeg bitdepth and multichannel behaviour, there are also a solution to work with NeroAacEnc stdin requested by you in other thread.

Kurtnoise
3rd November 2007, 09:11
From mlp_parser.c :

#ifdef CONFIG_AUDIO_NONSHORT
avctx->bits_per_sample = mh.group1_bits;
if (avctx->bits_per_sample > 16)
avctx->sample_fmt = SAMPLE_FMT_S32;
#endif

MoFoQ
8th November 2007, 04:03
@EAC3 capable ffmpeg: that's cool!

ok...so..how do I use it in avisynth?

Wilbert
11th November 2007, 14:57
1) Get ffmpeg_eac3_mlp_rev10905.7z from http://kurtnoise.free.fr/index.php?dir=misc/, and put it in AviSynth plugin folder.
2) Get FFmpegSource-1.13.rar from the first post in this thread and put all the dlls (except ffmpegsource.dll which is an AviSynth plugin, this one is the same as above except for the MLP/TrueHD/E-AC3 decoding support) in your system folder.

Yobbo
11th November 2007, 20:51
1) Get ffmpeg_eac3_mlp_rev10905.7z from http://kurtnoise.free.fr/index.php?dir=misc/, and put it in AviSynth plugin folder.

This .7z file contains ffmpeg.exe? Do I put this is my Avisynth folder? Or in Plugins subfolder? Or?

Kurtnoise
11th November 2007, 21:01
If you need *only* the avisynth stuff, the FFmpegSource package is sufficient. No need to grab FFmpeg...

Yes, FFmpegSource must be in your Avisynth plugins folder unless you want to use some LoadPlugin(...).

At last, neither FFmpegSource nor FFmpeg require some dlls to work for.

MoFoQ
11th November 2007, 22:27
ok updated...I got the avisynth ffmpegsource plugin to work...unfortunately, it doesn't seem to want to work with the eac3 file I want to convert.
with the standalone, it would start to convert but will hang at around 9000+ frames (roughly 1:30 into the clip).
the avisynth version will not even start though it doesn't complain about the plugin.
is there something I can do to help debug?

Kurtnoise
12th November 2007, 12:13
what kind of script did you use ?

TrueIndigo
26th November 2007, 22:41
I’m having a sound problem playing an avs file in VirtualDubMod using ffmpegsource to reference an avi. The picture plays ok, but there is no sound (checking VirtualDubMod’s properties of the avs file shows there is no audio information), though playing the avi directly in VirtualDubMod proves the avi itself has sound. The file type is XviD mpeg-4 avi, and the simple test script is shown below:

LoadPlugin("c:\Program Files\Avisynth 2.5\Plugins\FFMpegSource.dll")

ffmpegSource("d:\Video tests\Avisynth -- 4\v1h2-1-1.avi")

I’m not sure if my script is incomplete, my location of ffmpegsource is wrong*, or I don’t have a suitable sound plugin which Avisynth needs. In the folder containing the avs and avi, the ffv0cache file (video) has been created but no audio cache file.

This is the first time I’ve used ffmpegsource, and I’m still a newbie with Avisynth itself, so any help is gratefully accepted. Many thanks.

*Although some advice on this thread suggests putting files in system32, and the main dll in Avisynth’s plugins folder, I read the html page which comes with the unzipped ffmpegsource files, and this says you can put all the files in the Avisynth plugins folder. I elected to do this - don’t know if it has a bearing on my sound problem.

Wilbert
26th November 2007, 22:59
I think you need to use:


FFAudioSource("D:\move.avi", atrack=-1)

to get the audio track.

TrueIndigo
27th November 2007, 20:01
Wilbert -- thanks. I tried your suggestion but it still didn’t work, however putting your code inside the brackets did work, as shown below:

LoadPlugin("c:\Program Files\Avisynth 2.5\Plugins\FFMpegSource.dll")

ffmpegSource("d:\Video tests\Avisynth -- 4\v1h2-1-1.avi", atrack=-1)

So now I have sound, but I noticed it is not in sync. It does not appear to be an accumulation of sync loss, but is constantly out throughout the clip (it looked "early", and at the end the sound finishes just before the imagery stops). Am I doing something wrong; is this a known problem; is there a fix? I tried the same avi file using AviSource and there was no sync problem.

ficofico
27th November 2007, 21:26
I'm trying to do a bad work;)

I've seen that using ffmpegsource it's possible to print a timecode v2 , and after process my mp4 file trough avisynth and x264, I've found that using tc2mp4 it's possible to paste the timecode into the new mp4 file.
Now I want to do more..... I usually double framerate of this vfr video using avisynth script and mediainfo framerate, but obviously video isn't in sync with audio for all the frame, because the framerate it's vfr. If I first encode my vfr video with "Super" to cfr framerate , using my program that doubleframerate I have no trouble, but it's not an elegant way to do batch procesing. My question is:

Is there a way to use this ffmpegsource timecode file for processing vfr video doubling the framerate maintaining audio - video synch ? also using 2 pass or 3 pass ecc ecc....:thanks:

foxyshadis
28th November 2007, 00:16
ficofico, if you strictly double, then all you need to do is interpolate a new timestamp halfway between each existing one in the file. And one more at the end for good measure. When you remux it should be in sync.

TrueIndigo, you'll probably have to use avisynth's built in audio delay function, I guess ffmpegsource doesn't look at that yet.

cweb
28th November 2007, 19:05
Is it possible to get ffmpeg to do a video resize when ffmpegsource calls it?
Because I've got an flv which is 320x239 and I want to open in in avisynth resized to 320x240. directshowsource is giving me a CAVIstreamerror when I try to open it that way, so I tried ffmpegsource instead, but I got an error that the video is the wrong size...

Wilbert
28th November 2007, 19:13
Because I've got an flv which is 320x239 and I want to open in in avisynth resized to 320x240. directshowsource is giving me a CAVIstreamerror when I try to open it that way, so I tried ffmpegsource instead, but I got an error that the video is the wrong size...
I guess it tries to open it as YV12, which is not possible (height should be even). Use DirectShowSource with pixel_type="YUY2" (or 'RGB") to force it to open it as YUY2.

cweb
28th November 2007, 19:27
I guess it tries to open it as YV12, which is not possible (height should be even). Use DirectShowSource with pixel_type="YUY2" (or 'RGB") to force it to open it as YUY2.
BTW I have ffdshow to do a resize to 320x240 at the moment to get it to load but still..

With the other stuff in the script to resize and improve it a bit (usual stuff from the forums) I was getting a memory access error most of the time too.

That's what's happening. Thanks.
I found a workaround, I just opened it with directshowsource with no other processing in the script and encoded it to huffy. Now I can open the huffy avi with ffmpegsource or avisource and do the processing I wanted to do...

I tried, just for fun, opening with directshowsource with pixel_type="yuy2", with the same stuff in the script, plus a lanczosresize to 320x240. Well first it crashed with a memory access error in Virtualdub, then the next time it worked.

Ok the good thing is I found the workaround...

Myrsloik
28th November 2007, 19:28
Upload the video or a part of it to ftp://upload:upload@mellbin.org and I will look at it. Should at least be possible to pad yv12 to even widths and heights and let the user crop away the junk if necessary.

cweb
28th November 2007, 20:08
Upload the video or a part of it to ftp://upload:upload@mellbin.org and I will look at it. Should at least be possible to pad yv12 to even widths and heights and let the user crop away the junk if necessary.
Done.. thanks.

Wilbert
28th November 2007, 21:55
I saw that MLP/TrueHD is added to the SVN:

http://svn.mplayerhq.hu/ffmpeg/trunk/

I hope that there will be a new build :)

Myrsloik
29th November 2007, 09:10
There will be as soon as I finish the cache stuff for ffaudiosource which will probably be this weekend.

Kurtnoise
29th November 2007, 09:49
I saw that MLP/TrueHD is added to the SVN:

http://svn.mplayerhq.hu/ffmpeg/trunk/

I hope that there will be a new build :)

only the parser...the decoder is still in review.

TrueIndigo
29th November 2007, 20:11
Foxyshadis -- thanks for the help. I must look into how I would script audio delay, and if there is any way the delay factor can be accurately gauged (rather than just my estimate). My original query came from a test sourcing an mpeg-4 avi. I have since tried a Huffyuv avi but the "early" sound sync loss was exactly the same with this test as well. I had wondered if it might have been some obscure mpeg-4 issue (even though inside an avi container), but it appears not.
Thanks.