seq -w 2 19 | while read sayi; do echo $sayi; done;
seq kullanımı
Ocak 28, 2019 § Yorum yok § Kalıcı bağlantı
Veritabanı zaman tespiti
Ocak 28, 2019 § Yorum yok § Kalıcı bağlantı
select CURRENT_TIME;
Veritabanı tablosunu CSV olarak dışarı almak
Ocak 28, 2019 § Yorum yok § Kalıcı bağlantı
copy (select kanal_kimlik_no, kanal_adi from t_kanallar where kayit_yaslandirma_periyodu =365) to '/tmp/365.txt' with CSV;
VLC uzaktan yönetim interfaceleri
Ocak 28, 2019 § Yorum yok § Kalıcı bağlantı
RC interface
Bir makinede
vlc -vvv udp://@224.1.2.249:1234 --quiet --intf oldrc --rc-host localhost:8082 veya cvlc -vvv udp://@224.1.2.249:1234 --quiet --extraintf=oldrc --rc-host localhost:8082
diğerinde ilgili porta komut gönderiyoruz:
echo quit | nc localhost 8082 &>/dev/null
Telnet interfacei ile restream yapmak:
Birinci makinede: cvlc -vvv udp://@224.1.2.249:1234 --quiet --extraintf=telnet --telnet-password=test --telnet-port=9999 --rtsp-host=127.0.0.1 --rtsp-port=9000 ------------------------------------------------- İkinci makinede frk-sk ~ # telnet localhost 9999 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. VLC media player 2.1.6 Rincewind Password: Welcome, Master > new Test vod enabled new > setup Test input udp://@224.1.2.249:1234 setup İkinci makinede birden fazla restream oluturmak için: frk-sk ~ # telnet localhost 9999 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. VLC media player 2.1.6 Rincewind Password: Welcome, Master > new Test vod enabled new > setup Test input udp://@224.1.2.249:1234 setup > new Test2 vod enabled new > setup Test2 input udp://@224.1.2.250:1234 setup restream ederken trancode etmek de mümkün: frk-sk ~ # telnet localhost 9999 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. VLC media player 2.1.6 Rincewind Password: > setup Test output #transcode{vcodec=h264,acodec=mp4a} setup > setup Test mux mp2t setup > setup Test input udp://@224.1.2.249:1234 setup > setup Test enabled setup frk-sk ~ # telnet localhost 9999 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. VLC media player 2.1.6 Rincewind Password: Welcome, Master > new live broadcast new > setup live input udp://@224.1.2.249:1234 setup > setup live output #rtp{mux=ts,sdp=rtsp://:9998/live.sdp} setup > setup live enabled setup -------------------------------------------------------------------------------------------------- Ucuncu makinede: vlc rtsp://127.0.0.1:9000/Test vlc rtsp://127.0.0.1:9000/Test2 vlc rtp://127.0.0.1:9998/live.sdp
Unix socket kullanmak
Birinci makinede frk-sk ~ # cvlc -vvv --quiet --extraintf=oldrc --rc-unix /tmp/test2.sock udp://@224.1.2.249:1234 ikinci makinede komut göndermek için: frk-sk ~ # echo -n "pause" | nc -U /tmp/test2.sock frk-sk ~ # echo -n "play" | nc -U /tmp/test2.sock frk-sk ~ # echo -ne "play" | nc -U /tmp/test2.sock frk-sk ~ # echo -n "pause" | nc -U /tmp/test2.sock frk-sk ~ # echo -n "help" | nc -U /tmp/test2.sock frk-sk ~ # echo -n "title deneme" | nc -U /tmp/test2.sock frk-sk ~ # echo -n "playlist" | nc -U /tmp/test2.sock frk-sk ~ # echo -n "quit" | nc -U /tmp/test2.soc
restream etmek
Ocak 28, 2019 § Yorum yok § Kalıcı bağlantı
vlc udp://@224.1.3.78:1234 multicat @224.1.3.78:1234 172.16.101.131:5000 vlc udp://@172.16.101.131:5000
ffmpeg ile h264 videoları birleştirmek
Ocak 28, 2019 § Yorum yok § Kalıcı bağlantı
Önce transport streame cevirip sonra birleştiriyoruz:
ffmpeg -i trt_haber_20190123150046.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts 1.ts ffmpeg -i trt_haber_20190123150146.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts 2.ts ffmpeg -i "concat:1.ts|2.ts" -c copy sonuc_ffmpeg.mp4
Windows Dizinini Linux’de mount etmek
Ocak 28, 2019 § Yorum yok § Kalıcı bağlantı
How to make the mounting permanent?
Open /etc/fstab d
sudo vim /etc/fstab
and add line
//REMOTE-WIN-NAME-OR-IP/REMOTE-SHARED-FOLdER /LOCAL-LINUX-SHARE user=WIN-USERNAME,domain=WIN-DOAMIN,password=WIN-PASS,iocharset=utf8 0 0
in my case
//192.168.10.108/D /home/palo/share/PC-D/ cifs user=palo,domain=kis,password=********,iocharset=utf8 0 0
then remount it all
sudo mount -a
and check with
mount
More secure way of the same
Previous example has a problem that the /etc/fstab may read someone and see your passwords, therefore a secure way of the same is to make a local text file
vim ~.credentials
and put there
username=valuevalue
password=valuevalue
domain=valuevalue
whare “value” are yours usernanme/password/domain_name
then modify /etc/fstab line from
//REMOTE-WIN-NAME-OR-IP/REMOTE-SHARED-FOLdER /LOCAL-LINUX-SHARE user=WIN-USERNAME,domain=WIN-DOAMIN,password=WIN-PASS,iocharset=utf8 0 0
to
//REMOTE-WIN-NAME-OR-IP/REMOTE-SHARED-FOLdER /LOCAL-LINUX-SHARE credentials=/root/.win_creditals,iocharset=utf8 0 0
then close the file and run
sudo mount -a
Done!
Benim kullandıgım dosyalar:
/etc/fstab
# /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda1 during installation UUID=9cea0017-3082-4b1d-bd9a-7090aef15515 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=49581f69-2a85-42fc-bf4a-d14a4a6ce314 none swap sw 0 0 #//192.168.10.108/D /home/palo/share/PC-D/ cifs user=palo,domain=kis,password=********,iocharset=utf8 0 0 //172.16.2./Users/Administrator/Desktop/test /home/fatih/shred cifs credentials=/root/.win_creditals,iocharset=utf8 0 0
/root/.win_credital içeriği
username=Administrator password=xxxxxx domain=SKxxS.NET
mount ve umount’u elle yapmak için
mount.cifs //172.16.x.x/Users/Administrator/Desktop/test /home/fth/shred -o user=Administrator,domain=SKxxS.NET umount -t cifs /home/fth/shred
ffmpeg ile resize (küçültme, büyütme) yapmak
Ocak 28, 2019 § Yorum yok § Kalıcı bağlantı
Aspect ratio korunurken rescale etmek için en veya boydan biri -1 veya -2 verilir.
ffmpeg -i input.jpg -vf scale=320:-1 output_320.png
Görüntüyü 1/6 oranına getirmek
ffmpeg -i ../scriptler/sonuc.ts -c:v libx264 -c:a mp3 -vf scale=iw/6:-1 -b 130k -minrate 130k -maxrate 130k sonuc2.mp4
diğer örnekler
1/2 oranında küçültmek
ffmpeg -i input.jpg -vf "scale=iw*.5:ih*.5" input_half_size.png ffmpeg -i input.jpg -vf "scale=iw/2:ih/2" input_half_size.png
Boyut tam olarak da verilebilir:
ffmpeg -i input.jpg -vf scale=320:240 output_320x240.png
Referans: https://trac.ffmpeg.org/wiki/Scaling#no1