List all services enabled:
service -e
Emptying a log file:
sudo cp /dev/null /var/log/nginx/error.log
Setting keyboard to Spanish .Add this code to .xprofile file:
#!/bin/sh
setxkbmap -layout es
pciconf -lv | grep -A1 -B3 network
ifconfig | grep -B 3 802.11
cat /etc/rc.conf | grep wlan0
cat /boot/loader.conf
cat /etc/wpa_supplicant.conf
sysctl net.wlan.devices
kldstat
https://wiki.freebsd.org/WiFi/FAQ?highlight=%28%5CbCategoryHowTo%5Cb%29
https://www.freebsd.org/releases/13.2R/hardware/
https://man.freebsd.org/cgi/man.cgi?query=iwm&sektion=4&format=html
https://freebsdfoundation.org/freebsd-project/resourcesold/networking-basics-wifi-and-bluetooth/
https://kukunotes.wordpress.com/2020/09/15/freebsd-wireless-networking-static-and-dynamic-ip-configuration/
Tarjeta de red: TP-Link Archer T5E AC 7265 PCIe
Adaptador: iwn(4)
pkg search godot
PKG: https://pkgs.org/download/godot-tools
pkg search vscode
Firefox
Librewolf
Chromium
Ungoogled Chromium
Iridium
https://www.youtube.com/watch?v=mBYor4wL62Q
https://github.com/mrclksr/linux-browser-installer/tree/main
blender, gimp, krita, inkscape, darktable, kdenlive, shotcut, openshot, obs-studio, simplescreenrecorder, audacity, vlc, ffmpeg
freecad, librecad, openscad, solvespace
pkg search <package>: Buscar si package existe en el repositorio
pkg search -f <package>: Buscar información de package en el repositorio
pkg info <package>: Información sobre un package instalado
pkg info: Listado de todos los packages y librerías instaladas.
pkg prime-list: Listado de todos los packages principales instalados.
pkg update: Update the local package respository catalogue
pkg update -f: Update the local package repository catalogue to the Latest branch
pkg upgrade: Upgrade installed packages to the latest version
pkg lock <package>: Lock installed package from reinstallation, upgrading, etc
pkg unlock <package>: Unlock installed package from reinstallation, upgrading, etc
pkg audit -F: Determine if there is a known vulnerability for the software installed in the system
pkg install <package>: Install package
pkg delete <package>: Remove package
pkg autoremove: Auto detect and remove unrequired dependencies
pkg clean: Remove binary packages in cache of latest installed packages
pkg clean -a: Clear the entire cache
Download the ports tree:
sudo git clone https://git.FreeBSD.org/ports.git /usr/ports
Update the ports tree:
sudo git -C /usr/ports/ pull
In GhostBSD, in order to compile any port, you need to first install os-generic-userland-devtools:
sudo pkg install os-generic-userland-devtools
Compile nginx port:
cd /usr/ports/www/nginx
make install clean
Download the nVidia driver:
sudo pkg install nvidia-driver
Run this command to add nvidia-modeset to /etc/rc.conf:
sudo sysrc kld_list+=nvidia-modeset
Create the file /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf with this content:
Section "Device"
Identifier "NVIDIA Card"
VendorName "NVIDIA Corporation"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection
Reboot
Note: You can check the BusID needed by running: pciconf -lv | grep -B3 display
cat /dev/sndstat
dmesg | grep pcm
mixer -f /dev/mixer4
Edit /etc/sysctl.conf:
hw.snd.default_unit=4
If you have installed the nVidia drivers, change the above setting to hw.snd.default_unit=8
geom disk list
geom disk list | grep Mediasize
camcontrol devlist
gpart show
sysctl kern.disks
sysctl -a | less
diskinfo -v ada0
devinfo
usbconfig
webcamd
pciconf -lv
dmesg
ifconfig
apm
cat /etc/rc.conf
cat /boot/loader.conf
cat /etc/sysctl.conf
ls /usr/local/etc/rc.d/
ls /boot/kernel
ls /boot/modules
kldstat
kldunload
kldload
Temperature and fan speed: https://forums.freebsd.org/threads/high-temperature-and-fan-speed.88075/
sysrc nginx_enable=YES
service nginx start
/usr/local/etc/nginx/nginx.conf
After making changes in the configuration file, run the command: sudo service nginx reload/restart
/usr/local/www/nginx-dist/
/var/log/nginx/access.log
/var/log/nginx/error.log
service nginx (start|stop|restart|reload|status|configtest|upgrade|greacefulstop|poll)
Stop web server: service nginx stop
Start server when it is stopped: service nginx start
Stop and start the server again: service nginx restart
If you are simply making configuration changes, you can reload Nginx without dropping any connections: service nginx reload
nginx -V 2>&1 | tr ' ' '\n'
sockstat -4 -l
https://docs.nginx.com/nginx/admin-guide/dynamic-modules/rtmp/
https://github.com/arut/nginx-rtmp-module
After installing Nginx with the RTMP module, you have to load the module. Add the following line at the top of the nginx.conf file (/usr/local/etc/nginx/nginx.conf):
load_module /usr/local/libexec/nginx/ngx_rtmp_module.so;
ffmpeg
Trimming the start and the end of a video file:
ffmpeg -ss 00:08 -to 02:36 -i file1.mkv -c copy file2.mkv
In the above example, if file1.mkv is a 3 minutes long video, the command will trim the first 8 seconds and the last 24 seconds and create file2.mkv wih that time stamps.
IMPORTANT: The above approach will select the closest key frames for the 00:08 time mark and the 02:36 time mark. This means that it will not cut exactly at 00:08 and 02:36. The benefit of this approach is that it will process quickly and will not lose quality.
If you want to ensure the exact time mark, you have to re-encode the file. It will take longer to process and the video file will lose quality. You can make the re-encoding by omitting the -c copy parameter:
ffmpeg -ss 00:08 -to 02:36 -i file1.mkv file2.mkv
Different types of streaming: RTMP live, RTMP VOD, HTTP live, HTTP VOD
https://www.youtube.com/watch?v=t8ebB9Pxb2s
Resize a video to 720 maintaining the aspect ratio
ffmpeg -i sample-3.mp4 -vf "scale=-2:720" sample-3-hd.mp4
Converting mp4 to m3u8 (pre-packaging to HLS using ffmpeg)
ffmpeg -i original-video.mp4 -c copy -copyts -hls_time 6 -hls_playlist_type vod out.m3u8
or
ffmpeg -i original-video.mp4 -codec copy -vbsf h264_mp4toannexb -f segment -segment_list out.m3u8 -segment_time 10 -segment_format mpeg_ts -segment_list_type m3u8 out%04d.ts
Link: https://video.stackexchange.com/questions/23900/ffmpeg-hls-creation-overwriting-master-manifest
Playing m3u8
Move to the directory where the .m3u8 manifest file and .ts files are located and issue this command:
vlc file.m3u8
Converting mp4 to mpd (pre-packaging to MPEG-DASH using gpac (MP4Box)
MP4Box -dash 10000 -rap -out video.mpd -segment-name video_ original-video.mp4
Playing mpd
Move to the directory where the .mpd manifest file and .m4s files are located and issue this command:
vlc file.mpd
Streaming
Move to the directory where you have myvideo.mp4 and issue:
ffmpeg -re -i myvideo.mp4 -vcodec copy -loop -1 -c:a aac -b:a 160k -ar 44100 -strict -2 -f flv rtmp://localhost/live/foo
Converting mp4 to mpd using ffmpeg
To generate a master MPD file for MPEG-DASH streaming from an input .mp4 file using FFmpeg, you can use the following command:
ffmpeg -i input.mp4 -c:v libx264 -b:v 1080k -s 1920x1080 -profile:v high -level 4.2 -g 50 -keyint_min 50 -sc_threshold 0 -b_strategy 0 -c:a aac -b:a 128k -ar 44100 -ac 2 -f dash 1080p.mp4
ffmpeg -i input.mp4 -c:v libx264 -b:v 720k -s 1280x720 -profile:v high -level 4.2 -g 50 -keyint_min 50 -sc_threshold 0 -b_strategy 0 -c:a aac -b:a 128k -ar 44100 -ac 2 -f dash 720p.mp4
ffmpeg -i input.mp4 -c:v libx264 -b:v 480k -s 854x480 -profile:v high -level 4.2 -g 50 -keyint_min 50 -sc_threshold 0 -b_strategy 0 -c:a aac -b:a 128k -ar 44100 -ac 2 -f dash 480p.mp4
ffmpeg -i input.mp4 -c:v libx264 -b:v 360k -s 640x360 -profile:v high -level 4.2 -g 50 -keyint_min 50 -sc_threshold 0 -b_strategy 0 -c:a aac -b:a 128k -ar 44100 -ac 2 -f dash 360p.mp4
This command generates four separate .mp4 files (1080p.mp4, 720p.mp4, 480p.mp4, 360p.mp4) for each version of the input .mp4 file, with a different bitrate and resolution for each version.
The "-i" option specifies the input file, and the "-c:v" and "-b:v" options specify the video codec and bitrate for each version. The "-s" option specifies the resolution for each version, and the "-c:a" and "-b:a" options specify the audio codec and bitrate. The "-f" option specifies the output format, which is set to "dash" for MPEG-DASH streaming.
-------------- ffmepg -------------
HOW TO SPLIT FILE IN 10 SECONDS CHUNKS
Method 1
ffmpeg -i input.mp4 -c copy -map 0 -f segment -segment_time 10 -reset_timestamps 1 -segment_format_options movflags=+faststart out%03d.mp4
Link: https://askubuntu.com/questions/640214/split-a-large-video-file-into-small-clips-15-seconds-each
Method 2
Split file from 0 seconds mark for 10 seconds:
ffmpeg -i input.mp4 -ss 0 -t 10 output-1.mp4
Split file from 10 second mark for 10 seconds:
ffmpeg -i input.mp4 -ss 10 -t 10 output-2.mp4
Split file from 20 second mark for 10 seconds:
ffmpeg -i input.mp4 -ss 20 -t 10 output-3.mp4
----------------------------------
Necessary for playing VLC
sudo pkg install libva-vdpau-driver
Allow play/publish from all or specific domains
https://github.com/arut/nginx-rtmp-module/wiki/Directives#access
Other links:
https://askubuntu.com/questions/35605/splitting-an-mp4-file
https://github.com/c0decracker/video-splitter/tree/master
https://facsiaginsa.com/nginx/build-adaptive-bitrate-vod-server-nginx
https://programming.vip/docs/nginx-builds-rtmp-video-on-demand-live-hls-server.html
https://groups.google.com/g/nginx-rtmp/c/3_dj6vaS9E8
https://itecnote.com/tecnote/nginx-with-rtmp-module-streaming-video-on-demand-with-hls-http/
Maybe this works: https://stackoverflow.com/questions/71868309/hls-based-video-on-demand-vod-streaming-using-nginx-and-rtmp
Interesting links:
https://www.youtube.com/watch?v=lkqp3cQcFLo
https://github.com/leandromoreira/ffmpeg-libav-tutorial
https://slhck.info/ffmpeg-encoding-course
https://amiaopensource.github.io/ffmprovisr/
https://www.astro-electronic.de/FFmpeg_Book.pdf
https://stackoverflow.com/questions/60230868/where-can-i-learn-ffmpeg
`doas` is like `sudo` in Linux. In order to add a user to `doas`, we must allow `keepenv` into the `:wheel` group:
# pkg install doas
# cp /etc/examples/doas.conf /etc
In order to make `doas` more persistent so we don't need to type the root password everytime, we can edit `/etc/doas.conf` so it looks like this:
permit persist keepenv :wheel
$ doas pkg_add lxqt firefox
1. Create `.xsession` file
2. Edit `.xsession` file and add `startlxqt`
1. Find out pendrive device name:
$ doas sysctl hw.disknames
2. Find out information about the pendrive device:
$ disklabel sd1
3. Mounting & unmounting device:
doas mkdir /mnt/pen
doas mount /dev/sd1i /mnt/pen
doas umount /mnt/pen
shutdown -p now