Video

Setting up the hardware

There are different ways how the picture comes to the screen:

  1. Grab and display: grab picture store it and than move it to graphic card

  2. XVideo: direct to graphic cards memory

  3. OpenGL: as Polygons. GLX is the X implementation of OpenGL. With DRI (Direct Rendering Interface) the Hardware Acceleration puts them on screen.

  4. X11: as any other X window

A good way to see how the video is coming to the screen is by starting a screen capture program as ksnapshot, if the video is seen in the capture program than it dir not pass directly to the graphic card.

Useful commands for debugging:

v4l-info

v4l-conf

xvinfo

v4lctl -c /dev/video0 list

v4lctl -c /dev/video0 bright "50%"

v4lctl -c /dev/video0 contrast "45%"

v4lctl -c /dev/video0 color "50%"

v4lctl -c /dev/video0 hue "100%" Does not work no worry

xawtv -debug 1

xdpyinfo shows the X configuration where the XVideo extension should be seen.

DGA stands for direct graphics access.

emerge xdriinfo and emerge driconf to even have a graphical direct rendering tool.

The newer 2.6.xx kernels contain a dummy video driver (VIVI) that can be used instead of a real video device (virtual). This device shows a color bar and a time stamp, as a real device would generate by using V4L2 API. Compile it as module and load it manually: modprobe vivi

VideoOverlay - Used to allow hardware scaling of video images. The following must also be enabled in /etc/X11/xorg.conf:

Section "Extensions"
Option "XVideo" "Enable"
EndSection

Make sure the use flag xv is set in /etc/make.conf. If not emerge xorg-x11 with the xv flag set.

Important seems to be that in /etc/X11/xorg.conf v4l is loaded before vbe.

Load “v4l”
Load “vbe”

And finally the xext use flag should be set to not get the dga warning when you start xawtv.

Further check the Xvideo configuration in /etc/X11/xorg.conf

To the section module add

Load "extmod"

Video compression

Video compression makes uses of very many methods. Since video is a sequence of single pictures (or frames), those pictures can be compressed using a compressed picture format as JPEG. Such pictures appear in a video stream and have the name I-frames (Intra frames). They are important since they allow the video decoder to synchronize to a running video stream.

Between two sequential pictures there are mostly not much changes. Therefore it is a huge potential of compression to just transmit the differences. Two types of frames are defined containing those changes, the P-frame (Predicted frame) contains the difference to the preceding frame. There is also the B-frame (Bidirectional frame) that contains the difference to the preceding but also the following frame.

Often the term Group of Pictures (GOP) is used indicating a I-frame and its following P or B-frames.

When the camera turns or just an object moves in the video, then there is only a movement in the picture. Therefore P and B frame can contain movement information to avoid transmitting the redundant information.

Video DVD

Different copy protection methods are around to prevent copying commercial video:

  1. APS (Analog Protection System) disturbs the synchronization signal of the analog video so it can not be recorded but viewed.

  2. CGMS (Copy Generation Management System) has some decoded data (similar as Teletext) in the VBI (Vertical Blanking Interval) of the video signal.

  3. CSS (Content Scramble System) Works with a digital key inside the digital video and uses a DVD firmware built into the DVD reader hardware.

  4. CPRM (Content Protection for Recordable Media)

  5. DRM Digital rightsw Management (that seems to hopefully will disappear soon)

  6. Additionally every DVD has an unique 64 bit number

File formats on the DVD:

  1. IFO contains the menu on the DVD to select the various options

  2. BUP backup files from IFO

  3. VOB is the movie in mpeg2 but contains additional data packages for navigation and search and probably also copyright data packages. It might be renamed to mpeg2 and played when not copyright protected.

  4. VOR as VOB but created by video recorder

  5. AOB digital audio

Regular media players as kaffeine and Xine can play DVD's, make sure that udf file system is selected in your kernel.

Rip a video DVD

k3b allows to rip video dvd's and cd using a giu.

The package dvdrip is a gui front end for the command line tool transcode and can be used to compress VOB files further to (30%) and outputs them into file formates as OGG and AVI.

dvdrip gives you a tool to rip movies from a DVD. Check out the copyrights and legal situation in your country you might or might not rip your DVD's.

  1. After installing dvdrip check in the preferences that everything is OK. If necessary install the missing packets (e.g. Rip).

  2. Check that the right DVD device is selected in storage page.

  3. In the rip page read the table of contents and check View selected title/chapter(s) for the files that are of interest. Rip the selected title(s)/chapters(s) and you will find after a while the VOB files. Or try the smallest title to test.

  4. In the clip and zoom make sure the Presets is what you want (e.g. 16:9 to PAL)

  5. In transcode check the audio options so your language will be the only one or first. Select the container format (OGG, AVI, MPEG), then click on transcode and you will find after a while your file.

Example a 7 GByte movie DVD is converted to 6.4 GByte VOB files and then compressed to a 0.9 GByte OGG format 4:3.

Blueray

See https://wiki.archlinux.org/index.php/BluRay

Playing mplayer br:////run/media/<path to it> or mplayer -lavdopts threads=2 br:////run/media/<path to it> withpout / at the end.


Linurs Servernest startpage