Recherche avancée

Médias (91)

Autres articles (106)

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

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (9520)

  • ffmpeg rtsp stream to YouTube livestream not doing anything

    29 mai 2018, par felixosth

    I’m using C# to initiate ffmpeg. I’ve a onvif bridge server for a CCTV VMS and I’m building a application to enable the user to livestream any CCTV camera to YouTube.

    The rtsp stream to the camera looks like this :

    rtsp ://onvif:bridge@localhost:554/live/xxxxx-xxxguidtocameraxxx-xxxxx

    I’m new to ffmpeg and I’m using this arg :

    -f lavfi -i anullsrc -rtsp_transport udp -i camerastreamurl -tune zerolatency -vcodec libx264 -pix_fmt + -c:v copy -c:a aac -strict experimental -f flv rtmp ://x.rtmp.youtube.com/live2/streamkey -loglevel debug

    It seems like ffmpeg isn’t finding the camera stream, only the fake audio one. It just freezes.

    This is the result of the debug log :

    ffmpeg version N-91172-gebf85d3190 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 7.3.0 (GCC)
     configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
     libavutil      56. 18.102 / 56. 18.102
     libavcodec     58. 19.104 / 58. 19.104
     libavformat    58. 17.100 / 58. 17.100
     libavdevice    58.  4.100 / 58.  4.100
     libavfilter     7. 24.100 /  7. 24.100
     libswscale      5.  2.100 /  5.  2.100
     libswresample   3.  2.100 /  3.  2.100
     libpostproc    55.  2.100 / 55.  2.100
    Splitting the commandline.
    Reading option '-f' ... matched as option 'f' (force format) with argument 'lavfi'.
    Reading option '-i' ... matched as input url with argument 'anullsrc'.
    Reading option '-rtsp_transport' ... matched as AVOption 'rtsp_transport' with argument 'udp'.
    Reading option '-i' ... matched as input url with argument 'rtsp://onvif:bridge@localhost:554/live/41cf4f34-e137-4559-8278-47d912c64c5b'.
    Reading option '-tune' ... matched as AVOption 'tune' with argument 'zerolatency'.
    Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'.
    Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument '+'.
    Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'copy'.
    Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'aac'.
    Reading option '-strict' ...Routing option strict to both codec and muxer layer
    matched as AVOption 'strict' with argument 'experimental'.
    Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'.
    Reading option 'rtmp://x.rtmp.youtube.com/live2/xxxxxxxx' ... matched as output url.
    Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option loglevel (set logging level) with argument debug.
    Successfully parsed a group of options.
    Parsing a group of options: input url anullsrc.
    Applying option f (force format) with argument lavfi.
    Successfully parsed a group of options.
    Opening an input file: anullsrc.
    detected 8 logical cores
    [AVFilterGraph @ 0000027a34bad7c0] query_formats: 2 queried, 3 merged, 0 already done, 0 delayed
    [Parsed_anullsrc_0 @ 0000027a34badb80] sample_rate:44100 channel_layout:'stereo' nb_samples:1024
    [lavfi @ 0000027a34babc80] All info found
    Input #0, lavfi, from 'anullsrc':
     Duration: N/A, start: 0.000000, bitrate: 705 kb/s
       Stream #0:0, 1, 1/44100: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
    Successfully opened the file.
    Parsing a group of options: input url rtsp://onvif:bridge@localhost:554/live/41cf4f34-e137-4559-8278-47d912c64c5b.
    Successfully parsed a group of options.
    Opening an input file: rtsp://onvif:bridge@localhost:554/live/41cf4f34-e137-4559-8278-47d912c64c5b.
    [tcp @ 0000027a34bb5980] No default whitelist set

    Edit :
    I’m getting this result with minimal args :
    ffmpeg result

  • ffmpeg - Writing thumbnail to Azure Blob Storage

    20 juin 2018, par Heinrich

    Is is possible to write directly to Azure using ffmpeg ? I am using ffmpeg to generate thumbnails for videos and I need to save them to an Azure Blob storage using a pre generated SAS url, is this possible ?
    When I run ffmpeg it seems to run happily, without any trace of errors as far as I can tell, but the file is never written\create in the storage. I know the target url works as I can upload a file to exact same url using postman.

    Below is the ffmpeg command that I am trying to get to work :

    .\ffmpeg.exe -i {srcurl} -loglevel 48 -frames:v 1 -y -method PUT -chunked_post 0 -headers "x-ms-blob-type: BlockBlob" -f apng {targeturl}

    I took the urls out as they are to long but the are both in the format as below :

    https://{host}.blob.core.windows.net/{pathtofile}/{filename}?sp=r&st=2018-06-03T23:07:25Z&se=2018-06-04T07:07:25Z&spr=https&sv=2017-11-09&sig={signature}

    Now I know that it works to some degree because if I write the file locally everything is happy. ffmpeg is able to get the video from the source url, read the file and create a thumbnail locally.

    The thing that confuses me more however is that if I specify a rubbish url path, one where I know it shouldn’t have permission to write to, it still does not complain at all.

    It is able to resolve the host name because changing the host to some non-existent one it will cause the "Failed to resolve hostname" error.

  • Open CV Codec FFMPEG Error fallback to use tag 0x7634706d/'mp4v'

    22 mai 2019, par Cohen

    Doing a filter recording and all is fine. The code is running, but at the end the video is not saved as MP4. I have this error :

    OpenCV: FFMPEG: tag 0x44495658/'XVID' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'
    OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'

    Using a MAC and the code is running correctly, but is not saving. I tried to find more details about this error, but wasn’t so fortunate. I use as editor Sublime. The code run on Atom tough but is giving this error :

    OpenCV: FFMPEG: tag 0x44495658/'XVID' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'
    OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'
    2018-05-28 15:04:25.274 Python[17483:2224774] AVF: AVAssetWriter status: Cannot create file

    ....

    import numpy as np
    import cv2
    import random
    from utils import CFEVideoConf, image_resize
    import glob
    import math


    cap = cv2.VideoCapture(0)

    frames_per_seconds = 24
    save_path='saved-media/filter.mp4'
    config = CFEVideoConf(cap, filepath=save_path, res='360p')
    out = cv2.VideoWriter(save_path, config.video_type, frames_per_seconds, config.dims)


    def verify_alpha_channel(frame):
       try:
           frame.shape[3] # looking for the alpha channel
       except IndexError:
           frame = cv2.cvtColor(frame, cv2.COLOR_BGR2BGRA)
       return frame


    def apply_hue_saturation(frame, alpha, beta):
       hsv_image = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
       h, s, v = cv2.split(hsv_image)
       s.fill(199)
       v.fill(255)
       hsv_image = cv2.merge([h, s, v])

       out = cv2.cvtColor(hsv_image, cv2.COLOR_HSV2BGR)
       frame = verify_alpha_channel(frame)
       out = verify_alpha_channel(out)
       cv2.addWeighted(out, 0.25, frame, 1.0, .23, frame)
       return frame


    def apply_color_overlay(frame, intensity=0.5, blue=0, green=0, red=0):
       frame = verify_alpha_channel(frame)
       frame_h, frame_w, frame_c = frame.shape
       sepia_bgra = (blue, green, red, 1)
       overlay = np.full((frame_h, frame_w, 4), sepia_bgra, dtype='uint8')
       cv2.addWeighted(overlay, intensity, frame, 1.0, 0, frame)
       return frame


    def apply_sepia(frame, intensity=0.5):
       frame = verify_alpha_channel(frame)
       frame_h, frame_w, frame_c = frame.shape
       sepia_bgra = (20, 66, 112, 1)
       overlay = np.full((frame_h, frame_w, 4), sepia_bgra, dtype='uint8')
       cv2.addWeighted(overlay, intensity, frame, 1.0, 0, frame)
       return frame


    def alpha_blend(frame_1, frame_2, mask):
       alpha = mask/255.0
       blended = cv2.convertScaleAbs(frame_1*(1-alpha) + frame_2*alpha)
       return blended


    def apply_circle_focus_blur(frame, intensity=0.2):
       frame = verify_alpha_channel(frame)
       frame_h, frame_w, frame_c = frame.shape
       y = int(frame_h/2)
       x = int(frame_w/2)

       mask = np.zeros((frame_h, frame_w, 4), dtype='uint8')
       cv2.circle(mask, (x, y), int(y/2), (255,255,255), -1, cv2.LINE_AA)
       mask = cv2.GaussianBlur(mask, (21,21),11 )

       blured = cv2.GaussianBlur(frame, (21,21), 11)
       blended = alpha_blend(frame, blured, 255-mask)
       frame = cv2.cvtColor(blended, cv2.COLOR_BGRA2BGR)
       return frame


    def portrait_mode(frame):
       cv2.imshow('frame', frame)
       gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
       _, mask = cv2.threshold(gray, 120,255,cv2.THRESH_BINARY)

       mask = cv2.cvtColor(mask, cv2.COLOR_GRAY2BGRA)
       blured = cv2.GaussianBlur(frame, (21,21), 11)
       blended = alpha_blend(frame, blured, mask)
       frame = cv2.cvtColor(blended, cv2.COLOR_BGRA2BGR)
       return frame


    def apply_invert(frame):
       return cv2.bitwise_not(frame)

    while(True):
       # Capture frame-by-frame
       ret, frame = cap.read()
       frame = cv2.cvtColor(frame, cv2.COLOR_BGR2BGRA)
       #cv2.imshow('frame',frame)


       hue_sat = apply_hue_saturation(frame.copy(), alpha=3, beta=3)
       cv2.imshow('hue_sat', hue_sat)

       sepia = apply_sepia(frame.copy(), intensity=.8)
       cv2.imshow('sepia',sepia)

       color_overlay = apply_color_overlay(frame.copy(), intensity=.8, red=123, green=231)
       cv2.imshow('color_overlay',color_overlay)

       invert = apply_invert(frame.copy())
       cv2.imshow('invert', invert)

       blur_mask = apply_circle_focus_blur(frame.copy())
       cv2.imshow('blur_mask', blur_mask)

       portrait = portrait_mode(frame.copy())
       cv2.imshow('portrait',portrait)

       if cv2.waitKey(20) & 0xFF == ord('q'):
           break

    # When everything done, release the capture
    cap.release()
    cv2.destroyAllWindows()