========== 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 http://lyd.nrk.no/nrk_radio_jazz_mp3_h.m3u Great list of world's radio stations, including AM and FM stations, with streaming services can be found here[x00]. 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 . 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[x01]. Adjust the script to suit your needs - add recursion, filter results, sort/shuffle, and finally pass links to mpv. Feel the freedom. $ ./musiclike.sh https://www.youtube.com/watch?v=Swxw2t-9ir4 | cut -d' ' -f1 | xargs -n1 ./musiclike.sh | sort | uniq > music_list $ cut -d' ' -f1 < music_list | xargs mpv --no-video [x00]:https://www.liveradio.ie/countries [x01]:./files/musiclike.sh images ====== There are two image viewers - fim[x10] and fbi[x11]. I'm currently using fim, which is supposed to be improved fbi. Both do the job. [x10]:https://savannah.nongnu.org/projects/fbi-improved [x11]:https://www.kraxel.org/blog/linux/fbida PDFs, DJVUs and e-books ======================= For PDFs and DJVUs I use fbpdf[x20] 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 + 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[x21] 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. [x20]:https://github.com/aligrudi/fbpdf [x21]:https://sourceforge.net/projects/ebook-tools/ 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