How to Enable Multimedia in Slackware Linux

How to Enable Multimedia in Slackware Linux

There was an excellent article on how to enable Multimedia on a Slackware Linux system in a blog called Human Readable, that was deleted, well whatever the case its been made no longer available, it did have a lot of outdated stuff but for the most part was a good guide, it just now mentions for everyone to have a look at the slack docs, which for me still lacks in at least defining which are the most useful packages and codecs people should install to enable most any common multimedia use (from listening to plain old .mp3 to playback of DVD encrypted or otherwise, other options etc.) on your Slackware System, aside from typical power programs like VLC or Mplayer and Xine, I mean I mention them here too, but just in case you want to use other apps and options than these you need other certain things too, to install.

The Short of it would be to install flashplayer-plugin, vlc and maybe a java JRE whether oracle or openjdk for those java apps and web plugin (you can find flash, vlc and opendjk in slackbuilds.org for oracle you have to go to oracle website and download it from there due to license issues). The VLC package itself has many dependencies you need to compile and install to be able to run VLC for a detailed look of the packages continue reading below.

Here I list the programs/packages you need to install, you can choose which combos you'd like to install for your multimedia choices, I tried to order a few combos

Multimedia:

Install these codecs in order from left to right:

C1: (enables most common multimedia functions)
jdk flashplayer-plugin smplayer xine-plugin gst-plugins-bad gst-plugins-ugly a52dec faad2 flac123 twolame lua portaudio libavc1394 libdca libdv libdvbpsi libdvdcss libdvdnav libebml libmatroska libmodplug libmpeg2 speex libshout libupnp orc schroedinger vcdimager libmp4v2 faac libcuefile libreplaygain musepack-tools lame xvidcore x264 opus libass libdc1394 live555 libquicktime mplayer-codecs

C2: (enables most common need multimedia functions plus ability to compile and set all features of VLC and FFMPEG)
jdk flashplayer-plugin smplayer xine-plugin gst-plugins-bad gst-plugins-ugly a52dec faad2 flac123 twolame lua portaudio libavc1394 libdca libdv libdvbpsi libdvdcss libdvdnav libebml libmatroska libmodplug libmpeg2 speex libshout libupnp orc schroedinger vcdimager libmp4v2 faac libcuefile libreplaygain musepack-tools lame xvidcore x264 opus libass libdc1394 live555 libquicktime openal mplayer-codecs openjpeg opencore-amr rtmpdump libvpx gsm celt opencv gavl frei0r libaacs graphviz apache-ant libbluray libsigsegv texlive ffmpeg vlc

 C3: (enables what both C1 and C2 offered features, but including various other power tools for converting and editing multimedia files and support for such)
jdk flashplayer-plugin smplayer xine-plugin gst-plugins-bad gst-plugins-ugly a52dec faad2 flac123 twolame lua portaudio libavc1394 libdca libdv libdvbpsi libdvdcss libdvdnav libebml libmatroska libmodplug libmpeg2 speex libshout libupnp orc schroedinger vcdimager libmp4v2 faac libcuefile libreplaygain musepack-tools lame xvidcore x264 opus libass libdc1394 live555 libquicktime openal mplayer-codecs openjpeg opencore-amr rtmpdump libvpx gsm celt opencv gavl frei0r libaacs graphviz apache-ant libbluray libsigsegv texlive ffmpeg vlc aften amnrnb scons libiec61883 mm-common libsigc++ glibmm libxml++ libffado jack-audio-connection-kit avidemux mjpegtools libmpeg2 k9copy libmspack wxpython vamp-plugin-sdk soundtouch audacity


Build option variables:

- BDJAVA=yes for libbluray
- ASS=yes BLURAY=yes CELT=yes DC1394=yes FAAC=yes FREI0R=yes GSM=yes JP2=yes LAME=yes OPENAL=yes OPENCORE=yes OPENSSL=yes RTMP=yes SCHROEDINGER=yes SPEEX=yes VPX=yes X264=yes XVID=yes for FFMPEG if you want the full effect
- A52DEC=yes FAAC=yes LIBDV=yes LIBMPEG2=yes MJPEGTOOLS=yes QUICKTIME=yes X264=yes XVID=yes for transcode
- FFMPEG=yes SOUNDTOUCH=yes TWOLAME=yes VAMP=yes for Audacity

Others:

- Make sure to read the info of anything you install upstream or slackbuilds, it will help you configure and compile
- All files available from slackbuilds, binaries can be found in various repos, a notable mention for alien bob's restricted repos for vlc and ffmpeg
- Make sure to run slackbuild of ffmpeg in a real root shell ("su -")
- texlive is a huge 1.3G+ download and build, make sure you have space and a big /tmp
- gst-plugins-good and openssl are part of Slackware default stock install, make sure you install them, as they can be useful, especially if you want to enlable
openssl in FFMPEG build by passing variable build option in the slackbuild of FFMPEG
- mplayer and kplayer, along with xine and xmms are also part of a default slackware stock install, make sure you install them if you dont do a full stock vanilla
install
- When using ffado as a normal user you might run into permission problems with access to /dev/raw1394. To solve that issue you can add the line
KERNEL=="raw1394", GROUP="disk" to /lib/udev/rules.d/65-permissions.rules and make your user is/are a member of the disk group.
- Jack-audio-connection-kit when started as normal user, must be with the following command:
$ sudo setcap cap_ipc_lock,cap_sys_nice=ep /usr/bin/jackd
- In installing transcode, do so right after mjpegtools, except you'd have to run either x86/32 or a multilib slackware as its only for i486
- Lua mentioned here is at version 5.1 not 5.2
- Java apps run on jre, alot of apps and if you do development need jdk, jdk includes jre, but a jre package doesnt include jdk, my recommendation is to install jdk

Best way to format your USB Flash Drive in Linux CLI


Best way to format your USB Flash Drive in Linux CLI:
(especially when gparted, or even fdisk, cfdisk give you problems):

1. Insert your usb memory pen / stick or whatever into the USB drive and immediately after that, open a terminal and input:

$ dmesg | tail

You should get an output of something like this:


[76384.491365] sd 6:0:0:0: [sdb] Write Protect is off
[76384.491369] sd 6:0:0:0: [sdb] Mode Sense: 23 00 00 00
[76384.491865] sd 6:0:0:0: [sdb] No Caching mode page present
[76384.491870] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[76384.494235] sd 6:0:0:0: [sdb] No Caching mode page present
[76384.494241] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[76384.494745]  sdb:
[76384.496734] sd 6:0:0:0: [sdb] No Caching mode page present
[76384.496738] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[76384.496742] sd 6:0:0:0: [sdb] Attached SCSI removable disk

2. Unmount your USB drive using the following command:
$ sudo umount /dev/sdb

Where "sdb" is your media drive you had to remember at step 1.

3. Format the drive using the following commands, depending on which filesystem you want I list ext3, ext4 or FAT32:

A1.) Format to FAT32
$ sudo mkfs.vfat /dev/sdb

/or

B.) Format to EXT3:
$ sudo mkfs.ext3 -n 'Label' -I /dev/sdb

/or

C.) Format to EXT4:
$ sudo mkfs.ext4 -n 'Label' -I /dev/sdb


C2.) Force Format to EXT4 if for some reason the first doesnt work nor the gparted or other partition applications don't work:

$ sudo mkfs -t ext4 /dev/sdb


/or

A2.) Alternatively you can create a FAT32 filesystem with the:
$ sudo mkdosfs -n 'Label' -I -F 32 /dev/sdb


*NOTES:

- Where Label will be the name displayed for the USB media so you can set it to whatever you want; and sd(x) is your usb drive you had to remember at step 1, in this case its sdb for my example
- Sometime you need to blow away or purge the contents of a drive before you can properly format it:

$ sudo dd if="/dev/null" of="/dev/sdb" 

/or

$ sudo dd if="/dev/zero" of="/dev/sdb"

Convert .MKV to .MP4 in Linux with FFMPEG


Convert .MKV to .MP4 in Linux with FFMPEG:

$ ffmpeg -i input.mkv -vcodec copy -ab 128k -acodec libfaac output.mp4



*NOTES:
- Where input is the source file and output the outcome file.
- The $ sign at the start of the command is to signify the terminal's prompt, no need to type this in.
- Many file formats are supported, for more see $ man ffmpeg

Convert .FLAC audio files to .MP3 in Linux with FFMPEG

Convert .FLAC audio files to .MP3 in Linux with FFMPEG:

$ ffmpeg -i  input.flac -ab 320k output.mp3


*NOTES:
- Where input is the source file and output the outcome file.
- The $ sign at the start of the command is to signify the terminal's prompt, no need to type this in.
- Many file formats are supported, for more see $ man ffmpeg
Join multiple MP4/M4V video files into one continuous video with GPAC:

First install gpac:

In debian based distros, issue command in terminal:

# apt-get install gpac


To join files issue command:

$ MP4Box -cat input1.mp4 -cat input2.mp4 -cat input3.mp4 -new output.mp4


 *NOTES:
- Where input(n).mp4 is the input mp4 files you want to join together, you must start from left to right, left starts the order going to the right what follows in order, it is not limited to 3 files, I limit it to 3 only for example purposes.
- The command is written exactly as it starts with command MP4Box and not mp4box or MP4BOX and etc, if you have an error check your case and spelling.
- The $ sign at the start of the command is to signify the terminal's prompt, no need to type this in.
- The # sign at the start of the command is to signify the root terminal's prompt, no need to type this in.

Quick Way to Create a .GIF Animated Picture in Linux from a Video File

Quick Way to Create a .GIF Animated Picture in Linux from a Video File:

Prerequisite/s:

Be able to use Terminal
Install FFMPEG
Install ImageMagick


Using FFMPEG, we shall extract pictures from a desired video clip, to use for creating the .GIF animated
picture file

$ ffmpeg -i inputfile.avi -r 1 -s sqcif -f image2 image-%3d.jpg

You can also define the image size of the extracted images using the -s flag. The default option is to use the image size same as the video resolution. you can use different video formats just change the file name/extension of the video input in this example we use a .avi video file.

sqcif option stands for the frame size. You can use other options to change sizes:


sqcif 128x96

qcif 176x144

cif 352x288

4cif 704x576

qqvga 160x120

qvga 320x240

vga 640x480

svga 800x600

xga 1024x768

uxga 1600x1200

qxga 2048x1536

sxga 1280x1024

qsxga 2560x2048

hsxga 5120x4096

wvga 852x480

wxga 1366x768

wsxga 1600x1024

wuxga 1920x1200

woxga 2560x1600

wqsxga 3200x2048

wquxga 3840x2400

whsxga 6400x4096

whuxga 7680x4800

cga 320x200

hd480 852x480

hd720 1280x720

hd1080 1920x1080




To create the .GIF issue command below:

$ convert -delay 20 -loop 0 image*.jpg animation.gif

Merge Several mp3 files into just One mp3 File


Merge Several mp3 files into just One mp3 File (with fix the time stamps and search index)

Required programs:
mp3wrap
mp3val


Issue command:

$ mp3wrap tmp.mp3 fooFile01.mp3 fooFile02.mp3 fooFile03.mp3 fooFile04.mp3 && mv tmp*.mp3 new.mp3 && mp3val new.mp3 -f -nb




*NOTES:

- The $ sign at the start of the command is to signify the terminal's prompt, no need to type this in.
- (Use VLC to easily input metadata into the files)