OVH Cloud OVH Cloud

Developpement: v4l et lecture...

5 réponses
Avatar
Laurent Pointal
[maintenant que mon système chrooté fonctionne]


J'utilise v4l (pas en v2) pour récupérer des images d'une BT848A (sur
PC104 mezzanine).

Ouvertude du /dev/video0 en mode O_RDWR.

Avec les ioctl ad-hoc, je peux récupérer les video_capability de la
carte, parcourir les 4 video_channel et consulter le video_tuner du
canal 0 (Television). Nickel.

Je réussi à activer le bon canal, à passer le tuner en PAL pour
correspondre à mon entrée (tests avec xawtv)

Je réussi à fixer la taille de la fenêtre de capture.

Maintenant, je voudrais simplement lire des images via un appel à read
avec le descripteur de fichiers, l'adresse de mon buffer, et sa taille.
Mais...

Le ioctl VIDIOCCAPTURE pour activer la capture échoue en errno 22
(Invalid argument).

Idem pour l'appel à read, errno 22 (Invalid argument). Pourtant je lui
passe bien mon descripteur de fichiers, buffer, taille...


Q? Le VIDIOCCAPTURE est-il vraiment nécessaire (je ne l'ai pas vu dans
les exemples de sources que j'ai pu récupérer) ?

Q? Est-ce que certaines cartes peuvent ne pas supporter l'opération read
(obligation de passer par un mapping mémoire frame ram) ?

Note: Je calcule la taille du buffer: largeur * hauteur * nb d'octets
par pixels. En l'occurence quand j'utilise la dimension la plus petite:
video_capability.minwidth: 48
video_capability.minheight: 32
video_picture.palette: 4
m_vpic.palette: VIDEO_PALETTE_RGB24
Buffer video: 48x32 x 3bytespp ==> 4608 octets

[les exemples que j'ai pu voir calculent la mémoire vidéo en largeur *
hauteur * nombre de bits par pixels (donc 8 fois plus) - ça mes semble
un bug]


Des idées?

Merci.


Au cas où ça serait lié aux capacités de ma carte... les voici:
video_capability.type: 0xeb
video_capability.type: VID_TYPE_CAPTURE
video_capability.type: VID_TYPE_TUNER
video_capability.type: VID_TYPE_OVERLAY
video_capability.type: VID_TYPE_CLIPPING
video_capability.type: VID_TYPE_FRAMERAM
video_capability.type: VID_TYPE_SCALES

A+

Laurent.

--
Pour contacter l'équipe de modération : moderateurs-fcolm@efrei.fr
ATTENTION: Postez DIRECTEMENT vos articles dans le groupe, PAS dans
la liste de distribution des modérateurs.

5 réponses

Avatar
Thomas Labourdette
Laurent Pointal a écrit le jeudi 16 Décembre 2004 17:10 :


Le ioctl VIDIOCCAPTURE pour activer la capture échoue en errno 22
(Invalid argument).



Que lui passes-tu comme argument ?

Idem pour l'appel à read, errno 22 (Invalid argument). Pourtant je lui
passe bien mon descripteur de fichiers, buffer, taille...


Q? Le VIDIOCCAPTURE est-il vraiment nécessaire (je ne l'ai pas vu dans
les exemples de sources que j'ai pu récupérer) ?



Non (du moins je ne l'ai jamais utilisé)

Q? Est-ce que certaines cartes peuvent ne pas supporter l'opération read
(obligation de passer par un mapping mémoire frame ram) ?



D'après la doc, oui certaines cartes peuvent ne pas supporter read.


Note: Je calcule la taille du buffer: largeur * hauteur * nb d'octets
par pixels.



La taille du buffer est donné par l'ioctl VIDIOCGMBUF et le champ size de
video_mbuf

@+
--
Sébastien, Pascal ARIEN-NADIRKAVASTAIRE (Séba, Pascal...) (signature
aléatoire)
"Si tu invites des gens qui ont tous le même groupe sanguin à une fête,
mais que tu le leur dis pas, ils vont parler d'autre chose."
Jean-Claude V.

--
Pour contacter l'équipe de modération :
ATTENTION: Postez DIRECTEMENT vos articles dans le groupe, PAS dans
la liste de distribution des modérateurs.
Avatar
Laurent Pointal
Thomas Labourdette wrote:
Laurent Pointal a écrit le jeudi 16 Décembre 2004 17:10 :

Le ioctl VIDIOCCAPTURE pour activer la capture échoue en errno 22
(Invalid argument).



Que lui passes-tu comme argument ?



[de mémoire, je viens de couper la connexion]
l'adresse d'un entier qui contient 1...

Idem pour l'appel à read, errno 22 (Invalid argument). Pourtant je lui
passe bien mon descripteur de fichiers, buffer, taille...
Q? Le VIDIOCCAPTURE est-il vraiment nécessaire (je ne l'ai pas vu dans
les exemples de sources que j'ai pu récupérer) ?


Non (du moins je ne l'ai jamais utilisé)

Q? Est-ce que certaines cartes peuvent ne pas supporter l'opération read
(obligation de passer par un mapping mémoire frame ram) ?


D'après la doc, oui certaines cartes peuvent ne pas supporter read.
Note: Je calcule la taille du buffer: largeur * hauteur * nb d'octets
par pixels.


La taille du buffer est donné par l'ioctl VIDIOCGMBUF et le champ size de
video_mbuf



Même pour faire un simple read ?
(les exemples que j'ai pu voir ne l'utilisent pas).


Entre temps, je viens de trouver libbgrab, qui fait de la récup dans un
thread avec triple-buffering et rend l'image dispo lorsqu'on en a
besoin... je ferais un petit test avec le champs video-mbuf, mais si ça
marche pas je crois que je vais creuser un peu plus la piste libbgrab.

A+, et merci.

Laurent.


@+



--
Pour contacter l'équipe de modération :
ATTENTION: Postez DIRECTEMENT vos articles dans le groupe, PAS dans
la liste de distribution des modérateurs.
Avatar
Laurent Pointal
fresh pre-mie; eviscerated, head, hands and feet removed
Onions, bell pepper, celery
½ cup wine
Root vegetables of choice (turnips, carrots, potatoes, etc) cubed

Make a crust from scratch - or go shamefully to the frozen food section
of your favorite grocery and select 2 high quality pie crusts (you
will need one for the top also).
Boil the prepared delicacy until the meat starts to come off the bones.
Remove, de-bone and cube; continue to reduce the broth.
Brown the onions, peppers and celery.
Add the meat then season, continue browning.
De-glaze with sherry, add the reduced broth.
Finally, put in the root vegetables and simmer for 15 minutes.
Allow to cool slightly.
Place the pie pan in 375 degree oven for a few minutes so bottom crust is not soggy,
reduce oven to 325.
Fill the pie with stew, place top crust and with a fork, seal the crusts together
then poke holes in top.
Return to oven and bake for 30 minutes, or until pie crust is golden brown.



Sudden Infant Death Soup

SIDS: delicious in winter, comparable to old fashioned Beef and Vegetable Soup.
Its free, you can sell the crib, baby clothes, toys, stroller... and so easy to
procure if such a lucky find is at hand (just pick him up from the crib and
he?s good to go)!

SIDS victim, cleaned
½ cup cooking oil
Carrots
onions
broccoli
whole cabbage
fresh green beans
potato
turnip
celery
tomato
½ stick butter
1 cup cooked pasta (macaroni, shells, etc.)

Remove as much meat as possible, cube, and brown in hot oil.
Add a little water, season, then add the carcass.
Simmer for half an hour keeping the stock thick.
Remove the carcass and add the vegetables slowly to the stock,
so that it remains boiling the whole time.
Cover the pot and simmer till vegetables are tender
(2
Avatar
Laurent Pointal
the sauce over the cutlets,
top with parsley, lemon slices and cracked pepper.
Serve with spinach salad, macaroni and cheese (homemade) and iced tea...



Spaghetti with Real Italian Meatballs

If you don?t have an expendable bambino on hand,
you can use a pound of ground pork instead.
The secret to great meatballs, is to use very lean meat.

1 lb. ground flesh; human or pork
3 lb. ground beef
1 cup finely chopped onions
7 - 12 cloves garlic
1 cup seasoned bread crumbs
½ cup milk, 2 eggs
Oregano
basil
salt
pepper
Italian seasoning, etc.
Tomato gravy (see index)
Fresh or at least freshly cooked spaghetti or other pasta

Mix the ground meats together in a large bowl,
then mix each of the other ingredients.
Make balls about the size of a baby?s fist
(there should be one lying around for reference).
Bake at 400°for about 25 minutes -
or you could fry them in olive oil.
Place the meatballs in the tomato gravy, and simmer for several hours.
Serve on spaghetti.
Accompany with green salad, garlic bread and red wine.



Newborn Parmesan

This classic Sicilian cuisine can easily be turned into Eggplant Parmesan
If you are planning a vegetarian meal. Or you could just as well use veal -
after all, you have to be careful - Sicilians are touchy about their young
family members...

6 newborn or veal cutlets
Tomato gravy (see index)
4 cups mozzarella, 1cup parmesan, 1cup romano
Seasoned bread crumbs mixed with
parmesan
romano
salt
pepper
oregano
garlic powder
chopped parsley
F
Avatar
Thomas Labourdette
pepper
garlic powder
cayenne pepper
hot sauce, etc.
Oil for frying

Mix milk, eggs, hot sauce in a bowl, add chopped onion and garlic.
Season the meat liberally, and marinate for several hours.
Place seasoned flour in a paper or plastic shopping bag,
drop pieces in a few a time, shake to coat thoroughly,
then deep fry in hot oil (350°) for about 15 minutes.
Drain and place on paper towels.



Miscarriage with Mustard Greens

Why waste it? Otherwise, and in general, use ham or salt pork to season greens.
The technique of smothering greens can be used with many vegetables;
green beans work especially well. Meat is not necessary every day, don?t
be afraid to alter any dish to vegetarian tastes.

1 premature baby, born dead
Large bunch of mustard greens
2 white onions, 1 cup chopped celery
Vegetable oil (or hog fat)
Salt, pepper, garlic, etc.

Lightly brown onions, celery, garlic and meat in large heavy pot.
Add a little water and the greens (which should be thoroughly cleaned and washed).
Smother slowly for at least 2 hours, adding small amounts of water
when it starts to stick.
Stir frequently.
When ready - serve with rice, grilled smoked sausage, green salad, and iced tea.
Coffee and apple pie then brandy.



Maternity Ward Pot Luck Dinner

If you can?t get anything fresh from the hospital, nursery, or morgue;
you can at least get rid of all the leftovers in your refrigerator.

1 - 2 lbs. cubed meat (human flesh, chicken, turkey, beef...)
1 -2 lbs. coarsely chopped vegetables
(carrots, potatoes, turnips, cauliflower, cabbage...)
Bell pepper
onions
garlic
ginger
salt pepper, etc.
Olive oil
butter

Brown the meat and some chopped onions, peppers, and garilic in olive oil,
place in baking dish, layer with vegetables seasoning and butter.
Bake at 325° for 30 - 45 minutes.
Serve with hot dinner rolls, fruit salad and s