Log in

View Full Version : Async audio when joining files - avi, h264, adpcm, ffms2


NoX1911
2nd September 2010, 18:51
Hallo,
i have videos from a digital camera that outputs avi/h264/adpcm files. I'm trying to join some of these videos but it will give async audio with the script below. I'm not sure if this is the way to go. Any better ideas?
A = FFAudioSource("FILE0002.AVI") ++ \
FFAudioSource("FILE0003.AVI") ++ \
FFAudioSource("FILE0004.AVI") ++ \
FFAudioSource("FILE0005.AVI") ++ \
FFAudioSource("FILE0006.AVI") ++ \
FFAudioSource("FILE0007.AVI") ++ \
FFAudioSource("FILE0008.AVI") ++ \
FFAudioSource("FILE0009.AVI") ++ \
FFAudioSource("FILE0010.AVI") ++ \
FFAudioSource("FILE0011.AVI") ++ \
FFAudioSource("FILE0012.AVI") ++ \
FFAudioSource("FILE0013.AVI") ++ \
FFAudioSource("FILE0014.AVI")

V = FFVideoSource("FILE0002.AVI") ++ \
FFVideoSource("FILE0003.AVI") ++ \
FFVideoSource("FILE0004.AVI") ++ \
FFVideoSource("FILE0005.AVI") ++ \
FFVideoSource("FILE0006.AVI") ++ \
FFVideoSource("FILE0007.AVI") ++ \
FFVideoSource("FILE0008.AVI") ++ \
FFVideoSource("FILE0009.AVI") ++ \
FFVideoSource("FILE0010.AVI") ++ \
FFVideoSource("FILE0011.AVI") ++ \
FFVideoSource("FILE0012.AVI") ++ \
FFVideoSource("FILE0013.AVI") ++ \
FFVideoSource("FILE0014.AVI")

AudioDub(V, A)
#EnsureVBRMP3Sync
#ChangeFPS(25)
#ConvertFPS(25)

General
Complete name : D:\FILE0002.AVI
Format : AVI
Format/Info : Audio Video Interleave
File size : 52.6 MiB
Duration : 1mn 17s
Overall bit rate : 5 693 Kbps
Movie name : 2010/07/18
Recorded date : 2010-07-18
Writing library : AMBA
ICRT : 13:58:33

Video
ID : 0
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=1, N=8
Codec ID : H264
Duration : 1mn 17s
Bit rate mode : Variable
Bit rate : 5 298 Kbps
Maximum bit rate : 5 501 Kbps
Width : 848 pixels
Height : 480 pixels
Display aspect ratio : 16:9
Frame rate : 29.970 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.434
Stream size : 48.9 MiB (93%)

Audio
ID : 1
Format : ADPCM
Codec ID : 11
Codec ID/Hint : Intel
Duration : 1mn 16s
Bit rate mode : Constant
Bit rate : 384 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Bit depth : 4 bits
Stream size : 3.55 MiB (7%)
Interleave, duration : 43 ms (1.28 video frame)

Edit:
Hmm... a simple AviSource seems to give proper results. I thought ffms2 should usually be the better import filter? o_O
Even though the problem seems solved is there any better method for ffms2 (if i once have to use ffms2)?

Ghitulescu
2nd September 2010, 22:08
Most such cameras do come with their own software to join the files they produce.

Some simply split the files byte-wise, a simple COPY /B file1+file2+... filetotal would do the trick.

The reason why joining A/V-files yields asynchs was explained several times in this forum.

NoX1911
3rd September 2010, 00:23
Most such cameras do come with their own software to join the files they produce.
Its a standard avi container. The problem is not file size based. Its just general Avisynth joining.

Some simply split the files byte-wise, a simple COPY /B file1+file2+... filetotal would do the trick.
Not applicable. These avis aren't raw streams but have proper headers that would corrupt the stream.

The reason why joining A/V-files yields asynchs was explained several times in this forum.
Don't tell you mean VBR...


@all:
I think the reason ffms2 didn't work well above is the avi encapsulation. Maybe it works better if the ES gets demultiplexed properly beforehand or maybe that non-standard avi streams aren't suitable at all. But that's too much hassle.

Looks like DirectShowSource works best here. Sync and no corrupt 1st frames (like AviSource).

Ghitulescu
3rd September 2010, 08:44
Don't tell you mean VBR...

I mean different frame sizes :) and possible A/V delays that cummulate. VBR (in audio) could be also a cause (not applicable in your case, if the info is correct).