Got black screen when recording screen from xvfb by ffmpeg x11grab device

Posted by shawnzhu on Super User See other posts from Super User or by shawnzhu
Published on 2014-03-11T02:20:11Z Indexed on 2014/06/07 15:28 UTC
Read the original article Hit count: 673

Filed under:
|

I'm trying to record video from a firefox run by xvfb-run but it always output nothing in the video file except black screen.

Here's what I did:

start a firefox, open google.com:

$ xvfb-run firefox https://google.com

Then it will use the default display server number 99. I can see the display information by command xdpyinfo -display :99.

A screenshot works very well by command:

$ xwd -root -silent -display :99.0 | xwdtopnm |pnmtojpeg > screen.jpg

Start using ffmpeg to record a video:

$ ffmpeg -f x11grab -i :99.0 out.mpg

When I play the video file out.mpg, there's black screen all the time.

Is there any parameter I missed?

Updates

I made progress that the video works instead of black screen only by this command:

$ ffmpeg -y -r 30 -g 300 -f x11grab -s 1024x768 -i :99 -vcodec qtrle out.mov

Notice it requires the screen resolution matches by specify more options to xvfb-run:

$ xvfb-run -s "-screen 0 1224x768x16" -a firefox http://google.com

But I still want to get more feedbacks and answers here.

© Super User or respective owner

Related posts about ffmpeg

  • how to install ffmpeg in cpanel

    as seen on Super User - Search for 'Super User'
    i'm using dedicated server(linux) so i need to install ffmpeg in cpanel so here ffmpeg i found in Main Software Install a Perl Module but i writing script in php so how can i install ffmpeg phpperl when i'am trying to install ffmpeg in perl module i get this response Checking C compiler… >>> More

  • FFMpeg-PHP Installation Error

    as seen on Server Fault - Search for 'Server Fault'
    While installing FFmpeg-PHP, I got this interesting error: /usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function 'zim_ffmpeg_movie_getAudioStreamId': /usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1051: error: 'CODEC_TYPE_AUDIO' undeclared (first use in this function) /usr/downloads/ffmpeg-php-0… >>> More

  • git problems installing stuff [closed]

    as seen on Super User - Search for 'Super User'
    root@Frenzen:~# cd root@Frenzen:~# git clone --depth 1 git://source.ffmpeg.org/ffmpeg Initialized empty Git repository in /root/ffmpeg/.git/ root@Frenzen:~# cd root@Frenzen:~# git clone --depth 1 git://source.ffmpeg.org/ffmpeg Initialized empty Git repository in /root/ffmpeg/.git/ root@Frenzen:~#… >>> More

  • Unable to install ffmpeg-php

    as seen on Server Fault - Search for 'Server Fault'
    I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0… >>> More

  • Unable to install ffmpeg-php

    as seen on Server Fault - Search for 'Server Fault'
    Hi, I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0… >>> More

Related posts about xvfb