Doc talk:2.6/Manual/Render/Output/Frameserver

提供: wiki
移動先: 案内検索

Using command-line ffmpeg with the frameserver

I thought someone else might find this helpful, but if this doesn't belong on this discussion page feel free to move or delete it.

The sample client for encodedv will work for ffmpeg too. The tricky part is setting the correct ffmpeg input format parameters to accept PPM images from the Blender frameserver over a pipe. One must use -vcodec ppm -f image2pipe and manually specify a framerate with -r.

For example, the follwoing encodes a movie with libtheora at a bitrate of 6000 kb/s:

#!/bin/sh
BLENDER=http://localhost:8080
OUTPUT=/tmp/output.ogv
eval `wget ${BLENDER}/info.txt -O - 2>/dev/null |
    while read key val ; do
      echo R_$key=$val  
    done`
i=$R_start
{
  while [ $i -le $R_end ] ; do
       wget ${BLENDER}/images/ppm/$i.ppm -O - 2>/dev/null
       i=$(($i+1))
  done
} | ffmpeg -vcodec ppm -f image2pipe -r $R_rate -i pipe:0 -b 6000k -vcodec libtheora $OUTPUT
wget ${BLENDER}/close.txt -O - 2>/dev/null >/dev/null

--zagaeski 21:14, 19 June 2011 (UTC)