Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (47)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • 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 (9612)

  • avcodec/htmlsubtitles : Check for string truncation and return error

    5 mai 2017, par Michael Niedermayer
    avcodec/htmlsubtitles : Check for string truncation and return error
    

    Fixes out of array access
    Fixes : 1354/clusterfuzz-testcase-minimized-5520132195483648

    Found-by : continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavcodec/htmlsubtitles.c
    • [DH] libavcodec/htmlsubtitles.h
  • webm_dash_manifest_demuxer : Fix UB in cue timestamp string code and make it actually...

    20 avril 2017, par Derek Buitenhuis
    webm_dash_manifest_demuxer : Fix UB in cue timestamp string code and make it actually work
    

    Output was apparently not tested for correctness. Passing overlapping
    memory to snprintf causes undefined behavior, and usually resulted in
    only the very last timestamp being written to metadata, and not a list
    at all.

    Signed-off-by : Derek Buitenhuis <derek.buitenhuis@gmail.com>

    • [DH] libavformat/matroskadec.c
  • Convert an h264 byte string to OpenCV images

    24 mars 2017, par Fred Dufresne

    In Python, how do I convert an h264 byte string to images OpenCV can read, only keeping the latest image ?

    Long version :

    Hi everyone.

    Working in Python, I’m trying to get the output from adb screenrecord piped in a way that allows me to capture a frame whenever I need it and use it with OpenCV. As I understand, I need to constantly read the stream because it’s h264.

    I’ve tried multiple things to get it working and concluded that I needed to ask for specific help.

    The following gets me the stream I need and works very well when I print stream.stdout.read(n).

    import subprocess as sp

    adbCmd = ['adb', 'exec-out', 'screenrecord', '--output-format=h264', '-']
    stream = sp.Popen(adbCmd, stdout = sp.PIPE, universal_newlines = True)

    Universal newlines was necessary to get it to work on Windows.

    Doing :

    sp.call(['ffplay', '-'], stdin = stream.stdout, universal_newlines = True)

    Works.

    The problem is I am now trying to use ffmpeg to take the input h264 stream and output as many frames as possible, overwriting the last frame if needed.

    ffmpegCmd = ['ffmpeg', '-f', 'image2pipe', '-pix_fmt', 'bgr24', '-vcodec', 'h264', 'fps=30', '-']
    ffmpeg = sp.Popen(ffmpegCmd, stdin = stream.stdout, stdout = sp.PIPE, universal_newlines = True)

    This is what I think should be used, but I always get the error "Output file #0 does not contain any stream".

    Edit :

    Final Answer

    Turns out the universal_newlines option was ruining the line endings and gradually corrupting the output. Also, the ffmpeg command was wrong, see LordNeckbeard’s answer.

    Here’s the correct ffmpeg command to achieve what was used :

    ffmpegCmd = ['ffmpeg', '-i', '-', '-f', 'rawvideo', '-vcodec', 'bmp', '-vf', 'fps=5', '-']
    ffmpeg = sp.Popen(ffmpegCmd, stdin = stream.stdout, stdout = sp.PIPE)

    And then to convert the result into an OpenCV image, you do the following :

    fileSizeBytes = ffmpeg.stdout.read(6)
    fileSize = 0
    for i in xrange(4):
       fileSize += fileSizeBytes[i + 2] * 256 ** i
    bmpData = fileSizeBytes + ffmpeg.stdout.read(fileSize - 6)
    image = cv2.imdecode(np.fromstring(bmpData, dtype = np.uint8), 1)

    This will get every single frame of a stream as an OpenCV image.