Версия для печати

Архив документации на OpenNet.ru / Раздел "Операционные системы, Разное" (Многостраничная версия)

Pinnacle DC10 plus Howto и некоторые программы для работы с видео

english * | russian

Оригинал: genphys.phys.msu.su/~dmitriy
Автор: Дмитрий Кувшинов

  1. Pinnacle Studio DC10 Plus
  2. bigphysarea patch
  3. Xawtv и Motv
  4. Linux Video Studio
В этом тексте описывается установка Linux Video Studio (программы обрабоки видеофайлов под Linux), bigphysarea patch, Xawtv и Motv на ASPLinux9 c ядром 2.4.20-9, для карточки аппаратного видеозахвата Pinnacle Studio DC10 Plus на чипах zoran 36060 , 36067 и saa711. Все, что тут описано, работает при стандартной установке ASPLinux9(версия для разработки).

1) Чтобы установить карточку Pinnacle Studio DC10 Plus на чипах zoran 36060/67 и saa711 необходимо на mjpeg.sourceforge.net скачать driver-zoran-0.9.4.tar.gz и распаковать его, затем в файле zoran_driver.c(хачить драйвер необходимо для ядра редхата, в других линухах вроде работает без хака) строчку(под номером 4512)

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
изменить на строчку
#if 0

Далее установить исходники ядра и в файле /usr/src/[linux-version]/Makefile в строке 4 заменить

EXTRAVERSION = -9aspcustom
на
EXTRAVERSION = -9asptest 

или любое другое. Смысл с том, чтобы убрать custom(это важно!!! на custom не будет грузиться драйвер). Далее нужно сказать

make oldconfig dep clean bzImage modules modules_install install

Далее в файле /etc/X11/XF86Config в секции Module необходимо написать строчку, которая загрузит video4linux в X-сервер:

Load  "v4l"             # Video4Linux

После установки ядра нужно зайти в директорию driver-zoran-0.9.4, сказать make, после этого необходимо ввести строчку ./update dc10plus PAL и будут загружены стандартные драйвера для видеокарты. После загруки драйверов необходимо перезапустить X-сервер(или наладить автоматическую загрузку драйверов до запуска X-сервера) при помощи комбинаций клавиш Ctrl+Shift+BackSpace.

2) bigphysarea patch

Если Вам необходимо использовать xawtv или motv для видеозаписи или получать скриншоты в режиме overlay (без синих экранов :), то необходимо установить bigphysarea patch. Во время компилирования пропатченного ядра (а перед этим очень внимательного прочтения README, поставляющегося с ядерным патчем) выскочит ошибка, с комментариями, из которых следует, что в одном из файлов (будет сказано в каком) надо заменить в блоке #define malloc.h на slab.h. Далее надо собственно освободить память, дав при загрузке ядра команду:

mem=xxxM bigphysarea=4096
Как прописывать эту команде в загрузчике, сказано в описаниях к zoran_driver В ASPLinux9 же это делается так(кусок текста из /etc/aspldr.conf):
[linux1067443216@Linux(2.4.20-20.9observ)]
icon linux
kernel /boot/vmlinuz-2.4.20-20.9observ mem=235M bigphysarea=4096 root=/dev/hda6 ro
initrd /boot/initrd-2.4.20-20.9observ.img

где xxxM это разница в мегабайтах между размером оперативной памяти и памяти, которую Вы хотите высвободить для работы с видео. bigphysarea=4096 означает, что ядром будет выделено 16 мегабайт оперативной памяти для работы с буферами, использующимися для нужд оцифровки видео. После корректной загрузки системы вы можете проверить наличие свободной памяти

[vilfred@mobile100 vilfred]$ cat /proc/bigphysarea
Big physical area, size 4096 kB
                       free list:             used list:
number of blocks:             1                      0
size of largest block:     4096 kB                   0 kB
total:                     4096 kB                   0 kB
[vilfred@mobile100 vilfred]$
Для автзагрузки до запуска X в файле /etc/modules.conf надо явно указать размер буфера:
options zoran card=2 v4l_bufsize=4096
alias char-major-81-0 zoran
alias char-major-81 zr36067

Может сложиться, что у вас возникнут проблемы такого толка:

tail -f /var/log/messages:

Oct 19 16:54:52 mobile100 kernel: DC10plus[0]: v4l_set_format() - video
buffer size (128 kB) is too small
при kernet boot options
 bigphysarea=4096 

избежать этой ошибки можно, указав ядру параметром помимо bigphysarea=4096 дополнительную опцию mem=xxxM

Однако Ronald Bultje (rbultje[dig]ronald[point]bitfreak[point]net Linux Video/Multimedia developer), разработчик последней версии драйвера для dc10plus, предлагает пойти иным путем:

However, you need to "make clean && make" in the
driver sources to recompile it with bigphysarea support, too. 

т.е. эта ошибка (не позволяющая делать скриншоты в Xawtv и Motv при overlay) может быть вызвана тем, что после перекомпиляции ядра с поддержкой bigphysarea необходимо также перекомпилировать и zoran_driver, т.к. он был скомпилирован под прежнее ядро.

3) XawTv и Motv.

Для установки Xawtv и Motv необходимо сначала удалить родной для ASPLinux xawtv (т.к. он не содержит motv). Далее надо скачать c сайта XawTv последнюю версию программы xawtv (в исходники уже включен motv) и установить её. При установке родного xawtv может потребоваться библиотека sys/asoundlib.h, которая содержится в пакете alsa-lib-devel, поставляющемся ASPLinux (второй пакет нужен для совместимости):

[root@mobile100 video1]# rpm -Uhv alsa-lib-devel-0.9.6-1asp.i386.rpm 
alsa-driver-headers-0.9.6-1.9asp.i386.rpm
Подготовка...               ###########################################
[100%]
   1:alsa-driver-headers    ########################################### [ 50%]
   2:alsa-lib-devel         ########################################### [100%]
[root@mobile100 video1]#
Собственно все это выглядит как-то так:
XawTV Motv

4) Чтобы установить Linux Video Studio(http://ronald.bitfreak.net/) необходимо установить jpeg-mmx-0.1.4.tar.gz

после ./configure и make сказать make install, а затем сказать(это важно, установщик jpeg-mmx не копирует файл jpegint.h в директорию /usr/local/include/, а это необходимо программе libmovtar, которая, в свою очередь, необходима для mjpegtools, без которых не будет работать Linux Video Studio)

cp jpegint.h /usr/local/include/

далее нужно установить libmovtar-0.1.3.tar.gz и после этого установить mjpegtools-1.6.1.90.tar.gz

После проделанных операций необходимо установить linuxvideostudio-0.1.7 и заниматься полноценным записью и монтажем видео под Linux :)

Описанное наверняка пройдет и под другими версиями Linux.

Чтобы устроить броадкаст вещание в сети(локальной или internet) можно воспользоваться, например, програмным обеспечением palantir. Сервер под Linux и клиенты под Windows и Linux прилагаются.

Cергей Миридонов, автор самой первой версии драйвера для чипов zoran, пишет, что возможно использовать две программы для overlay и для записи видеофайлов:

On Thursday 18 September 2003 18:11, you wrote:


>>  А можно ли сделать так, чтобы повесить на 1 устройство
>> видеозахвата две(например) программы одновременно?
>> Допустим одна пишет, а другая параллельно ей overlay
>> осуществляет, чтобы конторлировать, что пишется на диск.
>> тоесть запустить одновременно xawtv и lavrec например?
>> Может быть вы где-то встречались с такими штуками?


В моём драйвере на 
http://www.cicese.mx/~mirsev/Linux/DC10plus/ такое можно 
делать, хотя никаких гарантий, что ничего не слетит - я 
дать не могу. Там это как durty hack было. У меня 
работало... Сначала надо запустить xawtv, чтобы смотреть, а 
потом - lavrec. Точно также можно было и смотреть видео с 
диска. 

Сейчас есть новый драйвер на 
http://mjpeg.sourceforge.net/driver-zoran/ Я его не писал и 
поэтому ничего определённого сказать не могу. Вообще, я его 
ещё не пробовал... Однако, если мне не изменяет память, там 
такая возможность закладывалась, а следовательно - должно 
быть сделано более аккуратно. Поэтому советую попробовать. 
Тем более, что мой драйвер с новыми ядрами может и не 
работать.

Сергей.

Linux Video Studio внешне выглядит примерно так:

Отдельное спасибо Алексею Крашенинникову за английскую версию этого howto.


Pinnacle DC10 plus Howto and some programs

english | russian

  1. Pinnacle Studio DC10 Plus
  2. bigphysarea patch
  3. Xawtv Х Motv
  4. Linux Video Studio
This text describes the Linux Video Studio *), bigphysarea patch, Xawtv and Motv installation process in ASPLinux9 (full RedHat9 compatible) with 2.4.20-9 kernel version for Pinnacle Studio DC10 Plus video capture card ( zoran 36060 , 36067 and saa711 chipsets). A standard installation of ASPLinux9 (developer environment) is assumed to complete the installation descibed here. *)Linux-based GPL video processing tool.

1) Pinnacle Studio DC10 Plus

Installation of Pinnacle Studio DC10 Plus card requires the driver-zoran-0.9.4.tar.gz to be downloaded from mjpeg.sf.net/driver-zoran/ and unpacked. Afterwards (in the case of RedHat kernel at least), in the zoran_driver.c file in the 4512-th line
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
should be replaced by
#if 0
Then you should install the kernel source-code and in the /usr/src/[linux-version]/Makefile on the 4-th line replace
EXTRAVERSION = -9aspcustom
with
EXTRAVERSION = -9asptest 

or any other value. The point of this action is the removal of the substring "custom". Otherwise the driver shall not load.

After that run

make oldconfig dep clean bzImage modules modules_install install
In the Module section of /etc/X11/XF86Config write a line that would load video4linux on the X-server:
Load  "v4l"             # Video4Linux

After kernel installation go to the driver-zoran-0.9.4 directory and run "make" and "./update dc10plus PAL" subsequently. The standard videocard drivers shall be loaded. Having the driver loaded you will have to restart the X-server (or achieve automatic driver load before the X-server starts) with help of Ctrl+Shift+BackSpace.

2) bigphysarea patch

If you need to use xawtv or motv for video capture and grab screenshots in the overlay mode (no blue screens , it's necessary to install the bigphysarea patch. During the compilation of the patched kernel (having THOROUGHLY read the README supplied with the kernel patch) there must be a warning message, telling you that in a certain file (shall be specified) you should replace malloc.h with slab.h in the #define section. By running

mem=xxxM bigphysarea=4096
during kernel load you will free (or allocate?) some extra memory. To find out how to add this command to the "auto-load scenario or startup list", read the zoran_driver manual. In the case of ASPLinux9 you may use the following (exerpts from /etc/aspldr.conf):
[linux1067443216@Linux(2.4.20-20.9observ)]
icon linux
kernel /boot/vmlinuz-2.4.20-20.9observ mem=235M bigphysarea=4096
root=/dev/hda6 ro
initrd /boot/initrd-2.4.20-20.9observ.img

where xxxM is the difference between full RAM-size and the size of the memory you wish to allocate (reserve) for video capture operations. bigphysarea=4096 means that the kernel will reserve 16Mb of RAM for video capture buffering. Having the system started correctly you may check the memory availability:

[user@host user]$ cat /proc/bigphysarea
Big physical area, size 4096 kB
                       free list:             used list:
number of blocks:             1                      0
size of largest block:     4096 kB                   0 kB
total:                     4096 kB                   0 kB
[user@host user]$
To autostart before the X, you must explicitly specify the buffer size in /etc/modules.conf:
options zoran card=2 v4l_bufsize=4096
alias char-major-81-0 zoran
alias char-major-81 zr36067
You may experience problems like
tail -f /var/log/messages:

Oct 19 16:54:52 host kernel: DC10plus[0]: v4l_set_format() - video
buffer size (128 kB) is too small
using the bigphysarea=4096 kernel boot option To avoid this error, use extra mem=xxxM option with bigphysarea=4096. However, Ronald Bultje (rbultje[at]ronald[dot]bitfreak[dot]net Linux Video/Multimedia developer), the developer of the latest dc10plus driver release suggests that
>> However, you need to "make clean && make" in the
>> driver sources to recompile it with bigphysarea support, too. 
i.e. this error (preventing you from making screenshots in overlay mode of Xawtv and Motv) may be caused by the fact that compiling the kernel with bigphysarea support you also need to recompile the zoran_driver, as is has been compiled for the previous kernel.

3) XawTv and Motv.

To install Xawtv and Motv you will first have to remove the native ASPLinux xawtv as it does not contain motv. Then you should download the latest version of XawTv from the developer's site (motv included in the source) and install it. Installing the native xawtv may require the sys/asoundlib.h library, which can be found in the alsa-lib-devel package supplied with ASPLinux9 (RedHat9) (the second package is required for compatibility):

[root@host video1]# rpm -Uhv alsa-lib-devel-0.9.6-1asp.i386.rpm 
alsa-driver-headers-0.9.6-1.9asp.i386.rpm
оНДЦНРНБЙЮ...               ########################################### [100%]
   1:alsa-driver-headers    ########################################### [ 50%]
   2:alsa-lib-devel         ########################################### [100%]
[root@host video1]#
This is what it looks like:
XawTV Motv

4) To install the Linux Video Studio(http://ronald.bitfreak.net/) you will have to install jpeg-mmx-0.1.4.tar.gz first.

After ./configure and make you should say make install, and then (that's important as the jpeg-mmx setup doesn't copy the jpegint.h to /usr/local/include/ that is required by libmovtar that is required for mjpegtools, necessary for the Linux Video Studio to operate):

cp jpegint.h /usr/local/include/

Then you will need to install libmovtar-0.1.3.tar.gz and mjpegtools-1.6.1.90.tar.gz consecutively.

Having the above listed actions performed you can install linuxvideostudio-0.1.7 linuxvideostudio-0.1.7 and let the Linux video capture and video editing fun begin.

The described above will probably work for other versions of Linux too.

To start broadcasting over the network (whether local or internet) you may use, e.g. the palantir software. The Linux and Windows server installations included.

Serguei Miridonov, the developer of the zoran chip driver writes that you can use two programs for overlay and to capture video to a file.

>> Is it possible to assign two video capture programs to
>> a single capturing device simultaneously?
>> Suppose one of them writing to a file, while the other
>> performing overlay to control what is being written to the disk,
>> that is to start xawtv and lavrec at the same time as an example?
>> Maybe you have already seen such things?
>
> 
> My driver at
> http://www.cicese.mx/~mirsev/Linux/DC10plus/ allows such
> operations, though I cannot guarantee that nothing will ever fail
> It was a sort of dirty hack there. It worked for me...
> You need to start xawtv to Нbserve first, and then the
> lavrec. The very same way you could watch (playback) video from a disk
>
> There is a new driver at
> http://mjpeg.sourceforge.net/driver-zoran/ now. I didn't participate
> in it, so there's nothing I can say about it definitely. Actually, I
> haven't tried it yet. Although, unless my memory fails me, such an
> ability must have been included, thus it must have been developed
> more carefully. So I advise you to try.
>
> Moreover, my driver may not be working with new kernels.
> 
> Sergey.

The Linux Video Studio looks like this:

Thanks for Alexey Krasheninnikov for english version of this howto.