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

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 5 : Ligne 5 :
 
{{ADFImage|RASP-PiTFT-PLUS-Video-11.jpg|640px}}
 
{{ADFImage|RASP-PiTFT-PLUS-Video-11.jpg|640px}}
  
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 afficher de nombreux types de vidéo sur l'écran, en utilisant {{fname|mplayer}} vous n'avez même pas besoin d'utiliser l'environnement graphique du Bureau, vous pouvez utiliser un script Python pour jouer des vidéos. Nous allons vous montrer comment jouer une vidéo pour l'instant.
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:
+
 
 +
Pour réaliser la démo, nous allons utiliser la vidéo mp4 de ''Big Buck Bunny'' pour un écran de 320 pixels de large. Plus bas, dans le tutoriel, vous trouverez les informations nécessaires pour créer/redimensionner une telle vidéo mais pour faire simple, vous pouvez télécharger la version 320px d'Adafruit depuis le lien suivant:
  
 
  <nowiki>wget http://adafruit-download.s3.amazonaws.com/bigbuckbunny320p.mp4</nowiki>
 
  <nowiki>wget http://adafruit-download.s3.amazonaws.com/bigbuckbunny320p.mp4</nowiki>
  
{{ambox|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|text=La vidéo fait 30 Mb, ce qui est assez énorme, surtout si vous n'avez pas encore étendu le système de fichier sur votre carte SD. Faites donc un {{fname|sudo raspi-config}} pour étendre le système de fichier!}}
  
If you don't have mplayer yet, run
+
Si vous n'avez la encore {{fname|mplayer}}, vous pouvez l'installer avec les commandes suivantes
  
 
  <nowiki>sudo apt-get update
 
  <nowiki>sudo apt-get update
Ligne 18 : Ligne 19 :
 
sudo apt-get install mplayer</nowiki>
 
sudo apt-get install mplayer</nowiki>
  
to install it. It may take a few minutes to complete
+
Cela pourrait prendre quelques minutes pour terminer l'installation.
  
 
{{ADFImage|RASP-PiTFT-PLUS-Video-10.png}}
 
{{ADFImage|RASP-PiTFT-PLUS-Video-10.png}}
  
OK now you just have to run:
+
Pour lancer la vidéo, il faut juste saisir:
  
 
  sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 mplayer -vo sdl -framedrop bigbuckbunny320p.mp4
 
  sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 mplayer -vo sdl -framedrop bigbuckbunny320p.mp4
  
If your video is not sized for 320 wide, you may need to add a {{fname|-zoom}} after {{fname|-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 la vidéo ne fait pas 320 pixels de large alors vous pourriez ajouter un paramètre {{fname|-zoom}} après {{fname|-framedrop}} de façon à redimensionner la vidéo à la volée - notez que cela consomme beaucoup de ressource sur le Pi et que vous rencontrerez certainement des problèmes de fluidité!
  
 
{{ADFImage|RASP-PiTFT-PLUS-Video-11.jpg|640px}}
 
{{ADFImage|RASP-PiTFT-PLUS-Video-11.jpg|640px}}

Version du 4 mai 2018 à 10:36


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.

Afficher des vidéos

RASP-PiTFT-PLUS-Video-11.jpg
Crédit: AdaFruit Industries www.adafruit.com

Vous pouvez afficher de nombreux types de vidéo sur l'écran, en utilisant mplayer vous n'avez même pas besoin d'utiliser l'environnement graphique du Bureau, vous pouvez utiliser un script Python pour jouer des vidéos. Nous allons vous montrer comment jouer une vidéo pour l'instant.

Pour réaliser la démo, nous allons utiliser la vidéo mp4 de Big Buck Bunny pour un écran de 320 pixels de large. Plus bas, dans le tutoriel, vous trouverez les informations nécessaires pour créer/redimensionner une telle vidéo mais pour faire simple, vous pouvez télécharger la version 320px d'Adafruit depuis le lien suivant:

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

Si vous n'avez la encore mplayer, vous pouvez l'installer avec les commandes suivantes

sudo apt-get update

sudo apt-get install mplayer

Cela pourrait prendre quelques minutes pour terminer l'installation.

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

Pour lancer la vidéo, il faut juste saisir:

sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 mplayer -vo sdl -framedrop bigbuckbunny320p.mp4

Si la vidéo ne fait pas 320 pixels de large alors vous pourriez ajouter un paramètre -zoom après -framedrop de façon à redimensionner la vidéo à la volée - notez que cela consomme beaucoup de ressource sur le Pi et que vous rencontrerez certainement des problèmes de fluidité!

RASP-PiTFT-PLUS-Video-11.jpg
Crédit: AdaFruit Industries www.adafruit.com

Convertir/redimensionner des vidéos

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-PLUS-Video-21.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-PLUS-Video-22.png
Crédit: AdaFruit Industries www.adafruit.com

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

RASP-PiTFT-PLUS-Video-23.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 3.5" Touch Screen for Raspberry Pi
Créé par LadyAda pour AdaFruit Industries.

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