PDA

View Full Version : Delay after x264 encode, warning by encoder


me7
11th November 2008, 20:52
I just transcoded a movie from 720p to PAL with x264. The input file was h264 muxed into a mkv container and passed to the x264 via AviSynth (including resize) and decoded with ffdshow.
At the start of the encode, x264 told me this:

mp4 [info]: initial delay 208542 (scale 2500000)

The resulting file is out of sync with the untouched audio from the original file. Can I use this info to calculate the delay to reverse it while muxing?

me7
12th November 2008, 21:31
Does no one know what this message means?

nurbs
12th November 2008, 21:53
IIRC Dark Shikari posted once and explaination. Maybe you can find it if you use search. I doubt that you can use it to fix your problem. You should post more details like your avs script and what the source is because it's impossible to tell what your problem is with the information you posted.

Avenger007
12th November 2008, 22:01
I just transcoded a movie from 720p to PAL with x264. The input file was h264 muxed into a mkv container and passed to the x264 via AviSynth (including resize) and decoded with ffdshow.
You need to clarify where you got the source before anyone can help you.

me7
12th November 2008, 22:03
The source is a mkv file containing a x264 encoded movie at high bitrate and resolution (with several audio and subtitle tracks). I want to downscale it to a CRF 19 encode at PAL resolution.

The script is very simple: DirectShowSource("C:\encode\Hot Fuzz.mkv",fps=23.9759856527702,audio=false)
#deinterlace
#crop
LanczosResize(704,436) # Lanczos (Sharp)
#denoise


It is demuxed by Haali splitter and decoded by ffdshow.

LoRd_MuldeR
12th November 2008, 22:25
Did you try FFVideoSource() (http://forum.doom9.org/showthread.php?t=127037) as an alternative to DirectShowSource() yet ???

me7
12th November 2008, 22:49
I just tried it but I get an error. I downloaded FFmpegSource2, put the "FFMS2.dll" and "ffmsindex.exe" into my Windows\system32 folder and changed the first line of the avs script to FFVideoSource(<inputfile>). AviSynth doesn't seem to like it: avis [error]: unsupported input format (DIB )
x264 [error]: could not open input file 'video.avs'

LoRd_MuldeR
12th November 2008, 22:51
I just tried it but I get an error. I downloaded FFmpegSource2, put the "FFMS2.dll" and "ffmsindex.exe" into my Windows\system32 folder and changed the first line of the avs script to FFVideoSource(<inputfile>). AviSynth doesn't seem to like it: avis [error]: unsupported input format (DIB )
x264 [error]: could not open input file 'video.avs'

Not Avisynth. But x264 doesn't like the colorspace. Append "ConvertToYV12()" to the end of the script.

me7
12th November 2008, 22:54
I did, no change. Here's how the script looks now:
FFVideoSource("C:\encode\Hot Fuzz.mkv")
#deinterlace
#crop
LanczosResize(704,436) # Lanczos (Sharp)
#denoise
ConvertToYV12()
Resultavis [error]: unsupported input format (DIB )
x264 [error]: could not open input file 'video.avs'

LoRd_MuldeR
12th November 2008, 22:57
Are you sure you pass the correct path to "video.avs" to x264? And what happens if you inspect that AVS file in VirtualDub?

For me x264 usually works fine with FFVideoSource() :confused:

me7
12th November 2008, 23:11
VirtualDub doesn't recognize the function "FFVideoSource. Is "Windows\system32" the correct path for "FFMS2.dll" and "ffmsindex.exe"?

LoRd_MuldeR
12th November 2008, 23:15
I have it in my "Avisynth\Plugins" folder. But you can also load it explicitly in your script:

LoadPlugin("C:\Path to FFMS2\FFMS2.dll")
FFVideoSource("C:\encode\Hot Fuzz.mkv")
LanczosResize(704,436) # Lanczos (Sharp)
ConvertToYV12() #usually not needed

me7
12th November 2008, 23:33
It works now (without ConvertToYV12()), the FFMS2.dll was in the wrong folder.
Can I leave all FFVideoSource parameters on default for a 23.976 source?

Avenger007
13th November 2008, 00:34
The source is a mkv file containing a x264 encoded movie at high bitrate and resolution (with several audio and subtitle tracks). I want to downscale it to a CRF 19 encode at PAL resolution.
Encode from the original source to avoid the problems you're experiencing from secondhand encoding.
A matroska file containing an x264 encoded movie can never be considered as the original source.

LoRd_MuldeR
13th November 2008, 00:41
It works now (without ConvertToYV12()), the FFMS2.dll was in the wrong folder.
Can I leave all FFVideoSource parameters on default for a 23.976 source?

If the MKV contains the proper framerate and if FFVideoSource reads the framerate correctly, then yes.

(if the source is VFR, you will need to specify/generate a "Timcode" file though)

me7
13th November 2008, 01:10
Allright then.
Thanks a lot, you saved my day :)