Daily Chrzan #39

in #polish3 years ago (edited)
PLENG
Codzienna dawka Chrzanu.A daily dose of Chrzan.
Montowanie wideo przy pomocy terminala to dziwny pomysł, ale czasami nie potrzeba efektów ani dokładności.Editing videos with a terminal is a weird idea, but maybe effects and precision aren't always needed.
Żeby pociąć plik podaj pozycję początkową (-ss), długość (-t) lub czas końcowy (-to).To cut a file, set a starting position (-ss), a duration (-t), or an end-time (-to).

ffmpeg -ss 00:20.5 -t 10 -i 1.avi f1.avi
Zapisuje dziesięć sekund od 00:20 i pół. / It saves ten seconds from 00:20 and a half.

MontowanieConcatenating
ffmpeg -i f1.avi -i f2.avi a.avi nie połączy tych wideo. Najpierw trzeba zrobić plik .txt z nazwami fragmentów, które chcesz scalić, a później użyć -f concat.ffmpeg -i f1.avi -i f2.avi a.avi won't merge the videos. First, you need to make a .txt file with the names of fragments you want to join together and use -f concat.

printf "file 'f1.avi'\nfile 'f2.avi" > f.txt
f.txtf.pngf.txt
ffmpeg -f concat -i f.txt a.avi

-map-map
Plik może się składać z różnych ścieżek, na przykład #0:0 wideo, #0:1 dźwięk, #0:2 napisy. Ze znanych mi formatów, .mp4 i .mkv mogą zawierać wiele takiego samego typu (choćby polskie, angielskie i niemieckie audio). Liczba przed dwukropkiem oznacza [1 + ta liczba]-y input w kolejności.A file may contain a few streams, for example, #0:0 video, #0:1 sound, #0:2 subtitles. From formats which I know, .mp4 and .mkv can have many of the same type (like Polish, English, and German audio). A number before the colon means the [1 + the number]-th input in order.

1.png

-map 0
Wszystkie ścieżki z pierwszego pliku (0). / All streams from the first file (0).

-map 2:v:1
Druga ścieżka video (:v:1) z trzeciego pliku (2). / The second video stream (:v:1) from the third file (2).

-map 3 -map -3:a:0
Wszystko z czwartego pliku (3) oprócz pierwszej ścieżki audio (-3:a:0).
/ All from the fourth file (3) except the first audio stream (-3:a:0).

Wygląda zawile,It looks complex,
ale to tylko kilka wybranych ścieżek z dwóch plików (-i 1a.mkv -i 1b.mkv):but it's only a few chosen streams from two files (-i 1a.mkv -i 1b.mkv):

ffmpeg -i 1a.mkv -i 1b.mkv -map 0:0 -map 0:a -map 1:s 1.mkv
Wideo (0:0) i wszystkie ścieżki audio (0:a) z pierwszego pliku oraz wszystkie napisy (1:s) z drugiego.
A video (0:0) and all audio streams (0:a) from the first file and all subtitles (1:s) from the second.

Sort:  

Actually those are pretty useful spells to learn. I used that for some simple animations such as Hive logo reveal and bees (based on royalty free video):
it's just 5MB file but looks pretty nice (using custom pallette of course)

„Yer a wizard, Janina.”

Jedyna osoba w internetach co ma białe tło terminala :D

Właśnie nie wiem, czemu Linux Tails tak ma.

Jeśli to Gnome to może da się po prostu w preferencjach zmienić :D
https://linuxhint.com/bash_test_background_colors/

Jak to nie działa to pewnie trzeba by dodać skrypt zmieniający kolor, wykonujący się za każdym odpaleniem terminala albo dorwać się do plików config :p

1.png

Pięknie :D
Polecam osobiście pozwiedzać, ile pracy ludzie potrafią włożyć żeby ich Linux ładnie wyglądał :D
Reddit