back to main page                                                    txt version

========== multimedia ==========

Index: * video and music * images * PDFs, DJVUs and e-books * camera and QR codes scanning * shazam

video and music ===============

mpv has everything I need, including the ability to play streams. To play videos in the console you just need to provide --vo=drm argument. To play music you just need to provide a file or a directory with music as an argument. Be sure for the user running mpv to be in 'audio' and 'video' groups. Also - mpv won't play videos with '--vo drm' when xorg is running. To play the stream radio (or any other stream) type, e.g.: $ mpv Great list of world's radio stations, including AM and FM stations, with streaming services can be found here. Another player for console is mplayer, but it has tearing issues when playing videos with framebuffer. I used this command: $ mplayer -vo fbdev2 -fs -zoom -xy 1920 -quiet -msglevel all=-1 mpv takes over the whole screen when playing videos, but mplayer doesn't do that, so you'd have to hide your tmux status bar because it will be flashing with every change of text in it. To do that add a key binding in ~/.tmux.conf by appending the line: bind-key S set status Now you can toggle status bar by pressing <prefix><S>. If you need some kind of music management system, then cmus was quite pleasant when I was using it a long time ago. If you're looking for some new music or you're just looking for someone to choose a music for you, you can use youtube with a little bit of a shell script. Adjust the script to suit your needs - add recursion, filter results, sort/shuffle, and finally pass links to mpv. Feel the freedom. $ ./ | cut -d' ' -f1 | xargs -n1 ./ | sort | uniq > music_list $ cut -d' ' -f1 < music_list | xargs mpv --no-video

images ======

There are two image viewers - fim and fbi. I'm currently using fim, which is supposed to be improved fbi. Both do the job.

PDFs, DJVUs and e-books =======================

For PDFs and DJVUs I use fbpdf that also provides fbdjvu binary. It works good enough not to start xorg to work with PDFs. Be aware that after changing tmux panes you'll have to refresh the fbpdf screen with <shift>+<l> when selecting back the pane with fbpdf. For reading e-books in epub format I use w3m. If the e-book is text only I use einfo from ebook-tools like this: einfo -pp book1.epub | \w3m -T text/html If e-book contains pictures or is pretty long it's good to extract it with unzip, locate the index file and open it with w3m. The index file location and name can be different for each e-book, but it's not hard to find usually. I don't use calibre, but I have extracted one python script from there - ebook-convert. It's really useful to convert different types of e-books and also to dump them into PDF.

camera and QR codes scanning ============================

To record video from camera you can use ffmpeg with compiled in v4l2 support. v4l2-ctl is available in v4l-utils package. Check out these commands: $ v4l2-ctl --list-devices # list camera devices $ v4l2-ctl --list-formats-ext # list camera modes $ v4l2-ctl -L # list camera options $ v4l2-ctl -c <option>=<value> # change camera option $ ffmpeg -f v4l2 -framerate 30 -video_size 640x480 \ -i /dev/video0 output.mkv # record video $ ffmpeg -ar 44100 -ac 2 -f alsa -i hw:0 \ -f v4l2 -framerate 30 -video_size 640x480 \ -i /dev/video0 output.mkv # record audio and video $ ffmpeg -thread_queue_size 1024 \ -ar 44100 -ac 2 -f alsa -i hw:0 -thread_queue_size 1024 \ -i /dev/video0 output.mkv # record with big buffer To just view video from the camera use mpv: $ mpv --vo drm /dev/video0 Higher resolution: $ mpv --vo drm --demuxer-lavf-o=video_size=1280x720 av://v4l2:/dev/video0 Higher resolution with enabled compression to fit into USB 2.0 bandwidth: $ mpv --vo drm --demuxer-lavf-o=video_size=1280x720:input_format=mjpeg \ av://v4l2:/dev/video0 Command 'v4l2-ctl --list-formats-ext' will help to determine correct modes supported by the camera. For reading QR codes I use zbar with compiled in v4l support: $ zbarcam --nodisplay --prescale=1280x1024 /dev/video0 --nodisplay is necessary because by default zbarcam will try to open graphical window, which it cannot open, because Linux console. --prescale is useful to increase cam resolution to pick up QR code faster.

shazam ======

Usage of chromaprint/acoustID is to be investigated.