Is there a way to write a video stream to serial com port (i.e. com3, 19200 BAUD) with the gsteamer / gst-launch on a Windows machine ?
pseudo: gst-xxxxx-1.0.exe -v videotestsrc pattern=snow ! video/x-raw,width=320,height=240 ! filesink location=Com3
Clear: On Windows the Com ports are no files in the filesystem.
BR Joe
I'm trying to share my computer's camera with the remote computer. Local machine is linux(ubuntu 20.04.1) and remote machine is windows 10. I created virtual camera in windows machine with use OBS virtual cam and I want to share camera from local to remote machine. I could start stream from local linux machine and I got stream via windows machine. But when I try to write the stream into the virtual camera(output device), I get the error av_interleaved_write_frame (): Operation not permitted.
The command I wrote on the Windows side is as follows:
ffmpeg.exe -f mpegts -i udp://192.168.5.5:5010 -c:v rawvideo -r 30 -pix_fmt yuyv422 -s 1280x720 -f sdl "OBS-Camera"
The error message is as follows:
Extra Info1: In my experiments, if both the local and remote machines are Linux, it works successfully.
Extra Info2: I can view the stream that I received on windows side(remote) with the command ffplay.exe udp: //192.168.5.5: 5010.
Do you have any suggestion ?
The question pretty much says it all. I basically want to create a driver that is compatible with my current MacOS (Catalina). The issue I'm facing is that my printer (with scanner) currently will only scan pages and print them out. I'd like to be able to use my scanner to save an image of a scanned document.
I'm honestly not sure if writing a driver is the best way to do this but the manufacturer (Canon) no longer has drivers for this old scanner. But it works just as well as the day we got it so I REALLY don't want to have to toss this one out and buy a new one.
UPDATE: currently stuck with the following:
rabdelazin#rabdelazim Downloads % device=$(sane-find-scanner | awk '/Canon/{print $NF}')
rabdelazin#rabdelazim Downloads % echo $device
libusb:020:029
rabdelazin#rabdelazim Downloads % scanimage --device Canon:$device -x 210 -y 297 --mode color --resolution 240 --format=tiff --depth 8 > ~/Downloads/scan.tiff
scanimage: open of device Canon:libusb:020:029 failed: Operation not supported
I have an EPSON Perfection 4990 Photo on macOS, so I cannot give you full code and examples for your Canon but it may get you started. I spend my life in Terminal rather than using GUIs for anything so I just scan the full area of the platten at full resolution and do whatever I need later with ImageMagick or Photoshop if necessary.
So, to get it going I installed homebrew from here. Then I installed some packages:
brew install libusb
brew install sane-backends
Then I can find my scanner with:
sane-find-scanner
Sample Output
found USB scanner (vendor=0x04b8 [EPSON], product=0x012a [EPSON Scanner]) at libusb:003:002
Now you need the last word on that line, the libusb:003:002 part, with my EPSON, I use:
sane-find-scanner | awk '/EPSON/{print $NF}'
You will need to see what you get, and adapt slightly.
SampleOutput
libusb:003:002
So, in order to scan, I capture that in a bash variable called device and do this:
device=$(sane-find-scanner | awk '/EPSON/{print $NF}')
scanimage --device epson:$device -x 210 -y 297 --mode color --resolution 240 --format=tiff --depth 8 > ~/Desktop/scan.tif
I put the whole lot in a bash script called scan like this:
#/bin/bash
TMP="$HOME/Desktop/scan.tif"
# Find libusb device name
device=$(sane-find-scanner | awk '/EPSON|HP/{print $NF}')
if [ -z $device ]; then
echo ERROR: Unable to find libusb device
exit 1
fi
echo Found scanner at: $device
# Now scan full-size, colour, hi res
scanimage --device epson:$device -x 210 -y 297 --mode color --resolution 240 --format=tiff --depth 8 > "$TMP"
# Check we got a file
if [ ! -s "$TMP" ]; then
echo ERROR: Empty scan
exit 1
fi
My script has some further, optional, ImageMagick stuff at the end to create a Web-usable JPEG, if you add this you will need to do:
brew install imagemagick
Then add this to the script above:
# Copy the file to User's Desktop and number nicely...
# ... save as hi-res 16-bit TIF
# ... and medium res, medium quality JPG for web use
cd ~/Desktop
i=0
while :; do
base=$(printf "scan-%03d" $i)
if [ ! -f "${base}.jpg" ]; then
cp "$TMP" "${base}.tif"
convert "$TMP" -resize 2000x2000 -quality 85% "${base}.jpg"
break
fi
((i++))
done
Here are a couple of resources I found helpful when working it all out. You can debug the scanimage program with:
SANE_DEBUG_SNAPSCAN=128 scanimage -L
This resource was useful.
You can get help like this:
scanimage --help -d epson
Note that you may also be able to use a Raspberry Pi or similar small, low-cost Linux machine as a "scanner server". Basically you would attach your scanner via USB to the Raspberry Pi and run SANE on the Raspberry Pi. Once you get it working, you could run saned which is a daemon service, on the Raspberry Pi, that listens on the network for other devices (such as your Mac) making requests to scan. It does the scan, using its Linux SANE drivers and delivers the image back over the Ethernet to the Mac (or other) client. I know you dislike this option, but there may be future readers...
Keywords: macOS, OSX, scan, scanner, scanning, EPSON, Canon, HP, libusb, SANE, sane-backends
Well after a LOT of trial and error, I've finally come up with a solution.
TL;DR: I made a print server out of a raspberry-pi and installed cups and set the printer to be shared through the server. Works like a charm!
It took quite a bit of investigation but as part of reviving an old laptop, I got it running by installing Ubuntu 20.04. Just for kicks I decided to try and print something from the laptop. I had to install CUPS and maybe a few other packages but it worked. That got me thinking that I should just make a print server that knows how to talk to the printer so all the other machines can come and go but my printer should still work.
I have an android device (simulated with Genymotion on top off virtualBox) on my host computer(ubuntu).
which interface I should capture to have both incoming and outgoing traffic of android devices?
Download tcpdump for android from here: https://www.androidtcpdump.com/android-tcpdump/downloads
Use the following commands to setup all the things.
adb root
adb remount
adb push ./tcpdump /system/xbin/tcpdump
ToUse:
adb shell
tcpdump -D
tcpdump -vv -i any -s 0 -w /sdcard/dump.pcap
adb pull /sdcard/dump.pcap .
Then analyze the pcap file in Wireshark if you want.
This answer might help https://stackoverflow.com/a/48062718/20107. It's using Wireshark but it should be easy to adapt to tcpdump.
I tried to capture using the below command in WSL Ubuntu.
moauris#AUR00101:~$ /pp/nmon/nmon -s 60 -c 1440 -f -m /mnt/c/Perf_data/
It was supposed to run as a process until 1440 captures, but it did not. It ran and immediately end.
Please guide me to the correct way to capture nmon, or it cannot be done in WSL? Thanks!