VideoJack



VideoJack é um conceito baseado no JACK (Jack Audio Connection Kit) para enviar streams de vídeo entre softwares.




Português

Visão Geral

Primeiramente o VideoJack adiciona um novo tipo de porta: vídeo - assim como no áudio, temos entradas no jack e saídas do jack.

Três novos integrantes foram adicionados à porta de vídeo: int video_width, int video_height, e enum video_colorspace, que recebem valores iniciais 0, 0 e RGBA32.

Quando um cliente acessa com um input de entrada, ele é assinalado para um buffer de memória compartilhada, com dimensão de largura*altura*4 bytes (logo, inicialmente 0)

Quando um cliente acessa um output de saída, ele é linkado a um buffer. Inicialmente a memoria do buffer está vazia (frame-buffer sem preenchimento), até que o output consiga ler alguma fonte conectada na entrada input que ele está lendo obuffer.

O cliente de entrada deve definir a largura e altura do quadro para seu buffer antes de ser ativado, usando o jack_video_set_width_and_height() .

Por padrão o campo de cores é RGBA32.

Notas


Diferente do áudio, não existe uma função de mixer para o vídeo. Toda sobre-posição é feita no software que liga ao servidor, lendo e misturando dois ou mais frames de saída.

Isto significa que uma porta de entrada de vídeo pode ser conectada a apenas uma porta de saída. No entanto uma saída pode conectada a diversas entradas.

Existe também uma função para definir o espaço das cores. Isso somente deve ser feito em circunstâncias excepcionais, por exemplo quando todos clientes concordam em usar um tipo de espaço de cores especifico.

A Fazer


Haverá um contador de frames, que será escrito pelo cliente de entrada e lido pelo cliente(s) de saída para este determinado buffer.

O cliente do jack poder ser usado para sincronizar áudio e vídeo.

Clientes (Produtores/Consumidores)


Clientes de escrita no JackVideo:
rtsp (source)
unicap (v4l2/etc) (source) http://bekstation.bek.no//piksel/pikseldev/unicap_rcv.tar.bz2
LiVES (source)
jack_video_test_generator (source)
camorama(source)
Ekiga (source)

Clientes de leitura do JackVideo:
LiVES (sink)
jack_video_output (sink)

Clientes planejados:

net_send (sink)
net_receive (source)

pd_vjack_in (sink)
pd_vjack_out (source)


Um guia Rápido


1) Faça o download do código-fonte empacotado do jack aqui:
http://bekstation.bek.no/piksel/pikseldev/jack-vjack5.tar.bz2

Compile e instale.
./configure


make


make install


Certifique-se que você deletou todas as copias antigas do jack.


2) Edite seu arquivo ~/.jackdrc, mudando para:

/usr/bin/jackd --port-max 10 -d dummy -r 25 -p 10

(assumindo que voce instalou o jackd empacotado em /usr/bin)

3) Teste com a webcam - faça o download do pacote do camorama aqui:
http://bekstation.bek.no/piksel/pikseldev/camorama-vjack.tar.bz2

Compile e instale.

./configure


make


make install



Instalação do VideoJack no LiVES


Baixe o código fonte da última versão em http://lives.sf.net/index.php?do=downloads

Instale o LiVES com os seguinte comandos:

./configure --enable-vjack


make


make install



Lista de discussão e arquivos

https://www.bek.no/mailman/listinfo/videojack

English


OVERVIEW


First of all, videojack adds a new port type: video - as with audio
there are inputs to jack and outputs from jack.

There is a new port type: video.

Three new members are added to the video port:

int video_width, int video_height, and enum video_colorspace. These take initial
values 0,0 and RGBA32.

When a client joins as an input, it is assigned a shared memory buffer,
with a size of width*height*4 bytes (so initially 0).

When a client joins as an output, it is linked to a buffer. Initially
the buffer is a zero filled (blank frame buffer), until the output
connects to a video input, when it is linked to the input port's buffer.

The input client must set the frame width and height for its buffer after being activated, using jack_video_set_width_and_height().

The colorspace is set to default RGBA32.



NOTES


Unlike with audio, there is no mixdown function for video. All
mixing is done in the host application by reading and mixing two or
more output buffers.

This means that an output video port can only connect to a single input
port. However 1 input port can be connected to multiple outputs.

There is also a function to set the colorspace. This should only be done
in exceptional circumstances, for example when all clients agree to use
a private colorspace.

TODO


There will be frame count which is writable by the input client and readable by the output client(s) for that buffer.

For synchronisation of video and audio, the jack synch client can be used.

CLIENTS (PRODUCERS/CONSUMERS)


Existing clients
There currently exist clients for:

rtsp (source) needs re-working
unicap (v4l2/etc) (source) untested as yet

LiVES (source)
jack_video_test_generator (source)
camorama(source)

LiVES (sink)
jack_video_output (sink)


Planned clients

net_send (sink)
net_receive (source)

pd_vjack_in (sink)
pd_vjack_out (source)


ogg theora stream client (sink)



A quick HOWTO:


1) download the patched jack from here:
http://bekstation.bek.no/piksel/pikseldev/jack-vjack5.tar.bz2

compile and install it. Make sure you delete all older copies of jack !

(There is also now a site http://videojack.sourceforge.net).

Note: this is an unofficial patch of jack, and is not supported by the jack audio kit developers.



2) Back up your ~/.jackdrc file, and change it to:

/usr/bin/jackd --port-max 10 -d dummy -r 25 -p 10

(assuming you installed the patched jackd in /usr/bin)


And that's it !


Testing

The simplest test is to start up the jack_video_test_generator and connect it to the jack_video_output.

jack_video_test_generator &
jack_video_output &


jack_connect jack_video_test_generator:video_out jack_video_output:video_in


You should see test frames appearing.


If you compile qjackctrl against the patched libjack, you can simply connect the two clients in qjackctrl.


Another thing that can be done is to view the output of a webcam.

Download the patched version of camorama from here:
http://bekstation.bek.no/piksel/pikseldev/camorama-vjack.tar.bz2

compile and install it.


Plug in a USB webcam, and fire up the patched camorama. If you see output from the camera then all is well.

You can display frames from the camera by starting up jack_video_output, then:

jack_connect camorama:video_out jack_video_output:video_in


On the bekstation page there is also now a hacked version of ekiga which will run with videojack.


LiVES also has a videojack input and output. To use this, you need to compile LiVES with:

./configure --enable-vjack

make

sudo make install


The LiVES videojack input is actually compiled as a realtime generator, so you need to first attach it to a key. In LiVES, hit ctrl-v to go to the key mapping window. Then select the drop down list for key ctrl-1 mode 0 (The top mode). Select vjack_rcv. This maps it to key ctrl-1. Exit from the keymap window (you can save the keymap first if you wish).

Now press ctrl and 1. This will start the receiver ready for frames.

You can now connect various sources to the LiVES input, e.g.:

jack_connect camorama:video_out weed_receiver:video_in


You should see frames appearing in LiVES. You can mix the incoming frames with other clips and apply effects, even record the frames.




Mailing list and archives

https://www.bek.no/mailman/listinfo/videojack

Links


- Página do VideoJack: http://www.piksel.no/pwiki/VideoJack (em inglês).

- Página apresentando o conceito de Video Piping: http://www.piksel.no/pwiki/VideoPiping (em inglês).

- Wiki de desenvolvimento: http://www.piksel.no/pwiki/VjackDev (em inglês).

- E-mail que deu incício ao desenvolvimento do VideoJack (em inglês).

- Página do LiVES no Estudio Livre: http://estudiolivre.org/LiVES

- Site do LiVES: hhtp://lives.sf.net (em inglês).

Última alteração: 10/09/2009 às 04:16, por: pixel