-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntuCommands
35 lines (28 loc) · 1.72 KB
/
ubuntuCommands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
1. Convert images to a video via ffmpeg
Example: ffmpeg -framerate 4 -i 000%3d.jpg -vcodec mpeg4 -b 800k output.mp4
Detail: https://trac.ffmpeg.org/wiki/Slideshow
The output video may be blured compared to the original images, here is a solution: https://stackoverflow.com/questions/3158235/image-sequence-to-video-quality
2. Capture a video on ubuntu via ffmpeg
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 15 -s $(xdpyinfo|grep 'dimensions:'|cut -c14-26) -i :0.0+0,0 -acodec flac -vcodec mpeg4 -qscale 0 -y ~/out.mkv ;
ffmpeg -video_size 1024x768 -framerate 25 -f x11grab -i :0.0+0,0 -f alsa -ac 2 -i hw:0 -qscale 0 output.mkv;
3. Check CPU info, including supported instructions
cat /proc/cpuinfo
4. Timing a terminal command
Add time before the command you want to measure.
5. Script that copies *0002.jpg and *0001.jpg in any folder if *0002.jpg exist in that folder.
for file in ./* ; do
if find ./$file -name "*0002.jpg"|grep -q . ; then #find always returns true, so add grep
echo "Copying files in $file."
cp ./$file/*0002.jpg ./lfw_test
cp ./$file/*0001.jpg ./lfw_stored
else
echo "Only one file found in directory $file."
fi
done
6. Find available versions for tensorflow
curl -s https://storage.googleapis.com/tensorflow |xmllint --format - |grep whl
https://stackoverflow.com/questions/40416056/how-to-download-previous-version-of-tensorflow
7. Record video on ubuntu via gifine
(straightforward install)Read readme on how to install https://github.com/leafo/gifine
Note: 1. When save to a file(*.mp4/*.gif), you need to write the full name with mp4/gif, otherwise you won't get the record video.
2. When save a to file, pay attention to the framerate, the default is 60, which is different than the record framerate.