Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (91)

  • L’utiliser, en parler, le critiquer

    10 avril 2011

    La première attitude à adopter est d’en parler, soit directement avec les personnes impliquées dans son développement, soit autour de vous pour convaincre de nouvelles personnes à l’utiliser.
    Plus la communauté sera nombreuse et plus les évolutions seront rapides ...
    Une liste de discussion est disponible pour tout échange entre utilisateurs.

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

Sur d’autres sites (10500)

  • Playing a custom avi data stream using QtMultimedia

    26 décembre 2015, par sbabbi

    I need to play back a custom AVI file that contains a classic video stream, an audio stream but also a custom data stream.

    The custom stream contains data that is visualized by some custom widgets ; those widgets only need that each custom frame is written in a buffer at the proper time.

    Our application is based on Qt, and already uses QMediaPlayer/QVideoWidget to play traditional videos, but the additional custom stream makes things more complicated, because AFAIK QMediaPlayer only plays the video/audio and ignores everything else.

    I would like to avoid to reinvent the entire qt-multimedia, but I am not sure how to make the best out of the available Qt classes.


    My ideas so far are :

    1. Write a custom media player class that demuxes and decodes the video using ffmpeg, implements the timing, uses QAudioOutput for playing the audio, produces a stream of QVideoFrames to be played on the video and write the custom data to some buffer for visualization.

      The problem : In order to avoid writing the code to rescale/convert the video frames, I would like to reuse QVideoWidget, but it seems to work only with the "real" QMediaPlayer.

    2. Demux the input file and feed QMediaPlayer with the AV streams.
      Demux the input with ffmpeg (possibly leaving the decoding to the Qt backend), have one QIODevice to retrieve only the video/audio streams from the input file and another one to retrieve the data stream. Play the video/audio with QMediaPlayer.

                   +-------+                          
                   | QFile |                          
                   +---^---+                          
                       |                              
                    inherits                          
                       |                              
             +--------------------+
             |    MyAviDemuxer    |
             |                    |
             |  holds a queue of  |
             |  demuxed packets   |
             +--------------------+
             |                    |
       readDataPacket      readVideoPacket
             |                    |
      +-------v--------+  +--------v-----------+            +-----------+
      | MyCustomReader |  | MyVideoAudioStream +--inherits--> QIODevice |
      +----------------+  +--------+-----------+            +-----------+
                                  |      
                               setMedia                  
                                  |                  
                          +-------v-------+          
                          | QMediaPlayer  |          
                          +---------------+          

      The problem : synchronize the timing of the data stream with QMediaPlayer, handle headers and metadata correctly.


    I am slightly inclined to option 1, just because it gives me more control, but I am wondering if I missed an easier solution (even Windows-only).

  • Encrypted HLS works as live stream, doesn't work as VOD

    22 avril 2015, par Misiur

    I’ve found some crude bash script for encoding and encrypting video file, into a HLS stream, and I’ve edited it slightly (I have no idea about bash) :

    #!/bin/bash

    set -e     # Exit on errors

    tsFile="$1"

    if ! [ -f "$tsFile" -a -r "$tsFile" ]; then
       echo "First argument is required" >&2
       exit 2
    fi

    if [ -z "$3" ]; then
       output="output"
    else
       output="$3"
    fi


    keyFile="$output.key"
    keyInfoFile="$output.keyinfo"
    playList="$output.m3u8"

    if [ -z "$4" ]; then
       separator='-'
    else
       separator="$4"
    fi

    splitFilePrefix="$output$separator"


    if [ -d "$2" ]; then
       outDir="$2"
    else
       mkdir "$2" || exit 1
       outDir="$2"
    fi

    tempDir="$outDir/.$$_tmp"
    keyFile="$outDir/$keyFile"

    mkdir $tempDir

    echo "$outdir/$keyFile\n$outdir/$keyFile" > "$outdir/$keyInfoFile"


    ffmpeg -i "$tsFile" -hls_time 5 -hls_list_size 0 -hls_segment_filename "$tempDir/$splitFilePrefix%03d.ts" -strict -2 "$tempDir/$playList"

    openssl rand 16 > $keyFile
    encryptionKey=`cat $keyFile | hexdump -e '16/1 "%02x"'`

    numberOfTsFiles=$(( `ls "$tempDir/$splitFilePrefix"*.ts | wc -l` -1 ))

    for i in $(seq -f "%03g" 0 $numberOfTsFiles); do
       initializationVector=`printf '%032x' $(( 10#$i))`
       openssl aes-128-cbc -e -in "$tempDir/$splitFilePrefix"$i.ts \
       -out "$outDir/$splitFilePrefix"$i.ts -nosalt -iv $initializationVector -K $encryptionKey
    done

    {
       head -4 "$tempDir/$playList"
       echo '#EXT-X-KEY:METHOD=AES-128,URI='"$keyFile"
       egrep "$tempDir/$playList" -vie '#EXT-X-TARGETDURATION:' \
       | tail -n +4
    } > "$outDir/$playList"

    #rm -r "$tempDir"

    This results in a something like this :

    #EXTM3U
    #EXT-X-VERSION:3
    #EXT-X-MEDIA-SEQUENCE:0
    #EXT-X-KEY:METHOD=AES-128,URI=output.key
    #EXT-X-TARGETDURATION:11
    #EXTINF:10.176833,
    output-000.ts
    #EXTINF:8.341667,
    output-001.ts
    #EXTINF:8.341667,
    output-002.ts
    #EXTINF:3.136467,
    output-003.ts
    #EXT-X-ENDLIST

    This almost works. However I need an VOD, not a live stream. So, I added line :

    #EXT-X-PLAYLIST-TYPE:VOD

    And now it doesn’t work with encrypted segments, only with unencrypted ones. I thought all segments are crypted separately ? Also, even with unencrypted files, the info about total length isn’t present. How can I fix that ?

  • Revert "avformat/mp3dec : offset seek index to end of id3v2 tag"

    14 avril 2015, par wm4
    Revert "avformat/mp3dec : offset seek index to end of id3v2 tag"
    

    This reverts commit 8b76c0eb561b0313e2a27950fe9d2bc5e4780dd8.

    It was slightly incorrect ; the next commit fixes it.

    Signed-off-by : Michael Niedermayer <michaelni@gmx.at>

    • [DH] libavformat/mp3dec.c