not cutting with ffmpeg but in kdenlive ('shot cut' could work as well) -- keyframe issue, especially with compressed video.
mjpeg would not have this problem (but is super heavy)
- --no-osd
- config avoid_warnings=1
- --window-size=1920,1080
Setting up a pi autostart with video
http://automatist.org/2016/03/Setting_up_a_raspberry_pi_as_media_player.html
Shutting down
- sudo shutdown -h now
- restart:
- sudo shutdown -r now
Encoding a video with subtitles, ffmpeg
- ffmpeg -i video.mp4 -filter_complex "subtitles=subtitles.srt:force_style='FontName=U001 Yuri'" -c:a copy -an output.mp4
- (font is located in .fonts; -an = no sound)
Play a video with subtitles in mplayer
Put a video on a colored background
- ffmpeg -i input.avi -vf "pad=width=640:height=480:x=0:y=120:color=black" output.avi
Cropping a video automatically/remove black bands
- test if cropping is ok:
- ffplay -i input -vf "crop=in_w:in_h-40"
- copy result from commandline if yes:
- ffmpeg -i sailor.mov -vf "crop=384:576:168:0" sailorcropped.mov
- ffmpeg -i trotinette200.mov -vf "crop=384:560:168:10" trotinettecropped.mov
- ffmpeg -i violentamalgamations.mp4 -vf "crop=in_w-60:in_h-60" violentamalgamations_crop.mp4
Dealing with pixel formats for raspberry
- ffmpeg -i makehuman.mp4 -vcodec libx264 -b:v 2M -profile:v high422 -pix_fmt yuv420p -threads 0 makehuman.fixed.mp4
Connecting a non-behaving VGA screen
Change hdmi_group and hdmi_mode
Concatenating multiple videos
Inside the folder where the videos are, make a file called videos.txt with:
- file 'lascaux.mp4'
- file 'lascaux.mp4'
- file 'lascaux.mp4'
- file 'lascaux.mp4'
- file 'lascaux.mp4'
- then from that folder (use cd to move into it):
- ffmpeg -f concat -i videos.txt -c copy output
Flipping a video
- ffmpeg -f root_clean.mp4 -vf hflip -c copy root_flip.mp4
Reversing a video
- ffmpeg -i root_clean.mp4 -vf reverse root_reversed.mp4
Removing a logo
- ffmpeg -i root.mp4 -vf delogo=x=828:y=857:w=400:h=400:show=1 -c:a copy root_clean.mp4
- ffmpeg -i root.mp4 -vf delogo=x=828:y=857:w=400:h=400 -c:a copy root_clean.mp4
Cutting a video with ffmpeg
- ffmpeg -ss 00:00:30.0 -i input.wmv -c copy -t 00:00:10.0 output.wmv
- ffmpeg -ss 30 -i input.wmv -c copy -t 10 output.wmv
- ffmpeg -ss 00:00:00.0 -i planes_cast.mp4 -c copy -t 00:12:55.0 planes.mp4
Cutting a video with oggz chop
- (less issues with keyframes?)
- oggz chop -s 0:05 -e 3:17 -o rock_cut.ogv rock_recast.ogv
Finding lines at a certain length
[in a text-editor; in search & replace check/select 'regular expressions']
- Finding lines of a certain length
- Matching the phrase
Backup/clone
- sudo dd if=/dev/sdc of =~/raspberry_clone.img
- sudo dd if=~/raspberry_clone.img of=/dev/mmcblk0
or
- dd bs=4M status=progress if=/dev/sdc of=./raspberry_clone.img
Shutdown at a certain moment
or
- |if [ $(tty) == /dev/tty1 ]; then ./script fi
https://www.raspberrypi.org/forums/viewtopic.php?p=828947https://superuser.com/questions/49289/what-is-the-bashrc-file#49292https://www.dexcript
on https://bootterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/
switch off error messages for omxplayer
Stopping the Raspberry
Rotating the screen output
Making the system read-only
KAZAM shortcuts
- start recording: Windows + Control + r
- pause recording: Windows + Control + p
- finish recording: Windows + Control + f
- show Kazam: Windows + Control + s
- quit Kazam: Windows + Control + q
Subtitles
- Gaupol: repair, stretch, add spacing ...
Encoding a file with subtitles, vlc
- VLC-streaming. stream > add file > stream.
- Select 'subtitle overlay' and remove the encoding reference from the final commandline output.
OTHER TRICKS
reduce size of a pdf
- gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf documentation_FR.pdf
- /printer = 300dpi
- /ebook = 150 dpi
- /screen = 72 dpi
Put different pdfs together
- pdftk file1.pdf file2.pdf file3.pdf cat output newfile.pdf
- pdftk *.pdf cat output newfile.pdf
- pdftk *.pdf 01/*.pdf 02/*pdf 03/*pdf cat output reader.pdf
record conversation
pactl load-module module-loopback --> sound loopback
pactl unload-module module-loopback
now use any recorder
Other pdf tools on-line
https://smallpdf.com/
https://www.sejda.com/
Downloading a video (FB, ...)
Converting mediawiki to .odt
- pandoc -f mediawiki -t odt mediawiki.txt -o document.odt
- pandoc -f html -t odt Unfolded.html -o Unfolded.odt
Converting epub to pdf
- ebook-convert file.epub file.pdf
- BETTER IN CALIBRE
Converting webp to .png
dwebp example.webp -o example.png
Graphviz with pad
wget -O - https://pad.constantvzw.org/p/titipi.audit.NeON-graph/export/txt | sfdp -Tpng -o infrastructure.png
Reset printer
https://www.easyink.co.nz/support/hl-tn2345-toner-reset/
///////////////////////////
Need:
6 pis installed with same raspbian version (CHECK does it matter what versions of hardware?)
6 micro sds
6 hdmi screens or vis cables/converters
6 + 6 powersockets
keyboard
mouse
bash script
cron script
timer/clock
Scenario:
Every day @ 21:00
Power on
- Screens switch on (check what happens to each of them)
- Raspberry starts up
- cron launches mplayer.sh
- mplayer.sh launches mplayer loop + subtitle
Every day @ 05:00
- cron sends halt to raspberry
Every day @ 06:00
Power down
- Screens switch off
- Raspberries switch off
installation https://www.raspberrypi.org/downloads/
cron https://www.raspberrypi.org/documentation/linux/usage/cron.md
sunrise times
http://www.sunrise-and-sunset.com/nl/sun/belgie/brussels
shutdown may be used to halt, power-off or reboot the machine.
The first argument may be a time string (which is usually "now").
Optionally, this may be followed by a wall message to be sent to all
logged-in users before going down.
The time string may either be in the format "hh:mm" for hour/minutes
specifying the time to execute the shutdown at, specified in 24h clock
format. Alternatively it may be in the syntax "+m" referring to the
specified number of minutes m from now. "now" is an alias for "+0",
i.e. for triggering an immediate shutdown. If no time argument is
specified, "+1" is implied.