[MEncoder-users] raw dvcpro25 to quicktime compatible mp4-container (aac lc+x264)

Johan Arvidsson johanarv at gmail.com
Tue May 29 11:20:27 CEST 2007


Hi!

I´ve created a script that creates a quicktime compatible file from
raw dvcpro25 material. The source files are from 600 Mb to ~4000 Mb
big (3-20 minutes). If anybody is interested i can post my script but
any real programmer that looks at it will probably cringe :)

I hit a few bumps before i got it working, the official build for
windows from mplayer.hq does'nt work with my files. It only does ten
minutes of the source file and then stops processing it but the
svn-builds i found here http://oss.netfarm.it/mplayer-win32.php works
with files bigger than 2 gb.

I tried the approach in the documentation
(http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-quicktime-7.html) but
i could not create files that worked well with quicktime that way.
What i do now is that i encode audio and video separatly and then i
mux them together with mp4box, audio and video is a little out of sync
but not so much that  it matters.

There are a few things that bugs me and suggestions and tips are
warmly welcomed:

1. I get a few green frames in the beginning of all video files i
create when i play them with quicktime 7.1.6. I wonder if it could be
related to the stats for the first encoded 12 frames in the example
below. Is it something with my source files that is making that happen
or if it is a known bug. I'd be happy to provide samples if anybody is
interested.

Command:  %COMSPEC% /c C:\h264\tools\mencoder-sherpya-070529.exe
C:\h264\source\IN-2007-0328-VASTNYTT19.dv  -o NUL  -ovc x264
-x264encopts pass=1:turbo=2:bitrate=700:bframes=1:me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=25:threads=auto
-nosound -cache 20480 -passlogfile
C:\h264\temp\IN-2007-0328-VASTNYTT19.log -vf yadif,harddup -of
rawvideo -ofps 25 -fps 25  2>radF8171.tmp 1>rad79DF3.tmp
StdOut:  MEncoder Sherpya-SVN-r23404-4.2.0 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Pentium(R) D CPU 3.00GHz (Family: 15, Model: 6, Stepping: 4)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
success: format: 0  data: 0x0 - 0x266e100

libavformat file format detected.
[lavf] Video stream found, -vid 0
[lavf] Audio stream found, -aid 1
VIDEO:  [dvsd]  720x576  0bpp  25.000 fps  28800.0 kbps (3515.6 kbyte/s)
[V] filefmt:35  fourcc:0x64737664  size:720x576  fps:25.00  ftime:=0.0400
Input fps will be interpreted as 25.00 instead.
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [harddup]
Opening video filter: [yadif]
==========================================================================
Opening video decoder: [dshow] DirectShow video codecs
Decoder supports the following YUV formats: YUY2 UYVY
Decoder is capable of YUV output (flags 0x9)
VDec: vo config request - 720 x 576 (preferred colorspace: Packed YUY2)
[PP] Using codec's postprocessing, max q = 4.
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Packed YUY2 as output csp (no 0)
Movie-Aspect is 1.37:1 - prescaling to correct movie aspect.
VideoDecoder::SetExtAttr: registry failure
Selected video codec: [qdv] vfm: dshow (Sony Digital Video (DV))
==========================================================================
Pos:   0.0s      1f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.0s      2f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.0s      3f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.0s      4f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.0s      5f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.1s      6f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.1s      7f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.2s      8f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.2s      9f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.2s     10f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.3s     11f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.3s     12f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.4s     13f ( 0%) 12.88fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.4s     14f ( 0%) 13.55fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.4s     15f ( 0%) 14.27fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.5s     16f ( 0%) 14.86fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.5s     17f ( 0%) 15.53fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.6s     18f ( 0%) 16.07fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.6s     19f ( 0%) 16.73fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.6s     20f ( 0%) 17.20fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.7s     21f ( 0%) 17.81fps Trem:   0min   0mb  A-V:0.000 [0:0]
Pos:   0.7s     22f ( 0%) 18.24fps Trem:   0min   0mb  A-V:0.000 [0:0]
-------------------------------------SNIP--------------------------------------------------------

2. Two pass encoding. In this example the first pass seems to process
the whole file and the last frame is number 30106. But the log-file is
still named divx2pass.log.temp (actually i use another name for the
logfile but i figured if somebody else googles for divx2pass.log.temp
they will find this in the archives and hopefully a good answer too)
so i added a check in my script after the first pass where it looks
for divx2pass.log.temp and if it finds that file it renames it to
divx2pass.log. And it sort of works. It seems like the last chunk of
logs is not written to the logfile before mencoder quits when it is
done with the first pass. With the renamed file i get some errors at
the end of the second pass but the resulting h264 file i can mux with
the audio anyway. I lose about a second of video at the end but it
does'nt matter much. Still it would be nice if it worked :)

>From the logs of the second pass:
x264 [error]: 2nd pass has more frames than 1st pass (30080)
x264 [error]: continuing anyway, at constant QP=28
x264 [error]: disabling adaptive B-frames
x264 [error]: 2nd pass has more frames than 1st pass (30080)
x264 [error]: continuing anyway, at constant QP=28
x264 [error]: disabling adaptive B-frames
x264 [error]: 2nd pass has more frames than 1st pass (30080)
x264 [error]: continuing anyway, at constant QP=28
x264 [error]: disabling adaptive B-frames
Assertion failed: h->frames.b_have_lowres, file encoder/slicetype.c, line 376

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
-------------------SNIP-----------------------------------------------------------------------

3. What is this about:
ty:WARNING - Would have blown my audio buffer

4. If there is a way to keep the interlacing intact and still have
files that is quicktime compatible that would be wonderful. Has
anybody managed to do something like that? x264 is supposed to be able
to encode interlaced material but i haven't figured out how to do it.

Johan Arvidsson



More information about the MEncoder-users mailing list