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?
I don't know if you have fixed this bug but if you haven't let me help out because I ran into same issue. Here's a solution (I'm running on Fedora 30):
Your need to Configuring Xorg as the default GNOME session. On your terminal open your custom.conf by typing the this command sudo nano /etc/gdm/custom.conf and uncomment WaylandEnable=false if it's commented but must be set to false
Then, on the [daemon] section just under WaylandEnable=false add this line DefaultSession=gnome-xorg.desktop and save the file. Then try running your Screen Recorder program again.
Congratulations.
However, if nano command is not working please try installing it by running the command
sudo dnf install nano or sudo apt-get install nano which ever works for you.
Related
I have been working through some i2c examples. Plugging it all together and I find that I need to install the i2c-tools package, then use raspi-config to enable the I2C system.
The wiringPi gpio command has a shortcut to the i2cdetect command and running it gives
Before 3 weeks everything working properly, detected 68. I didn't understand what is the problem !!! Can anyone one help me to solve this issue.
The I2C bus allows multiple devices to be connected to your Raspberry Pi, each with a unique address, that can often be set by changing jumper settings on the module. It is very useful to be able to see which devices are connected to your Pi as a way of making sure everything is working.
To do this, it is worth running the following commands in the Terminal to install the i2c-tools utility.
sudo apt-get install -y python-smbus
sudo apt-get install -y i2c-tools
If you're not using a modern Raspbian or you want to do it by hand, you can! Open LXTerminal or console or ssh and enter the following command:
sudo nano /etc/modules
and add these two lines to the end of the file:
i2c-bcm2708
i2c-dev
Then save the file with Control-X Y
Depending on your distribution, you may also have a file called /etc/modprobe.d/raspi-blacklist.conf
If you do not have this file then there is nothing to do, however, if you do have this file, you need to edit it and comment out the lines below:
blacklist spi-bcm2708
blacklist i2c-bcm2708
.. by putting a # in front of them.
Open an editor on the file by typing:
sudo nano /etc/modprobe.d/raspi-blacklist.conf
If you are running a recent Raspberry Pi (3.18 kernel or higher) you will also need to update the /boot/config.txt file. Edit it with sudo nano /boot/config.txt and add the text
dtparam=i2c1=on
dtparam=i2c_arm=on
at the bottom. note that the "1" in "i2c1" is a one not an L!
Once this is all done, reboot!
Now when you log in you can type the following command to see all the connected devices
sudo i2cdetect -y 1
Note that if you are using one of the very first Raspberry Pis (a 256MB Raspberry Pi Model B) then you will need to change the command to:
sudo i2cdetect -y 0
Try sudo i2cdetect -y 1 or sudo i2cdetect -y 0 (if you using old Raspberry Pi) and run it on root. Open terminal and run command sudo su, then run sudo i2cdetect -y 1
Ok everyone, here is an issue which bugged me for quite some time now:
I am trying to run a bash script, which stores certain values in variables, and then starts another command in a detached session, so that the script can continue running because the command takes ages to finish. That's all fine and nice, but the problem is that the command which should be run in the detached session contains variables. This is not a problem when using screen as the "session manager" (or whatever you want to call a program doing session management):
read -p "Session name:" sessionname
read -p "Filename:" filename
screen -S "$sessionname" -d -m nano "$filename"
works fine, opening nano in the detached screen as expected. But when i re-attach to the session and close it, my terminal is cleared and sometinmes some of the text from the file is barfed right before my cursor. I realized that this is an issue with how screen works, so i decided to switch to tmux, but now a whole new realm of prblems opens:
tmux new-session -d -s "$sessionname" nano "$filename"
works fine on cygwin, but on my raspberry 2b running raspbian jessie it throws this error:
usage: new-session [-AdDp] [-c start-directory] [-F format] [-n window-name] [-s session-name] [-t tar
get-session] [-x with] [-y height] [command]
and trying tmux ls afterwards to see if anything started gives me this on the raspberry:
failed to connect to server: No such file or directory
while on cygwin, if no sessions are running, it gives me this:
no server running on /tmp/tmux-197609/default
How can it be that tmux on two different plattforms behaves conmpletely different? Have i installed it wrong on the raspberry (sudo apt-get install tmux) ?
I am all out of ideas what might be the problem here, so any help is greatly appreciated. (Sorry for confused spelling & grammar, non-native english speaker here)
I am trying to run install maven in my Docker image using this command:
RUN wget --no-proxy --no-verbose -O /tmp/apache-maven-3.2.2.tar.gz http://archive.apache.org/dist/maven/maven-3/3.2.2/binaries/apache-maven-3.2.2-bin.tar.gz
But it just hangs in the command line terminal. No output, nothing after that. I don't even get prompted to enter another command in the shell until I hit ctrl + C.
EDIT 1: I tried running the command with --no-proxy and this was the result once again:
root#2ff7e62d1e7c:/# wget --no-verbose -O /tmp/apache-maven-3.2.2.tar.gz http://
archive.apache.org/dist/maven/maven-3/3.2.2/binaries/apache-maven-3.2.2-bin.tar.
gz
2015-08-16 17:19:07 URL:http://archive.apache.org/dist/maven/maven-3/3.2.2/binar
ies/apache-maven-3.2.2-bin.tar.gz [6940967/6940967] -> "/tmp/apache-maven-3.2.2.
tar.gz" [1]
I also get the above output, even after running wget without --no-proxy
EDIT 2: Ok it did download the file (I think), but it's in a red color?
apache-maven-3.2.2.tar.gz
IS in /tmp/apache-maven-3.2.2.tar.gz on the container, but its in a red color?
EDIT 3: Ok the wget worked I just had to run it a few times. I'll leave this question up in case others may find it useful.
I'm running Ubuntu 14.04 LTS trusty on a Dell Dimension M6500 and try to get 2 monitors automatically positionned.
Graphic card: Quadro FX 2800M
NVIDIA Driver Version:331.38
I put the line
xrandr --output DP-0 --left-of LVDS-0
which works as a command line in various files: .profile, .xsession, .xinitrc, /etc/X11/Xsession.d/45custom_xrandr-settings
put a sleep 2 before, tried to launch it via batch
the lines
xrandr -q >> xrandr.log
xrandr --output DP-0 --left-of LVDS-0&
xrandr -q >> xrandr.log
work in the .profile file and show that the re-positionning occured but went back before I can see anything !
Any ideas ?
I know this is a bit old, but I found this post while looking for the solution myself, so I thought I'd help.
Make a script called setup_monitors in /usr/bin/ and do sudo chmod +x /usr/bin/setup_monitors
Add this to setup_monitors
#!/bin/sh
# you might want to uncomment the following line or
# something like it as well
# xrandr --output DP-0 --mode 1920x1080 --noprimary --pos 1920x0
xrandr --output DP-0 --left-of LVDS-0
Then in your /etc/lightdm/lightdm.conf add the following:
display-setup-script=/usr/bin/setup_monitors
Restart your desktop environment (logout/restart computer), and it should work.
I have a simple container that looks like this:
FROM devbox/rails3.2.1
RUN apt-get install -y -q libmysql-ruby libmysqlclient-dev
RUN apt-get install -y -q libqtwebkit-dev
EXPOSE 3000
CMD /bin/bash
where devbox/rails3.2.1 is a container I made that starts with 'FROM ubuntu' and installs Ruby on Rails. This is a running in a Vagrant Virtual Box VM using Ubuntu 12.04.3 LTS. When I run this using:
docker run -t -i -name myapp -p 3000:3000 -v /src/myapp:/src/myapp -link myappsql:myappsql devbox/myapp
The container starts, but my terminal shows a blank line with no prompt and typing doesn't do anything. If I run docker ps I can see that the container is running. Even stranger, If I open a second terminal and run 'docker attach myapp' I get a functioning terminal (though I have to press enter first) and if I switch back to my first terminal and type, the output appears in my second terminal!
Any help much appreciated.
That all sounds like expected functionality.
When doing the "docker run" command put the "/bin/bash" in it to immediately have the bash available to you without having to attach first.
docker run -t -i -name myapp -p 3000:3000 -v /src/myapp:/src/myapp -link myappsql:myappsql devbox/myapp /bin/bash