[MEncoder-users] Re: Don't get big-endian output with s16be

Grant Edwards grante at visi.com
Mon Jan 8 21:09:06 CET 2007


On 2007-01-07, Grant Edwards <grante at visi.com> wrote:
> I'm trying to encode video files for playback on a Sandisk
> Sansa e200 series MP3/Video player using mencoder 1.0rc1-3.4.6.
[...]
> The video plays on the Sandisk, but the colors are broken
> because the Sandisk expects YUV422P and the above produces
> YUV420P (I think), but I'm ignoring that for the moment.
[...]
> However, the audio doesn't play at all.  The problem is that
> the file produced above always contains little-endian sound
> data even though I've requested "-format s16be". The resulting
> file is always show by mplayer as s16le (the ID string is
> "sowt" instead of "twos"). So, the Sandisk refuses to play the
> sound.
[...]
> How do I get s16be output?

I've hacked up a partial solution.  

I added a "pcms" output audio codec to libmpcodec which does
byteswapping as it "encodes".  In order to make lavformat happy
(and get the output file tagged correctly), I had to invent a
new wave tag for PCM big-endian.

The resulting .mov file plays on the Sansa (in B/W since the
422/420 problem is still unsolved), but I seem to have an A/V
sync problem. It starts out a couple seconds off, and gets
progressively worse (audio falls behind about 1 second per
minute as the .mov file plays). It plays the same on Sansa,
mplayer, and xine, so it looks like it's an encoding/muxing
problem.

Here's the command I'm using

mencoder -ofps 15 \
         -vf rotate=1,scale=160:208 \
         -ovc lavc -lavcopts vcodec=mjpeg:vbitrate=150:vhq:gray \
         -oac pcms -srate 11025 \
         -of lavf -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames \
         $1 -o $2
         
(with an extra "-ffourcc mjpb" option if I want to play the
file on the Sansa instead of mplayer/xine).  The A/V sync
problem seems to be worse for some input files than for others.
         
-- 
Grant Edwards                   grante             Yow!  Uh-oh!! I'm having
                                  at               TOO MUCH FUN!!
                               visi.com            




More information about the MEncoder-users mailing list