PDA

View Full Version : encoding mpeg4 with x264


Lele-brz
17th July 2007, 12:04
Hi all,
I'm trying to encode an mp4 container with mpeg4 as video track and aac as audio, I'm using x264 and I noticed that the result has a non deterministic behaviuor, I mean sometimes the x264 cannot converge and the result has a lower bitrate than the one specified.

The thing is that if I run several times the encoding without changing anything I don't get all the time the result I need.

Has anyone some idea about that?
Could it be connected to the threads "auto" parameter?
Or to the profile, I'm using a Baseline profile?

thanks for any help

bye

mitsubishi
17th July 2007, 12:44
Are you saying that if you run the same parameters on the same source you get different results?

Can you give full details of the source and post your command lines.

Dark Shikari
17th July 2007, 13:41
Are you using --non-deterministic by any chance? :p

Lele-brz
17th July 2007, 13:45
thanks for answering,

here's the details (I use ffmpeg -i to get them, is something better?)

Container: mp4

Duration: 1min 5 sec

bitrate 895 kb/s

videotrack : mpeg4, yuv420p, 320x240, 25.00 fps
audio: aac, 44100 Hz, stereo

I encode through an avisynth script:
DirectShowSource("filename")
ConvertToYV12()

And two pass x264 (just the latest build 664)

--pass 1 --bitrate 410 --no-cabac --progress --no-psnr --subme 1 --analyse none --me dia --ref 1 --threads auto

--pass 2 --bitrate 410 --no-cabac --analyse p8x8,b8x8,i4x4,p4x4 --subme 6 --progress --no-psnr --threads auto

Then on some occasions I get the bitrate of the encoded aroun 190 kb/s

Manao
19th July 2007, 18:42
I paste the answer I gave on x264's ML :

DirectShowSource isn't deterministic ( for example, some decoders adapt the post processing to the local CPU usage - WMV/VP6 decoders do that )

akupenguin
19th July 2007, 18:56
It may be true that the WMV VfW decoder is deterministic and the directshow decoder isn't, but that's entirely up to the implementation. There's nothing stoppnig a VfW decoder from looking at the cpu usage. More to the point, DirectShowSource doesn't always return the right frame.

Manao
19th July 2007, 19:10
It may be true that the WMV VfW decoder is deterministic and the directshow decoder isn't, but that's entirely up to the implementation. There's nothing stoppnig a VfW decoder from looking at the cpu usageIndeed, but VfW is more often that not used in an editing context, requiring deterministicity and not necessarily realtime, while DirectShow is mostly used for playback, where realtime is what matters most.

More to the point, DirectShowSource doesn't always return the right frameThat is definitely true when attempting to seek, but I'm not aware of any issue when no seeking are done, which seems to be the case for him.

Lele-brz
20th July 2007, 10:59
Could it be connected to the fact that I've installed also Nero Codes?

Is there another way you can suggest me to encode mp4 for video with x264?

thanks again

Manao
20th July 2007, 11:38
Use ffmpegsource with avisynth ( see the thread on the avisynth-dev forum )

Lele-brz
20th July 2007, 14:42
Thanks a lot!!!
I tried that and it's great, anyway I think the problem I have could be connected to the Nero Codec I installed.