将 ffmpeg 与 xvfb 一起使用会呈现屏幕的裁剪版本 [英] Using ffmpeg with xvfb renders a cropped version of the screen

查看:51
本文介绍了将 ffmpeg 与 xvfb 一起使用会呈现屏幕的裁剪版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm using the following command to render a video of a chrome browser running inside a virtual frame buffer (using xvfb):

ffmpeg -f x11grab -i :5 -s `DISPLAY=:5 xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -r 30 tests.mpg

When I omit the DISPLAY=:5 xdpyinfo | grep 'dimensions:'|awk '{print $2}', it will render at about 1024x768, so I invoked xdpyinfo to get the resolution of the display and tell ffmpeg about it.

But when I use the command, it shows the same cropped area, only stretched to fit the resolution I gave ffmpeg.

I would like to be able to record the whole virtual frame buffer without cropping or stretching. Is there a way to do so?

I have compiled ffmpeg from source just this morning, running v2.8.git

解决方案

The arguments that come after -i control the output, not the input.

To set the source resolution use -video_size with the xdpyinfo output before the -i. For the framerate use -framerate.

The format for the x11grab input is [hostname]:display_number.screen_number[+x_offset,y_offset].

ffmpeg -video_size `DISPLAY=:5 xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -framerate 30 -f x11grab -i :5.0+0,0 output.mpg

Check the docs and the guide: https://trac.ffmpeg.org/wiki/Capture/Desktop

这篇关于将 ffmpeg 与 xvfb 一起使用会呈现屏幕的裁剪版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆