Tonight I gave a presentation at Android Montreal about the AsyncTasks API, for the Android platform.
Although the main content was « said » during the presentation, you can download the support :
Finally !
During a long period of calm, I finally released a new version (with new features) of the Android client for remote galleries Gallery2 (your photos on your website), G2Android.
If you have a look at the G2Android project homepage, you will see that the following issues (bug and enhancements) have been closed :
Version 1.5.0, 19th of July 2010 Major release
issue #33 Enable uploaded photo title modification
issue #41 Malformed Gallery 2 URL leads to G2Android forced close
The major new feature is clearly the « add photo to gallery » feature : I created a new Activity, UploadPhoto , which can be called from 2 external intents :
So now the user can send a new photo or a batch of photos from another application, the android gallery app for example; the big work was then to decode the URIs of the photos to find the photo file on the phone, and then send it to the gallery; also I had to make sure that the user is still connected to the gallery, if not, he must login again.
Also, the user is now able to take a picture and send it to his gallery, without leaving g2android; this has been done adding the camera permission in the AndroidManifest.xml :
This is the easy part
Then, when your app receive a photo from the Camera, it does not receive an URI pointing to a photo file; nope, you get a Bitmap object you have transform into a file, to be able to send it to the remote gallery :
I also optimized the application, issue #37 (Uploaded photo looses .jpg file extension) was in fact due to the fact that I re created the photo file before sending it; instead of using a projection of the URI to get its path on the phone :
Also shipping with this new version, Chinese i18n thanks to the chinese android market, GoAPK and also new art from Dan, who just posted a comment to the blog proposing to add new art; thanks again to you both ! You make the application richer !
So now, what remains to be done ? well, the compatibility with Gallery3, as the G3 remote API is almost stable now, thanks to the work of Bharat, Tim, and many others; a java implementation is already under work, I will check if I can use it instead of… re inventing the wheel !
More details to come, for sure !
You can download G2Android from the Android Market, SlideMe, Applibs, etc.. and also from the G2Android project homepage
.
Enjoy this app as much as I enjoy working on it, and if you like it, don’t forget to flattr me !
Depuis la libération du codec VP8 (et de son conteneur WebM) de ON2 technologies par Google en Mai 2010, la communauté open source (et les amateurs de video !) a trouvé le digne remplaçant de theora, finalement peu performant, et surtout un adversaire de poids face au codec video breveté et certainement pas standard h264.
Cet article a pour but d’expliquer comment :
installer ffmpeg avec le support de webm sur Ubuntu
encoder une vidéo au format webm
lire une vidéo au format webm
Installer ffmpeg avec le support de webm sur Ubuntu
Récupération des sources, compilation et installation de x264 (optionnel, si vous voulez aussi encoder en x264) sous forme de paquets pour votre système (checkinstall wrappe « make install » en installant en plus le binaire obtenu sous forme de paquets debian dans votre système)
cd
git clone git://git.videolan.org/x264.git
cd x264
./configure
makesudo checkinstall --pkgname=x264 --pkgversion"2:0.`grep X264_BUILD x264.h -m1 | cut -d' ' -f3`.`git rev-list HEAD | wc -l`+git`git rev-list HEAD -n 1 | head -c 7`"--backup=no --default
Récupération des sources, compilation et installation de VP8, librairie nommée libvpx sous forme de paquets pour votre système (checkinstall wrappe « make install » en installant en plus le binaire obtenu sous forme de paquets debian dans votre système)
cd
git clone git://review.webmproject.org/libvpx.git
cd libvpx
./configure
makesudo checkinstall --pkgname=libvpx --pkgversion="`date +%Y%m%d%k%M`-git"--backup=no --nodoc--default
Récupération des sources, compilation et installation de ffmpeg (enfin!)sous forme de paquets pour votre système (checkinstall wrappe « make install » en installant en plus le binaire obtenu sous forme de paquets debian dans votre système, à noter que pour ffmpeg vous aurez une erreur lors du checkinstall, qui n’empêchera pas l’installation d’aboutir)
Si vous avez installé x264, vous pouvez ajouter comme ci dessous ajouter le support x264 à ffmpeg : –enable-libx264 ; à noter que l’option –enable-libvpx vous donnera accès à l’encodage webm
Alors il est vrai que c’est toujours plus simple d’installer des paquets avec apt-get install que de compiler des sources, mais le support de webm dans ffmpeg est à ce jour tellement récent que vous ne trouverez pas de paquets pour votre distribution !
Encoder vos vidéos en webm avec ffmpeg
Rien de plus simple !
ffmpeg-i input.avi -threads2 output.webm
(sauf qu’il semnlearait que le -threads 2, supposé donner 2 threads à ffmpeg, utile pour les dual core, ne soit pas supporté, à ce jour, pour webm)
Lire vos vidéos encodées en webm
Avec ffplay
Vous avez déjà installé précédemment ffmplay :
ffplay output.webm
Avec vlc
Vous pouvez aussi les lire avec la dernière version de VLC, à date, la version 1.1.0; il vous faut ajouter un nouveau repo avec les dernières version de vlc, enlever votre version actuelle et ré installer vlc :