Command line cross plaftorm screen recording & conversion to FLV - screen-capture

My goal is very simple - use a command line (standalone exe) that can record desktop activities & dump out a compressed FLV file. I looked at http://camstudio.org/blog/camstudio-command-line-v01-released but there are couple of problems with it - 1) it windows only & 2) I couldn't figure out how to dump our flv instead its output was a huge avi file even for a 30 second session.
Is there a software that allows interaction with it through command line (so that I don't have to bring up a GUI) and work on at least Mac & Windows?

Related

pyaudio generating blank .wav files

import pyaudio
import wave
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "output.wav"
p = pyaudio.PyAudio()
stream = p.open(format=FORMAT,
channels=CHANNELS,
rate=RATE,
input=True,
frames_per_buffer=CHUNK)
print("* recording")
frames = []
for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):
data = stream.read(CHUNK)
frames.append(data)
print("* done recording")
stream.stop_stream()
stream.close()
p.terminate()
wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb')
wf.setnchannels(CHANNELS)
wf.setsampwidth(p.get_sample_size(FORMAT))
wf.setframerate(RATE)
wf.writeframes(b''.join(frames))
wf.close()
# close PyAudio (7)
p.terminate()
The output.wav file is generated successfully wih a size of approx. 881KB. However, when I play it, it's blank.
Currently, I'm trying to record audio through the built in microphone of my MacBook Pro.
Can someone help me with this?
Turns out that this has to do something with the OS.
I tried executing the same thing on an Ubuntu machine and it worked. On macOS Catalina, it produced blank files.
I'll need to dig a little deeper on macOS to find out what the issue is.
I had the same problem too and it will work if you grant Terminal access to your microphone!
If Terminal isn't showing up in the System Preferences list for microphone permissions and it hasn't requested permission (a problem on Mojave/Catalina), open it by:
open /System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal
Then run a program that uses the mic e.g.
sox -d -d
(Note: You will need to install SoX. This specific command will let you hear your mic input. You could also use pyaudio, FFmpeg, ecasound etc.)
That should trigger it to request. If that didn't work try running the command on a different command line e.g. iTerm2. This is a problem and solution very similar to the one for Audacity on Catalina. I'm not sure what the exact cause is though.

chrome "aw, snap" crash, but can't see crash log in chrome://crashes but see DMP generated, so what is the quickest way to interpret this DMP file

I can see my page get crash(see aw, snap page) with 20% proprobility after 10 mins(otherwise it runs well like forever)
so I tried:
1) CPU and memory check with task manager, and see no increasing(so no leakage).
2) enable crush log in the chrome://settings/
result:
2.1) see still nothing in the chrome://crashes page, not even a crush ID (0 crashes).
2.2) see nothing in the folder under path
C:/%User%/AppData/Local/Google/CrashReports (nothing in) nor
C:/%User%/AppData/Local/Google/Chrome/User Data/Crash Reports (folder not exist)
2.3) but indeed see DMP in the:
C:/%User%/AppData/Local/Google/Chrome/User Data/CrashPads/reports
but seems they are not readable, and it also seems not the correct address for crash logs
3) can get chrome log either by command line arguments, or using sawbuck, but found nothing but only 2 errors, one for sawbuck itself, and another saying can't send the report to google.
So the questions are:
1) are those DMP the crash logs(the default Dir for dump file has been changed for chrome v50)
2) how can I abstract information out of the DMP file, if chrome://crashes page shows nothing (for chrome on windows)
p.s. 2 usage pages are found at https://www.chromium.org/developers/decoding-crash-dumps
https://www.chromium.org/developers/crash-reports
but seems it's not for windows without a recompile of chrome's component, is there any 3rd party tools to interpret the DMP file?
env informations:
chrome version: 50.0.2661.02 m
; Host OS: windows 10
The crash dumps (.dmp files) in C:\Users\<user>\AppData\Local\Google\Chrome\User Data\Crashpad\reports can be read by standard Windows debuggers. WinDbg is one tool (provided by Microsoft) for analysing these dumps; it's not going to win any beauty contents, but it's powerful and gets the job done. The recommended way to obtain it is, somewhat bizarrely, the Windows Driver Kit.
You'll need debugging symbols to make sense of the results, and these aren't included in standard builds of Chrome. To get symbols for both Chrome and the Windows runtime, set the following as your Symbols path:
SRV*c:\symbols*https://msdl.microsoft.com/download/symbols;SRV*c:\symbols*https://chromium-browser-symsrv.commondatastorage.googleapis.com
There are numerous resources on using WinDbg on the web; this cheat sheet contains some useful commands to get you started.

Adobe AIR Fullscreen (OS X Mavericks) Menu Bar

I've been searching for a solution for weeks and have yet to find something solid. Not even those "ugly Mac hacks" have worked, so I look to you guys.
Here's the issue: I'm creating a presentation application in Adobe AIR for Desktop in AS3. One window (not fullscreen) controls the presentation, while the other displays it. Each window would be on a separate monitor. I want to be able to make the second NativeWindow fullscreen, but the OS X menu bar remains visible.
Does anyone know how to get around this, without having users disable "Displays have separate spaces" in System Preferences?
There is a workaround:
I decided that, upon first run, I would make a call to an AppleScript script that enables com.apple.spaces spans-displays. Here's that script:
set target to "com.apple.spaces spans-displays"
if ((do shell script "defaults read " & target) is equal to "0") then
set new_value to "TRUE"
do shell script "defaults write " & target & " -bool " & new_value
end if
do shell script "killall -KILL loginwindow &" with administrator privileges
I use a NativeProcess to run /usr/bin/osascript. The parameter should be the native path to your .scpt file.
if you do not use a lot of Adobe AIR functionality you might try to package with MDM's Zinc. Zinc allows you to create "native" self-contained program executables, which are not dependent on AIR or any other framework being installed.

"Learn SQL The Hard Way" - How to Setup Properly for Beginner?

I am a beginner attempting to learn SQL with Zed Shaw's "How to Learn SQL the Hard Way"
In excercise 0: The Set up, he states:
Then, look to see that the test.db file is there. If that works then you're all set.
But when I run the command,
sqlite> create table test (id);
sqlite> .quit
the execution runs, but it doesn't create a test.db file. I looked in the same folder as where the sqlite3.exe file is and I see nothing.
I attempt to see if I can continue without this step, then - In his next exercise, "Excercise 1: Creating Tables":
I input his commands, but when attempting to run sqlite3 ex1.db < ex1.sql, it gives me an error.
I even tried putting the create table command and saving it as a '.sql' file into the same folder as sqlite3.exe.
How can I set this environment up properly? Can someone explain this on an "easy to grasp" level? Any response is appreciated**
Edit 1
I'm not exactly sure how Zed Shaw how he wants his learners to use SQLite 3, Maybe I can go into some research but I just don't understand why he leaves such a large gap of assumption that everyone knows what to do for the set up process...
I had this exact problem. I am using windows 7.
From this website: http://www.sqlite.org/download.html
I used the:
"sqlite-tools-win32-x86-3130000.zip
(1.51 MiB) A bundle of command-line tools for managing SQLite..."
under the "Precompiled Binaries for Windows" heading.
My helper directed me to open the file named "sqlite3" after I'd extracted the files from the zip file. It brought up a black window, in the command line style, showing some text, and then the familiar sqlite> prompt.
Then he had me input:" .save data_base_name.db " (I chose to have my database be named 'thedatabase'.)
which created a file in the same folder as the sqlite3 file, called "data_base_name" as a "Data Base File".
That's where I'm at so far, I'll post updates as I have them.

Why does a file checked into CVS become double-spaced?

Problem
Frequently (but not every time) when using CVS to check in files like: .java, .cs, .xml, etc, every line of the file is gets a carriage return.
Example:
File before check-in by a team member:
// Begin file
class Foo
{
public Foo()
{
// Do step 1
// Do step 2
}
}
// End file
File when checked out by a team member:
// Begin file
class Foo
{
public Foo()
{
// Do step 1
// Do step 2
}
}
// End file
Development Environment
NetBeans 6.8 and now 6.9 (the problem occurred when using 6.8 as well).
Visual Studio 2008 and 2010.
Repository: CVS; checkins and checkouts done from Cygwin bash shell.
Operating system: Widows XP Professional.
What I Have Tried
I tried changing the value: build.compiler.emacs=true within NetBeans under Tools->Options, thinking this might be causing some kind of Unix/Windows translation problem when checking in? This made no difference.
Am I missing something about what happens to a file when it gets checked into CVS in a Windows/IDE/Cygwin stack that can cause this problem?
Something is converting DOS line breaks (CR LF) to pairs of Unix line breaks (just LF). I would personally bet on its being CVS. You might want to try using TortoiseCVS instead of Cygwin CVS.
A Windwos-native CVS client will convert MS-DOS line endings in a text file (\r\n) to Unix-style line endings when submitting the file to the server, so that in the repository, the files are maintained in a 'canonical' form with \n representing a line ending. When Windows native client will also convert the line ending when bringing a file down from the server.
However, I believe that the default Cygwin CVS client acts like a Unix client and assumes that no line ending conversion is required. So if you use that client to check in a file with MS-DOS-style endings (\r\n), you'll get this kind of confusion.
It looks like the people who are using the Cygwin client are using tools that care converting the files to MS-DOS style line endings (or something is).
A potential fix is to uninstall the Cygwin CVS client and install the WinCVS client on your Windows/Cygwin boxes so the Windows native client will be used even when a Cygwin shell is active:
http://www.dehora.net/journal/2003/07/a_fix_for_cygwin_and_cvs_linefeeds.html
Another possibility to to configure your Cygwin mounts under a specific mode (but I'm not really familiar enough with Cygwin to know how well this works or if it might introduce otehr problems - it's been a long time since I've tried using Cygwin):
http://www.gigascale.org/softdevel/faq/23.html
Another possibility that I just ran into - if the file was saved in Unicode format but stored in CVS as ASCII/Text, extra line terminators will be added.