Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (52)

  • 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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (12235)

  • Dreamcast SD Adapter and DreamShell

    31 décembre 2014, par Multimedia Mike — Sega Dreamcast

    Nope ! I’m never going to let go of the Sega Dreamcast hacking. When I was playing around with Dreamcast hacking early last year, I became aware that there is such a thing as an SD card adapter for the DC that plugs into the port normally reserved for the odd DC link cable. Of course I wanted to see what I could do with it.

    The primary software that leverages the DC SD adapter is called DreamShell. Working with this adapter and the software requires some skill and guesswork. Searching for these topics tends to turn up results from various forums where people are trying to cargo-cult their way to solutions. I have a strange feeling that this post might become the unofficial English-language documentation on the matter.

    Use Cases
    What can you do with this thing ? Undoubtedly, the primary use is for backing up (ripping) the contents of GD-ROMs (the custom optical format used for the DC) and playing those backed up (ripped) copies. Presumably, users of this device leverage the latter use case more than the former, i.e., download ripped games, load them on the SD card, and launch them using DreamShell.

    However, there are other uses such as multimedia playback, system exploration, BIOS reprogramming, high-level programming, and probably a few other things I haven’t figured out yet.

    Delivery
    I put in an order via the dc-sd.com website and in about 2 short months, the item arrived from China. This marked my third lifetime delivery from China and curiously, all 3 of the shipments have pertained to the Sega Dreamcast.


    Dreamcast SD Adapter package

    Click for larger image


    I thought it was very interesting that this adapter came in such complete packaging. The text is all in Chinese, though the back states “Windows 98 / ME / 2000 / XP, Mac OS 9.1, LINUX2.4”. That’s what tipped me off that they must have just cannibalized some old USB SD card readers and packaging in order to create these. Closer inspection of the internals through the translucent pink case confirms this.

    Usage
    According to its change log, DreamShell has been around for a long time with version 1.0.0 released in February of 2004. The current version is 4.0.0 RC3. There are several downloads available :

    1. DreamShell 4.0 RC 3 CDI Image
    2. DreamShell 4.0 RC 3 + Boot Loader
    3. DreamShell 4.0 RC 3 + Core CDI image

    Option #2 worked for me. It contains a CDI disc image and the DreamShell files in a directory named DS/.

    Burn the CDI to a CD-R in the normal way you would burn a bootable Dreamcast disc from a CDI image. This is open-ended and left as an exercise to the reader, since there are many procedures depending on platform. On Linux, I used a small script I found once called burncdi-dc.sh.

    Then, copy the contents of the DS/ folder to an SD card. As for filesystem, FAT16 and FAT32 are both known to work. The files in DS/ should land in the root of the SD card ; the folder DS/ should not be in the root.

    Plug the SD card into the DC SD adapter and plug the adapter in the link cable port on the back of the Dreamcast. Then, boot the disc. If it works, you will see this minor corruption of the usual Sega licensing screen :


    DreamShell logo on Dreamcast startup

    Then, there will be a brief white-on-black text screen that explains the booting process :


    DreamShell booting text

    Then, there will be the main DreamShell logo :


    DreamShell logo

    Finally, you will land on the DreamShell main desktop :


    DreamShell 4.0.0 RC3 main desktop

    Skepticism
    At first, I was supremely skeptical of the idea that this SD adapter could perform speedily enough to play games reasonably. This was predicated on the observation that my DC coder’s cable that I used to use for homebrew development could not transfer faster than 115200 bits/second, amounting to about 11 kbytes/sec. I assumed that this was a fundamental limitation of the link port.

    In fact, I ripped a few of my Dreamcast discs over a decade ago and still have those rips lying around. So I copied the ISO image of Resident Evil : Code Veronica — the game I personally played most on the DC — to the SD card (anywhere works) and used the “ISO loader” icon seen on the desktop above to launch the game.

    It works :


    Resident Evil: Code Veronica title

    The opening FMV plays at full speed. Everything loads as fast as I remember. I was quite surprised.

    Digression : My assumptions about serial speeds have often been mistaken. 10 years ago, I heard stories about how we would soon be able to watch streaming video on our cell phones. I scoffed because I thought the 56K limitation of dialup modems was some sort of fundamental speed-of-light type of limitation for telephony bandwidth, wired or wireless.

    The desktop menu also includes a ‘speedtest’ tool that profiles the write and read performance of your preferred storage medium. For my fastest SD card (a PNY 2 GB card) :


    DreamShell speedtest utility

    This is probably more representative of the true adapter bandwidth as reading and writing is a good deal faster through more modern interfaces on PC and Mac with this same card.

    Look at the other options on the speedtest console. Hard drive ? Apparently, it’s possible, but it requires a good deal more hardware hacking than just purchasing this SD adapter.

    Ripping
    As you can see from the Resident Evil screenshot, playing games works quite nicely. How about ripping ? I’m pleased to say that DreamShell has a beautiful ripping interface :


    Ripping a GD-ROM using DreamShell

    Enter a name for the disc (or read the disc label), select the storage medium, and let it, well, rip. It indicates which track it’s working on and the Sega logo acts as a progress bar, shading blue as the track rip progresses.

    I’m finally, efficiently, archiving that collection of Sega Dreamcast demo discs ; I’m hoping they’ll eventually find a home at the Internet Archive. How is overall ripping performance ? Usually about 38-40 minutes to rip a full 900-1000 MB. That certainly beats the 27-28 hours that were required when I performed the ripping at 11 kbytes/sec via the DC coders cable.

    All is well until I get a sector reading error :


    DreamShell ripping error

    That’s when it can come in handy to have 3 DC consoles (see ?! not crazy !).

    Other Uses
    There’s a file explorer. You can browse the filesystem of the SD card, visual memory unit, or the CD portion of the GD-ROM (would be more useful if it accessed the GD area). There are FFmpeg files included. So I threw a random Cinepak file and random MPEG-1 file at it to see what happens. MPEG-1 didn’t do anything, but this Cinepak file from some Sierra game played handily :


    DreamShell playing Cinepak

    If you must enter strings, it helps to have a Dreamcast keyboard (which I do). Failing that, here’s a glimpse of the onscreen keyboard that DreamShell equips :


    DreamShell onscreen keyboard

    Learning to use it is a game in itself.

    There is an option of installing DreamShell in the BIOS. I did not attempt this. I don’t know if it’s possible (not like there’s a lot of documentation)– perhaps a custom BIOS modchip is needed. But here’s what the screen looks like :


    DreamShell BIOS installation menu

    There is also a plain console to interact with (better have a physical keyboard). There are numerous file manipulation commands and custom system interaction commands. I see one interesting command called ‘addr’ that looks useful for dumping memory regions to a file.

    A Lua language interpreter is also built in. I would love to play with this if I could ascertain whether DreamShell provided Dreamcast-specific APIs.

    Tips And Troubleshooting
    I have 3 Dreamcast consoles, affectionately named Terran, Protoss, and Zerg after the StarCraft II stickers with which they are adorned. Some seem to work better than others. Protoss seemed to be able to boot the DreamShell disc more reliably than the others. However, I was alarmed when it couldn’t boot one morning when it was churning the previous day.

    I think the problem is that it was just cold. That seemed to be the issue. I put in a normal GD-ROM and let it warm up on that disc for awhile and then DreamShell booted fine. So that’s my piece of cargo-culting troubleshooting advice.

  • What are mv, fd, aq, vq, sq and f in a video stream ?

    23 décembre 2016, par Pawan Yadav

    I am playing video streams using RTSP over TCP using FFPLAY and it plays fine when the vq value increases, but stops after 5-6 seconds when only the value before M-V increases.

    nan M-V:    nan fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0  
    ......
    ......

    Duration: N/A, start: 2.133467, bitrate: N/A
       Stream #0:0: Video: h264 (Main), yuvj420p(pc), 1280x1024, 15 fps, 25 tbr, 90k tbn, 30 tbc
    [swscaler @ 0x7fd9502403c0] deprecated pixel format used, make sure you did set range correctly
     "76.81" M-V: -5.409 fd=   0 aq=    0KB vq=    0KB sq=    0B f=2/2 `

    Can someone please explain what these M-V, fd, aq, vq, f are, as well as the value before M-V ("76.81") ?

  • using libav instead of ffmpeg

    21 janvier 2015, par n00bie

    I want to streaming video over http, i am using ogg(theora + vorbis), now i have sender and receiver, and i can run them using command line :

    Sender :

    ffmpeg -f video4linux2 -s 320x240 -i /dev/mycam -codec:v libtheora -qscale:v 5 -f ogg http://127.0.0.1:8080

    Receiver :

    sudo gst-launch-0.10 tcpserversrc port = 8080 ! oggdemux ! theoradec ! autovideosink

    Now, sender sends both audio and video, but receiver plays only video.

    It works perfect, but now i want not to use ffmpeg and use only libav* instead.

    Here’s my class for streaming :

    class VCORE_LIBRARY_EXPORT VVideoWriter : private boost::noncopyable
    {
    public:
       VVideoWriter( );
       ~VVideoWriter( );

       bool openFile( const std::string& name,
                      int fps, int videoBitrate, int width, int height,
                      int audioSampleRate, bool stereo, int audioBitrate );
       void close( );

       bool writeVideoFrame( const uint8_t* image, int64_t timestamp );
       bool writeAudioFrame( const int16_t* data, int64_t timestamp  );

       int audioFrameSize( ) const;

    private:
       AVFrame *m_videoFrame;
       AVFrame *m_audioFrame;

       AVFormatContext *m_context;
       AVStream *m_videoStream;
       AVStream *m_audioStream;

       int64_t m_startTime;
    };

    Initialization :

    bool VVideoWriter::openFile( const std::string& name,
                                int fps, int videoBitrate, int width, int height,
                                int audioSampleRate, bool stereo, int audioBitrate )
    {
            if( ! m_context )
            {
               // initalize the AV context
               m_context = avformat_alloc_context( );
               assert( m_context );

               // get the output format
               m_context->oformat = av_guess_format( "ogg", name.c_str( ), nullptr );
               if( m_context->oformat )
               {
                   strcpy( m_context->filename, name.c_str( ) );

                   auto codecID = AV_CODEC_ID_THEORA;
                   auto codec = avcodec_find_encoder( codecID );

                   if( codec )
                   {
                       m_videoStream = avformat_new_stream( m_context, codec );
                       assert( m_videoStream );

                       // initalize codec
                       auto codecContext = m_videoStream->codec;
                       bool globalHeader = m_context->oformat->flags & AVFMT_GLOBALHEADER;
                       if( globalHeader )
                           codecContext->flags |= CODEC_FLAG_GLOBAL_HEADER;
                       codecContext->codec_id = codecID;
                       codecContext->codec_type = AVMEDIA_TYPE_VIDEO;
                       codecContext->width = width;
                       codecContext->height = height;
                       codecContext->time_base.den = fps;
                       codecContext->time_base.num = 1;
                       codecContext->bit_rate = videoBitrate;
                       codecContext->pix_fmt = PIX_FMT_YUV420P;
                       codecContext->flags |= CODEC_FLAG_QSCALE;
                       codecContext->global_quality = FF_QP2LAMBDA * 5;

                       int res = avcodec_open2( codecContext, codec, nullptr );

                       if( res >= 0 )
                       {
                           auto codecID = AV_CODEC_ID_VORBIS;
                           auto codec = avcodec_find_encoder( codecID );

                           if( codec )
                           {
                               m_audioStream = avformat_new_stream( m_context, codec );
                               assert( m_audioStream );
                               // initalize codec
                               auto codecContext = m_audioStream->codec;

                               bool globalHeader = m_context->oformat->flags & AVFMT_GLOBALHEADER;
                               if( globalHeader )
                                   codecContext->flags |= CODEC_FLAG_GLOBAL_HEADER;
                               codecContext->codec_id = codecID;
                               codecContext->codec_type = AVMEDIA_TYPE_AUDIO;
                               codecContext->sample_fmt = AV_SAMPLE_FMT_FLTP;
                               codecContext->bit_rate = audioBitrate;
                               codecContext->sample_rate = audioSampleRate;
                               codecContext->channels = stereo ? 2 : 1;
                               codecContext->channel_layout = stereo ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;

                               res = avcodec_open2( codecContext, codec, nullptr );

                               if( res >= 0 )
                               {
                                   // try to open the file
                                   if( avio_open( &m_context->pb, m_context->filename, AVIO_FLAG_WRITE ) >= 0 )
                                   {
                                       m_audioFrame->nb_samples = codecContext->frame_size;
                                       m_audioFrame->format = codecContext->sample_fmt;
                                       m_audioFrame->channel_layout = codecContext->channel_layout;

                                       boost::posix_time::ptime time_t_epoch( boost::gregorian::date( 1970, 1, 1 ) );
                                       m_context->start_time_realtime = ( boost::posix_time::microsec_clock::universal_time( ) - time_t_epoch ).total_microseconds( );
                                       m_startTime = -1;

                                       // write the header
                                       if( avformat_write_header( m_context, nullptr ) >= 0 )
                                       {
                                           return true;
                                       }
                                       else std::cerr << "VVideoWriter: failed to write video header" << std::endl;
                                   }
                                   else std::cerr << "VVideoWriter: failed to open video file " << name << std::endl;
                               }
                               else std::cerr << "VVideoWriter: failed to initialize audio codec" << std::endl;
                           }
                           else std::cerr << "VVideoWriter: requested audio codec is not supported" << std::endl;
                       }
                       else std::cerr << "VVideoWriter: failed to initialize video codec" << std::endl;
                   }
                   else std::cerr << "VVideoWriter: requested video codec is not supported" << std::endl;
               }
               else std::cerr << "VVideoWriter: requested video format is not supported" << std::endl;

               avformat_free_context( m_context );
               m_context = nullptr;
               m_videoStream = nullptr;
               m_audioStream = nullptr;
           }
           return false;
    }

    Writing video :

    bool VVideoWriter::writeVideoFrame( const uint8_t* image, int64_t timestamp )
    {
       if( m_context ) {
           auto codecContext = m_videoStream->codec;
           avpicture_fill( reinterpret_cast( m_videoFrame ),
                           const_cast( image ),
                           codecContext->pix_fmt, codecContext->width, codecContext->height );

           AVPacket pkt;
           av_init_packet( & pkt );
           pkt.data = nullptr;
           pkt.size = 0;
           int gotPacket = 0;
           if( ! avcodec_encode_video2( codecContext, &pkt, m_videoFrame, & gotPacket ) ) {
               if( gotPacket == 1 ) {
                   pkt.stream_index = m_videoStream->index;
                   int res;
                   {
                       pkt.pts = AV_NOPTS_VALUE;
                       pkt.dts = AV_NOPTS_VALUE;
                       pkt.stream_index = m_videoStream->index;
                       res = av_write_frame( m_context, &pkt );
                   }
                   av_free_packet( & pkt );
                   return res >= 0;
               }
               assert( ! pkt.size );
               return true;
           }
       }
       return false;
    }

    Writing audio (now i write test dummy audio) :

    bool VVideoWriter::writeAudioFrame( const int16_t* data, int64_t timestamp )
    {
       if( m_context ) {
           auto codecContext = m_audioStream->codec;

           int buffer_size = av_samples_get_buffer_size(nullptr, codecContext->channels, codecContext->frame_size, codecContext->sample_fmt, 0);

           float *samples = (float*)av_malloc(buffer_size);

           for (int i = 0; i < buffer_size / sizeof(float); i++)
               samples[i] = 1000. * sin((double)i/2.);

           int ret = avcodec_fill_audio_frame( m_audioFrame, codecContext->channels, codecContext->sample_fmt, (const uint8_t*)samples, buffer_size, 0);

           assert( ret >= 0 );
           (void)(ret);

           AVPacket pkt;
           av_init_packet( & pkt );
           pkt.data = nullptr;
           pkt.size = 0;
           int gotPacket = 0;
           if( ! avcodec_encode_audio2( codecContext, &pkt, m_audioFrame, & gotPacket ) ) {
               if( gotPacket == 1 ) {
                   pkt.stream_index = m_audioStream->index;
                   int res;
                   {
                       pkt.pts = AV_NOPTS_VALUE;
                       pkt.dts = AV_NOPTS_VALUE;
                       pkt.stream_index = m_audioStream->index;
                       res = av_write_frame( m_context, &pkt );
                   }
                   av_free_packet( & pkt );
                   return res >= 0;
               }
               assert( ! pkt.size );
               return true;
           }
           return false;
       }
       return false;
    }

    Here’s test example (i send video from webcam and dummy audio) :

    class TestVVideoWriter : public sigslot::has_slots<>
    {
    public:
       TestVVideoWriter( ) :
           m_fileOpened( false )
       {
       }

       void onCapturedFrame( cricket::VideoCapturer*, const cricket::CapturedFrame* capturedFrame )
       {
           if( m_fileOpened ) {
               m_writer.writeVideoFrame( reinterpret_cast<const>( capturedFrame->data ),
                                         capturedFrame->time_stamp / 1000 );
               m_writer.writeAudioFrame( nullptr , 0 );


           } else {
                 m_fileOpened = m_writer.openFile( "http://127.0.0.1:8080",
                                                   15, 40000, capturedFrame->width, capturedFrame->height,
                                                   16000, false, 64000 );
           }
       }

    public:
       vcore::VVideoWriter m_writer;
       bool m_fileOpened;
    };

    TestVVideoWriter testWriter;

    BOOST_AUTO_TEST_SUITE(TEST_VIDEO_WRITER)

    BOOST_AUTO_TEST_CASE(testWritingVideo)
    {
       cricket::LinuxDeviceManager deviceManager;
       std::vector devs;
       if( deviceManager.GetVideoCaptureDevices( &amp;devs ) ) {
           if( devs.size( ) ) {
               boost::shared_ptr camera( deviceManager.CreateVideoCapturer( devs[ 0 ] ) );
               if( camera ) {
                   cricket::VideoFormat format( 320, 240, cricket::VideoFormat::FpsToInterval( 30 ),
                                                camera->GetSupportedFormats( )->front( ).fourcc );
                   cricket::VideoFormat best;
                   if( camera->GetBestCaptureFormat( format, &amp;best ) ) {
                       camera->SignalFrameCaptured.connect( &amp;testWriter, &amp;TestVVideoWriter::onCapturedFrame );
                       if( camera->Start( best ) != cricket::CS_FAILED ) {
                           boost::this_thread::sleep( boost::posix_time::seconds( 10 ) );
                           return;
                       }
                   }
               }
           }
       }
       std::cerr &lt;&lt; "Problem has occured with camera" &lt;&lt; std::endl;
    }

    BOOST_AUTO_TEST_SUITE_END() // TEST_VIDEO_WRITER
    </const>

    But, in this case, gstreamer start playing video only when my test program stop executing (after 10 seconds in this case). It does not suit me, i want gstreamer start playing immediately after starting my test program.

    Could someone help me ?

    P.S. Sorry for my English.