AudioVideo

From TheBestLinux.com
Jump to navigation Jump to search

Audio & Video Creation, Modification, Conversion and More!

This sub-section of the wiki contains all kinds of information related to audio and video creation, modification, conversion, and other related info I've discovered and implimented over the years, and will continue to accumulate information as I discover more ways to work with audio and video. I will try to add stuff as I need to use it as well, as I find this a great way to document things I have had to figure out myself!

Miscelaneous Tools and Commands for Creating, Modifying and Converting Audio and Video Files


FFMPEG - The Swiss Army Knife of Audio & Video Processing!

This one tool, ffmpeg, is probably the most useful and versatile audio and video processing tool used from the command-line, as I can't even think of anything audio and/or video related that it can't do!

The FFMPEG tool consists of "ffmpeg" itself, along with a straight command-line player, "ffplay", and a tool to probe an audio and/or video source, file, etc., for it's details about the video and audio codecs, formats, quality, size and muchmore that it consists of, the "ffprobe" tool.

The "ffplay" tools is pretty straight forward when it comes to playing a file from the command line. Here's an example of how to play a local file:

[jamie@server.dawgland.com:~/Videos]$ ffplay /home/jamie/Videos/Armagedon.mp4
ffplay version 4.2.4 Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 10 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-lv2 --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/jamie/Videos/Armagedon.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: mp41avc1
    creation_time   : 2020-12-25T08:39:23.000000Z
    playback_requirements: QuickTime 6.0 or greater
    playback_requirements-eng: QuickTime 6.0 or greater
    encoder         : vlc 3.0.11.1 stream output
    encoder-eng     : vlc 3.0.11.1 stream output
  Duration: 02:31:57.22, start: 0.000000, bitrate: 2052 kb/s
    Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2020-12-25T08:39:23.000000Z
      handler_name    : SoundHandler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080, 33084 kb/s, 29.97 fps, 29.97 tbr, 1000k tbn, 2000k tbc (default)
    Metadata:
      creation_time   : 2020-12-25T08:39:23.000000Z
      handler_name    : VideoHandler
   5.53 A-V: -0.005 fd=   3 aq=   20KB vq=  272KB sq=    0B f=0/0   
[jamie@server.dawgland.com:~/Videos]$



The video begins to play and continues until the end or until I hit the "ESCAPE" key.

Playing a network stream using ffplay is also farily straight-forward. Here's an example:

[jamie@server.dawgland.com:~/Videos]$ ffplay rtsp://dawgstream.dawgland.com:554/main
ffplay version 4.2.4 Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 10 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-lv2 --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, rtsp, from 'rtsp://dawgstream.dawgland.com:554/main':sq=    0B f=0/0   
  Metadata:
    title           : hdmi
    comment         : main
  Duration: N/A, start: 31989.843100, bitrate: N/A
  Program 1 
    Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080, 29.97 fps, 29.97 tbr, 90k tbn
    Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 130 kb/s
31993.56 A-V: -0.006 fd=   0 aq=    9KB vq=  206KB sq=    0B f=0/0   
[jamie@server.dawgland.com:~/Videos]$



The stream plays until the "ESCAPE" key is hit.

The "ffprobe" tool is run in the same way. Here's an example of using ffprobe on a local video file:

[jamie@server.dawgland.com:~/Videos]$ ffprobe Armagedon.mp4 
ffprobe version 4.2.4 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 10 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-lv2 --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Armagedon.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: mp41avc1
    creation_time   : 2020-12-25T08:39:23.000000Z
    playback_requirements: QuickTime 6.0 or greater
    playback_requirements-eng: QuickTime 6.0 or greater
    encoder         : vlc 3.0.11.1 stream output
    encoder-eng     : vlc 3.0.11.1 stream output
  Duration: 02:31:57.22, start: 0.000000, bitrate: 2052 kb/s
    Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2020-12-25T08:39:23.000000Z
      handler_name    : SoundHandler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080, 33084 kb/s, 29.97 fps, 29.97 tbr, 1000k tbn, 2000k tbc (default)
    Metadata:
      creation_time   : 2020-12-25T08:39:23.000000Z
      handler_name    : VideoHandler
[jamie@server.dawgland.com:~/Videos]$ 



As you can see, it gives you all the information you could ever want!
Here's an example of using ffprobe on a network video stream:

[jamie@server.dawgland.com:~/Videos]$ ffprobe rtsp://dawgstream.dawgland.com:554/main
ffprobe version 4.2.4 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 10 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-lv2 --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, rtsp, from 'rtsp://dawgstream.dawgland.com:554/main':
  Metadata:
    title           : hdmi
    comment         : main
  Duration: N/A, start: 32357.775844, bitrate: N/A
  Program 1 
    Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080, 29.97 fps, 29.97 tbr, 90k tbn
    Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 130 kb/s
[jamie@server.dawgland.com:~/Videos]$



The main command, "ffmpeg", is where the real power lies! This one command, along with a multitude of command-line arguments, switches and options, can pretty much do it ALL when it comes to audio/video processing!!!
I will continually add more information in this one sub-section of this wiki, as I am always discovering new ways to use ffmpeg!

To start off with, here's a command I often use as I find old DVD's collecting dust and worse, scratches! Using ffmpeg, I can easily "rip" videos from old DVD's, inculding old home videos that were originally recorded using video tape recorder cameras and later converted to DVD's, as is often the case, along with old film videos converted to digital files and "burned" onto disks.
Here's an example of how I "rip" a video from a DVD while converting it to a digital .mp4(MPEG) files which can then be shared, uploaded to the cloud, or otherwise better utilize the videos.

[jamie@server.dawgland.com:~/Videos/MyPERSONAL_VIDEOS]$ cat vts_05_1.vob | ffmpeg -i - -vcodec h264 Video.mp4
ffmpeg version 4.2.4 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-lv2 --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mpeg, from 'pipe:':
  Duration: N/A, start: 0.094644, bitrate: N/A
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 720x480 [SAR 8:9 DAR 4:3], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:2 -> #0:1 (ac3 (native) -> aac (native))
[libx264 @ 0x55908ffe3f40] using SAR=8/9
[libx264 @ 0x55908ffe3f40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x55908ffe3f40] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x55908ffe3f40] 264 - core 159 r2999 296494a - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'Video.mp4':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(top coded first (swapped)), 720x480 [SAR 8:9 DAR 4:3], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.54.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.54.100 aac
Error while decoding stream #0:2: Error number -16976906 occurred
frame=   76 fps=0.0 q=-1.0 Lsize=    1352kB time=00:00:02.43 bitrate=4547.0kbits/s speed=2.78x    
video:1327kB audio:22kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.241979%
[libx264 @ 0x55908ffe3f40] frame I:2     Avg QP:24.43  size: 36718
[libx264 @ 0x55908ffe3f40] frame P:22    Avg QP:26.81  size: 23980
[libx264 @ 0x55908ffe3f40] frame B:52    Avg QP:28.45  size: 14563
[libx264 @ 0x55908ffe3f40] consecutive B-frames:  5.3%  7.9%  7.9% 78.9%
[libx264 @ 0x55908ffe3f40] mb I  I16..4: 22.6% 65.6% 11.7%
[libx264 @ 0x55908ffe3f40] mb P  I16..4:  5.1% 17.9%  3.2%  P16..4: 45.3% 15.4%  9.6%  0.0%  0.0%    skip: 3.6%
[libx264 @ 0x55908ffe3f40] mb B  I16..4:  0.5%  1.5%  0.5%  B16..8: 35.7%  8.8%  3.3%  direct:19.3%  skip:30.5%  L0:44.5% L1:36.5% BI:19.0%
[libx264 @ 0x55908ffe3f40] 8x8 transform intra:66.7% inter:77.7%
[libx264 @ 0x55908ffe3f40] coded y,uvDC,uvAC intra: 67.0% 94.3% 68.9% inter: 34.0% 61.3% 22.7%
[libx264 @ 0x55908ffe3f40] i16 v,h,dc,p: 48% 25% 10% 17%
[libx264 @ 0x55908ffe3f40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 22% 24%  3%  2%  2%  4%  6%  5%
[libx264 @ 0x55908ffe3f40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu:  9% 50% 12%  4%  3%  3%  7%  5%  8%
[libx264 @ 0x55908ffe3f40] i8c dc,h,v,p: 57% 22% 14%  6%
[libx264 @ 0x55908ffe3f40] Weighted P-Frames: Y:31.8% UV:27.3%
[libx264 @ 0x55908ffe3f40] ref P L0: 52.9% 13.5% 18.6% 12.1%  2.9%
[libx264 @ 0x55908ffe3f40] ref B L0: 81.1% 13.3%  5.5%
[libx264 @ 0x55908ffe3f40] ref B L1: 95.0%  5.0%
[libx264 @ 0x55908ffe3f40] kb/s:4285.09
[aac @ 0x55908ffce000] Qavg: 158.689
[jamie@server.dawgland.com:~/Videos/MyPERSONAL_VIDEOS]$ 



Although there was a minor error displayed during the conversion process, the end result turned out perfect, as they usually always do! Of course, be sure to use your own file names and directories.

You can even use "wild-cards", such as the "*" symbol which equals any character of any length, to select and convert many files in the same directory all at the same time, as shown here ripping all of the videos from an entire DVD:

[root@server.dawgland.com:/mnt/loop/video_ts]# cat vts_0*_*vob | ffmpeg -i - -vcodec h264 /MyShare/Disk-01.mp4
ffmpeg version 4.2.4 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-lv2 --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mpeg, from 'pipe:':
  Duration: N/A, start: 0.224800, bitrate: N/A
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, smpte170m, top first), 704x480 [SAR 10:11 DAR 4:3], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:2 -> #0:1 (ac3 (native) -> aac (native))
[libx264 @ 0x55bc53766240] using SAR=10/11
[libx264 @ 0x55bc53766240] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x55bc53766240] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x55bc53766240] 264 - core 159 r2999 296494a - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/MyShare/Disk-01.mp4':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(top coded first (swapped)), 704x480 [SAR 10:11 DAR 4:3], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.54.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.54.100 aac
frame=  134 fps=0.0 q=29.0 size=       0kB time=00:00:04.01 bitrate=   0.1kbits/
frame=  235 fps=234 q=29.0 size=     256kB time=00:00:07.53 bitrate= 278.5kbits/
frame=  293 fps=193 q=29.0 size=     512kB time=00:00:09.49 bitrate= 441.9kbits/
.
.
.
frame=185717 fps=126 q=29.0 size= 1834752kB time=01:43:16.30 bitrate=2425.7kbits
frame=185834 fps=126 q=29.0 size= 1834752kB time=01:43:20.17 bitrate=2424.2kbits
frame=185895 fps=126 q=-1.0 Lsize= 1841771kB time=01:43:22.68 bitrate=2432.5kbits/s speed=4.19x    
video:1737830kB audio:97276kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.363161%
[libx264 @ 0x55bc53766240] frame I:2173  Avg QP:20.04  size: 22111
[libx264 @ 0x55bc53766240] frame P:48546 Avg QP:25.77  size: 20571
[libx264 @ 0x55bc53766240] frame B:135176 Avg QP:29.52  size:  5421
[libx264 @ 0x55bc53766240] consecutive B-frames:  2.1%  2.2%  1.6% 94.1%
[libx264 @ 0x55bc53766240] mb I  I16..4: 37.0% 50.6% 12.4%
[libx264 @ 0x55bc53766240] mb P  I16..4:  1.6% 10.6%  1.3%  P16..4: 40.1% 22.3% 13.4%  0.0%  0.0%    skip:10.7%
[libx264 @ 0x55bc53766240] mb B  I16..4:  0.2%  0.9%  0.1%  B16..8: 42.1%  6.8%  2.0%  direct: 6.1%  skip:41.7%  L0:40.1% L1:42.4% BI:17.4%
[libx264 @ 0x55bc53766240] 8x8 transform intra:71.9% inter:77.4%
[libx264 @ 0x55bc53766240] coded y,uvDC,uvAC intra: 74.1% 65.1% 18.6% inter: 28.7% 26.9% 1.7%
[libx264 @ 0x55bc53766240] i16 v,h,dc,p: 37% 46%  8% 10%
[libx264 @ 0x55bc53766240] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 20% 29%  4%  4%  6%  5%  6%  7%
[libx264 @ 0x55bc53766240] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 50% 17%  3%  3%  3%  5%  3%  5%
[libx264 @ 0x55bc53766240] i8c dc,h,v,p: 58% 21% 15%  7%
[libx264 @ 0x55bc53766240] Weighted P-Frames: Y:10.1% UV:3.7%
[libx264 @ 0x55bc53766240] ref P L0: 41.1% 14.3% 32.6% 11.0%  1.1%
[libx264 @ 0x55bc53766240] ref B L0: 82.4% 14.7%  3.0%
[libx264 @ 0x55bc53766240] ref B L1: 94.4%  5.6%
[libx264 @ 0x55bc53766240] kb/s:2295.18
[aac @ 0x55bc53764b80] Qavg: 261.426
[root@server.dawgland.com:/mnt/loop/video_ts]#



This one command converts all of the files into .mp4 format as one big playable file!

Mplayer - An excellent video player!

The "mplayer" command is a real handy tool to play videos of most any type from the commandline, or from a GUI wrapper, such as "GMplayer".

Usage of mplayer from the commandline is very straight-forward. Just type "mplayer, case sensitive, with the quotes, followed by the fulle case-sensitive name of the video file you want to play. The tool will then proceed to play the video in it's default format and size. If you want ot view it in full-screen mode, just give it the "full-screen" switch, -fs, between the mplayer command and the file name. Here's an example on using mplayer to play a video vile in full-screen mode:

[jamie@server.dawgland.com:~/Videos/MyPERSONAL_VIDEOS]$ mplayer -fs Video.mp4 
MPlayer 1.4-10 (C) 2000-2019 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing Video.mp4.
libavformat version 58.29.100 (external)
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fa82c3f8580]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  720x480  24bpp  29.970 fps  4287.3 kbps (523.3 kbyte/s)
X11 error: BadMatch (invalid parameter attributes)
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
[vdpau] Error when calling vdp_device_create_x11: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 58.54.100 (external)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Clip info:
 major_brand: isom
 minor_version: 512
 compatible_brands: isomiso2avc1mp41
 encoder: Lavf58.29.100
Load subtitles in ./
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, floatle, 126.6 kbit/4.12% (ratio: 15830->384000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [pulse] 48000Hz 2ch floatle (4 bytes per sample)
Starting playback...
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 720x480 => 720x540 Planar YV12  [fs]
A:   1.4 V:   2.5 A-V: -1.124 ct: -0.015   0/  0 18%  1%  0.4% 0 0              


Exiting... (End of file)
[jamie@server.dawgland.com:~/Videos/MyPERSONAL_VIDEOS]$



The video will pop up in a separate full-screen window, and continue to play until if reaches the end of the video file, or you hit the "ESCAPE" key.