[MEncoder-users] Problem encoding raw video output of mencoder

Bram bram at mencoder.as.avontuur.org
Mon May 19 16:19:47 CEST 2008


Hello,

I've created patch for mencoder/mplayer, which enables the user to
decode audio or video output to a pipe. The patch is applied below. It's
basically derived from the MediaCoder project's mplayer patch, and is
rather straightforward. Apply in the svn root with patch -p0

With this patch applied to the latest svn revision (26838), I tried to
transcode video using pipes. This results in a transcoded video stream,
but the horizontal alignment of the result is wrong:

http://bram.name/~brama/pics/output_shifted.png

In this picture, you can see a sharp vertical black line in the left
side. It seems the X-offset of the picture has shifted a bit to the
right, with the rightmost bit of the picture wrapped around.

How can this offset occur? In the past I've experienced similar
problems, which occurred because there was some garbage prepended to 
the decoded stream. However, with this patch all data that's written to
it should only be the video data and nothing else.

I'm hoping someone here can shed a light on this problem. Other
solutions which allow me to use mencoder/mplayer to decode both video
and audio streams individually to separate files is welcome too.

I've used these commands to do the transcoding:

mkfifo /tmp/videopipe
export IN=/tmp/input.avi
export OUT=/tmp/output.avi
export WIDTH=480
export HEIGHT=360

# start consumer of video pipe first
mencoder /tmp/videopipe -o "$OUT" -ofps 25 -noaspect -demuxer rawvideo -rawvideo fps=25:w=${WIDTH}:h=${HEIGHT}:format=i420 -nosound -ovc xvid -xvidencopts bitrate=800 &

# demux video stream to named pipe
mencoder -quiet -of rawvideo -ovc raw -rawvidopts pipe=6 -ofps 25 -vf harddup,format=i420 -nosound "$IN" -o NUL 6>/tmp/videopipe

wait # waits for encoder background job to complete



Best regards,
Bram
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer_pipes.patch
Type: text/x-diff
Size: 14145 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mencoder-users/attachments/20080519/8613589a/attachment.patch>


More information about the MEncoder-users mailing list