Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (66)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

Sur d’autres sites (7859)

  • Playing Video on a Sega Dreamcast

    9 mars 2011, par Multimedia Mike — Sega Dreamcast

    Here’s an honest engineering question : If you were tasked to make compressed video play back on a Sega Dreamcast video game console, what video format would you choose ? Personally, I would choose RoQ, the format invented for The 11th Hour computer game and later used in Quake III and other games derived from the same engine. This post explains my reasoning.

    Video Background
    One of the things I wanted to do when I procured a used Sega Dreamcast back in 2001 was turn it into a set-top video playback unit. This is something that a lot of people tried to do, apparently, to varying degrees of success. Interest would wane in a few years as it became easier and easier to crack an Xbox and install XBMC. The Xbox was much better suited to playing codecs that were getting big at the time, most notably MPEG-4 part 2 video (DivX/XviD).

    The Dreamcast, while quite capable when it was released in 1999, was not very well-equipped to deal with an MPEG-type codec. I have recently learned that there are other hackers out there on the internet who are still trying to get the most out of this system. I was contacted for advice about how to make Theora perform better on the Dreamcast.

    Interesting thing about consoles and codecs : Since you are necessarily distributing code along with your data, you have far more freedom to use whatever codecs you want for your audio and video data. This is why Vorbis and even Theora have seen quite a bit of use in video games, "internet standards" be darned. Thus, when I realized this application had no hard and fast requirement to use Theora, and that it could use any codec that fit the platform, my mind started churning. When I was programming the DC 10 years ago, I didn’t have access to the same wealth of multimedia knowledge that is currently available.

    Requirements Gathering
    What do we need here ?

    • Codec needs to run on the Sega Dreamcast ; this eliminates codecs for which only binary decoder implementations are available
    • Must decode 320x240 video at 30 fps ; higher resolutions up to 640x480 would be desirable
    • Must deliver decent quality at 12X optical read speeds (DC drive speed)
    • There must be some decent, preferably free, encoder readily available ; speed of encoding, however, is not important ; i.e., "take as long as you need, encoder"

    Theora was the go-to codec because it’s just commonly known as "the free, open source video codec". But clearly it’s not suitable for, well... any purpose, really (sorry, easy target ; OW ! stop throwing things !). VP8/WebM — Theora’s heir apparent — would not qualify either, as my prior experiments have already demonstrated.

    Candidates
    What did the big boys use for video on the Dreamcast ? A lot of games relied on CRI’s Sofdec middleware which was MPEG-1 video and a custom ADPCM format. I don’t know if I have ever seen DC games that used MPEG-1 video at a higher resolution than 320x240 (though I have not searched exhaustively). The fact that CRI used a custom ADPCM format for this application may indicate that there wasn’t enough CPU power left over to decode a perceptual, transform-based audio codec alongside the 320x240 video.

    A few other DC games used 4X Technologies’ 4XM format. The most notable licensee was Alone in the Dark : The New Nightmare (DC version only ; PC version used Bink). This codec was DCT-based but incorporated 16-bit RGB colorspace into its design, presumably to optimize for applications like game consoles that couldn’t directly handle planar YUV. AITD:TNN’s videos were 640x360, a marked improvement over the typical Sofdec fare. I was about to write off 4XM as a contender due to lack of encoder, but the encoding tools are preserved on our samples site. A few other issues, though : The FFmpeg decoder doesn’t seem to work correctly as of this writing (and nobody has noticed yet, even though it’s tested via FATE).

    What ideas do I have ? Right off the bat, I’m thinking vector quantizer (VQ). Vector quantizers are notoriously slow to compress but are blazingly fast to decompress which is why they were popular in the early days of video compression. First, there’s Cinepak. I fear that might be too simple for this application. Plus, I don’t know if existing (binary-only) compressors are very decent. It seems that they only ever had to handle small videos and I’ve heard that they can really fall over if anything more is demanded of them.

    Sorenson Video 1 is another contender. FFmpeg has an encoder (which some allege is better than Sorenson’s original compressor). However, I fear that the wonky algorithm and colorspace might not mesh well with the Dreamcast.

    My thinking quickly converged on RoQ. This was designed to run fullscreen (640x480) video on i486-class hardware. While RoQ fundamentally operates in a YUV colorspace, it’s trivial to convert it to any other colorspace during decoding and the image will be rendered in that colorspace. Plus, there are open source encoders available for the format (namely, several versions of Eric Lasota’s Switchblade encoder, one of which lives natively in FFmpeg), as well as the original proprietary encoder.

    Which Library ?
    There are several code choices here : FFmpeg (LGPL), Switchblade (GPL), and the original Quake 3 source code (GPL). There is one more option that I think might be easiest, which is the decoder Dr. Tim created when he reverse engineered the format in the first place. That has a very liberal "do whatever you like, but be nice and give me credit" license (probably qualifies as BSD).

    This code is no longer at its original home but the Wayback Machine still had a copy, which I have now mirrored (idroq.tar.gz).

    Adaptation
    Dr. Tim’s code still compiles and runs great on Linux (64-bit !) with SDL output. I would like to get it ported to the Dreamcast using the same SDL output, which KallistiOS supports. Then, there is the matter of fixing the longstanding chroma bug in the original sample decoder (described here). The decoder also needs to be modified to natively render RGB565 data, as that will work best with the DC’s graphics hardware.

    After making the code work, I want to profile it and test whether it can handle full-frame 640x480 playback at 30 frames/second. I will need to contrive a sample to achieve this.

    Unfortunately, things went off the rails pretty quickly when I tried to get the RoQ decoder ported to DC/KOS. It looks like there’s a bug in KallistiOS’s minimalistic standard C library, or at least a discrepancy with my desktop Linux system. When you read to the end of a file and then seek backwards to someplace that isn’t the end, is the file still in EOF state ?

    According to my Linux desktop :

    open file ;          feof() = 0
    seek to end ;        feof() = 0
    read one more byte ; feof() = 1
    seek back to start ; feof() = 0
    

    According to KallistiOS :

    open file ;          feof() = 0
    seek to end ;        feof() = 0
    read one more byte ; feof() = 1
    seek back to start ; feof() = 1
    

    Here’s the seek-test.c program I used to test this issue :

    C :
    1. #include <stdio .h>
    2.  
    3. int main()
    4. {
    5.   FILE *f ;
    6.   unsigned char byte ;
    7.  
    8.   f = fopen("seek_test.c", "r") ;
    9.   printf("open file ;     feof() = %d\n", feof(f)) ;
    10.   fseek(f, 0, SEEK_END) ;
    11.   printf("seek to end ;    feof() = %d\n", feof(f)) ;
    12.   fread(&byte, 1, 1, f) ;
    13.   printf("read one more byte ; feof() = %d\n", feof(f)) ;
    14.   fseek(f, 0, SEEK_SET) ;
    15.   printf("seek back to start ; feof() = %d\n", feof(f)) ;
    16.   fclose(f) ;
    17.  
    18.   return 0 ;
    19. }

    EOF
    Speaking of EOF, I’m about done for this evening.

    What codec would you select for this task, given the requirements involved ?

  • ffmpeg - operation not permitted error while conversion

    20 février 2012, par Jomoos

    I am developing an android app. My requirement is that to implement an rtsp streaming server on android. It has to live stream video and audio captured using MediaRecorder. Another requirement is that I have to use live555 as the streaming server. What I get from MediaRecorder is in MP4 or 3GP format. live555 cannot able to stream both. But it can stream audio if I recorded it only in 'RAW_AMR' format. Since live555 support 'mpg' format for streaming, I decided to put someone in middle who can convert 'mp4' or '3gp' to 'mpg', and I chose ffmpeg.

    I have ported live555 and ffmpeg to android. ffmpeg is able to convert the file recorded by MediaRecorder once it is finished. But the problem is that ffmpeg cannot be able to do it concurrently. That is, ffmpeg is not able to convert the file while recording. It shows an Operation not permitted error. I tried the same on my linux machine, using VLC to record instead of MediaRecorder on android. The result is same. ffmpeg is able to convert once the recording is finished, and not able to do the same while recording.

    Here is the ffmpeg command I issued on my linux box :

    ffmpeg -v 9 -loglevel 99 -i test.mp4 test.mpg

    Where test.mp4 is the file to which VLC is recording in mp4 format. and test.mpg is my destination file. The following is the output by ffmpeg on terminal.

    ffmpeg version 0.8.9, Copyright (c) 2000-2011 the FFmpeg developers
     built on Feb  1 2012 18:29:27 with gcc 4.6.2 20111027 (Red Hat 4.6.2-1)
     configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --extra-cflags=&#39;-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic&#39; --enable-bzlib --enable-libcelt --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
     libavutil    51.  9. 1 / 51.  9. 1
     libavcodec   53.  8. 0 / 53.  8. 0
     libavformat  53.  5. 0 / 53.  5. 0
     libavdevice  53.  1. 1 / 53.  1. 1
     libavfilter   2. 23. 0 /  2. 23. 0
     libswscale    2.  0. 0 /  2.  0. 0
     libpostproc  51.  2. 0 / 51.  2. 0
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1672600] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1672600] ISO: File Type Major Brand: isom
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1672600] moov atom not found
    test.mp4: Operation not permitted

    Would anyone please tell me what is causing the problem ? Or is the scenario above is possible by ffmpeg. That is, is ffmpeg is able to do the conversion at the same time as that of recording ? If it is not possible by ffmpeg, would you please suggest any alternative solutions ?

    NOTE : I am putting a C tag because if it possible by some tweaking in C on ffmpeg, I am ready to do that(I want the solution that badly). But please provide some pointers to the right direction.

  • How to write frames to a video file ?

    23 décembre 2013, par Mike Chen

    I am currently writing an application that read frames from camera, modify them, and save them into a video file. I'm planing to do it with ffmpeg. There's rarely a documentation about ffmpeg. I can't find a way. Does any know how to do it ?

    I need it to be done on unix, and in C or C++. Does any can provide some instructions ?

    Thanks.

    EDIT :

    Sorry, I haven't write clearly. I want some developer APIs to write frames to a video file. I open up camera stream, I get every single frame, then I save them into a video file with those APIs available in ffmpeg's public apis. So using command line tool actually doesn't help me. And I've seen output_example.c under the ffmpeg src folder. It's pretty great that I may copy some parts of the code directly without change. And I am still looking for a easier way.

    Also, I'm thinking of porting my app to iPhone, as far as I know, only ffmpeg has been ported on iPhone. GStreamer is based on glib, and it's all GNU stuff. I'm not sure if I can get it work on iPhone. So ffmpeg is still the best choice for now.

    Any comments is appreciated.