Différences entre versions de « RASP-PiTFT-Video »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 5 : Ligne 5 :
 
== Comment jouer une vidéo ==
 
== Comment jouer une vidéo ==
  
You can play many types of videos on the screen, using mplayer you don't even need to run X and you can script the movies to play using Python. We'll show you how to just play one video for now.
+
Vous pouvez jouer de nombreux types de vidéo sur cet écran. En utilisant '''mplayer''' vous n'avez même pas besoin de démarrer l'environnement X et vous pouvez écrire des script Python pour afficher les films.  
To demo, we'll use an mp4 of Big Buck Bunny for 320 pixel wide screens. Below we show you how to create/resize videos, but to make it easy, just download our version with:
+
 
 +
Cette page vous montre comment jouer une vidéo.
 +
 
 +
Pour cette démo, nous allons utiliser la vidéo mp4 de "Big Buck Bunny" adapté à la largeur de votre écran (320 pixels/points). Ensuite, nous vous montrerons comment créer/redimensionne une vidéo.
 +
 
 +
Pour simplifier les étapes, nous vous proposons de télécharger la version préparée par AdaFruit:
  
 
  <nowiki>wget http://adafruit-download.s3.amazonaws.com/bigbuckbunny320p.mp4</nowiki>
 
  <nowiki>wget http://adafruit-download.s3.amazonaws.com/bigbuckbunny320p.mp4</nowiki>
  
{{ambox-stop|text=The video is 30MB which is a lot if you haven't expanded your SD card yet. Before you do this, run sudo raspi-config to expand the SD card so you don't run out of space!}}
+
{{ambox-stop|text=Cette vidéo fait 30MB, ce qui beaucoup si vous n'avez pas étendu votre système de fichier sur la carte SD. Avant, vous devriez exécuter un '''sudo raspi-config''' pour étendre le système de fichier (expand Root FileSystem) afin de ne pas tomber à court d'espace!}}
  
If you don't have '''mplayer''' yet, run '''sudo apt-get install mplayer''' to install it. It may take a few minutes to complete
+
Si vous n'avez pas encore installé '''mplayer''', exécutez la commande suivante pour l'installer '''sudo apt-get install mplayer'''. Cette opération nécessite quelques minutes.
  
 
{{ADFImage|RASP-PiTFT-Video-01.png|480px}}
 
{{ADFImage|RASP-PiTFT-Video-01.png|480px}}
  
OK now you just have to run
+
Voila, maintenant, il ne reste plus qu'a exécuter:
  
 
  <nowiki>mplayer -vo fbdev2:/dev/fb1 -x 240 -y 320 -framedrop bigbuckbunny320p.mp4</nowiki>
 
  <nowiki>mplayer -vo fbdev2:/dev/fb1 -x 240 -y 320 -framedrop bigbuckbunny320p.mp4</nowiki>
  
if your video is not sized for 320 wide, you may need to add a -zoom after -framedrop so that it will resize - note that this is quite taxing for the Pi, so it may result in a choppy or mis-synced video!
+
Si votre vidéo n'est pas redimensionnée à 230 pixels de large, vous aurez besoin d'ajouter le paramètre -zoom après -framedrop pour faire une mise à dimension à la volée. Notez que cette opération nécessite beaucoup de ressources... ce qui pourrait provoquer un affichage saccadé ou soucis de synchronisation!
 
   
 
   
 
[http://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/playing-videos la suite)
 
[http://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/playing-videos la suite)

Version du 19 décembre 2013 à 11:40


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

RASP-PiTFT-04.jpg
Crédit: AdaFruit Industries www.adafruit.com

Comment jouer une vidéo

Vous pouvez jouer de nombreux types de vidéo sur cet écran. En utilisant mplayer vous n'avez même pas besoin de démarrer l'environnement X et vous pouvez écrire des script Python pour afficher les films.

Cette page vous montre comment jouer une vidéo.

Pour cette démo, nous allons utiliser la vidéo mp4 de "Big Buck Bunny" adapté à la largeur de votre écran (320 pixels/points). Ensuite, nous vous montrerons comment créer/redimensionne une vidéo.

Pour simplifier les étapes, nous vous proposons de télécharger la version préparée par AdaFruit:

wget http://adafruit-download.s3.amazonaws.com/bigbuckbunny320p.mp4

Si vous n'avez pas encore installé mplayer, exécutez la commande suivante pour l'installer sudo apt-get install mplayer. Cette opération nécessite quelques minutes.

RASP-PiTFT-Video-01.png
Crédit: AdaFruit Industries www.adafruit.com

Voila, maintenant, il ne reste plus qu'a exécuter:

mplayer -vo fbdev2:/dev/fb1 -x 240 -y 320 -framedrop bigbuckbunny320p.mp4

Si votre vidéo n'est pas redimensionnée à 230 pixels de large, vous aurez besoin d'ajouter le paramètre -zoom après -framedrop pour faire une mise à dimension à la volée. Notez que cette opération nécessite beaucoup de ressources... ce qui pourrait provoquer un affichage saccadé ou soucis de synchronisation!

[http://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/playing-videos la suite)

RASP-PiTFT-04.jpg
Crédit: AdaFruit Industries www.adafruit.com

Convertir et redimensionner une fenêtre

It's possible to play full length videos on the TFT plate, but since the screen is small and the Pi cant use hardware accelleration to play the videos its best to scale them down to 320x240 pixels. This will be easier for the Pi to play and also save you tons of storage space. For this demo, we'll be using the famous Big Buck Bunny video, which is creative commons and also very funny!

You can download it from the link above, we'll be using the 720p AVI version.

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com

To do the conversion itself, we suggest HandBrake which works great and is open source so it runs on all operating systems! Download and install from the link. Then run the installed application and open up the AVI file from before. The app will pre-fill a bunch of information about it.

RASP-PiTFT-11.png
Crédit: AdaFruit Industries www.adafruit.com

Under Destination click Browse... to select a new MP4 file to save. Then under Picture change the Width to 320 (the height will be auto-calculated)

RASP-PiTFT-12.png
Crédit: AdaFruit Industries www.adafruit.com

Click START to begin the conversion, it will take a minute or two.

RASP-PiTFT-13.png
Crédit: AdaFruit Industries www.adafruit.com

That's it! You now have a smaller file. Don't forget to play it on your computer to make sure it plays right before copying it to your Pi


Source: Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi
Créé par LadyAda pour AdaFruit Industries.
Augmenté par Meurisse D. pour MCHobby

Traduction réalisée par Meurisse D pour MCHobby.be.

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com