Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (64)

  • Submit enhancements and plugins

    13 avril 2011

    If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
    You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone.

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

Sur d’autres sites (9667)

  • How to compress webcam videos recorded by html5 MediaRecorder api ?

    19 mai 2017, par JasonY

    I successfully recorded my webcam using MediaRecorder api and the resulting filesizes seemed far too big for their quality.

    For example, for an 8 second video that was 480x640 I got a 1mB file size. That does not seem right.

    My code to record()

    navigator.mediaDevices.getUserMedia({video: true, audio: true})
       .then(function(stream){
           var options = {
               mimeType : "video/webm;codecs=vp9"
               //I don't set bitrate here even if I do the quality is too bad
           }
           var media_recorder = new MediaRecorder(media_stream, options);
           var recorded_data = [];
           media_recorder.ondataavailable = function(e){
                recorded_data.push(e.data);
           }
           media_recorder.onstop = function(e){
               recorded_data.push(e.data);
               var recorded_blob = new Blob(recorded_data, { 'type' : 'video/webm; codecs=vp9' });
               var recorded_video_url = window.URL.createObjectURL(recorded_blob);
               //here I write some code to download the blob from this url through a href
           }
       })

    The file obtained by this method is unreasonably large which makes me wonder if it was even compressed when encoded by VP9 ? A 7 second video is about 870kB !

    Inspecting the file with a mediainfo tool gives me

    General
    Count                                    : 323
    Count of stream of this kind             : 1
    Kind of stream                           : General
    Kind of stream                           : General
    Stream identifier                        : 0
    Count of video streams                   : 1
    Count of audio streams                   : 1
    Video_Format_List                        : VP9
    Video_Format_WithHint_List               : VP9
    Codecs Video                             : V_VP9
    Video_Language_List                      : English
    Audio_Format_List                        : Opus
    Audio_Format_WithHint_List               : Opus
    Audio codecs                             : Opus
    Audio_Language_List                      : English
    Complete name                            : recorded_video.webm
    File name                                : recorded_video
    File extension                           : webm
    Format                                   : WebM
    Format                                   : WebM
    Format/Url                               : http://www.webmproject.org/
    Format/Extensions usually used           : webm
    Commercial name                          : WebM
    Format version                           : Version 2
    Internet media type                      : video/webm
    Codec                                    : WebM
    Codec                                    : WebM
    Codec/Url                                : http://www.webmproject.org/
    Codec/Extensions usually used            : webm
    File size                                : 867870
    File size                                : 848 KiB
    File size                                : 848 KiB
    File size                                : 848 KiB
    File size                                : 848 KiB
    File size                                : 847.5 KiB
    File last modification date              : UTC 2017-05-19 05:48:00
    File last modification date (local)      : 2017-05-19 17:48:00
    Writing application                      : Chrome
    Writing application                      : Chrome
    Writing library                          : Chrome
    Writing library                          : Chrome
    IsTruncated                              : Yes

    Video
    Count                                    : 332
    Count of stream of this kind             : 1
    Kind of stream                           : Video
    Kind of stream                           : Video
    Stream identifier                        : 0
    StreamOrder                              : 1
    ID                                       : 2
    ID                                       : 2
    Unique ID                                : 62101435245162993
    Format                                   : VP9
    Commercial name                          : VP9
    Codec ID                                 : V_VP9
    Codec ID/Url                             : http://www.webmproject.org/
    Codec                                    : V_VP9
    Codec                                    : V_VP9
    Width                                    : 640
    Width                                    : 640 pixels
    Height                                   : 480
    Height                                   : 480 pixels
    Pixel aspect ratio                       : 1.000
    Display aspect ratio                     : 1.333
    Display aspect ratio                     : 4:3
    Frame rate mode                          : VFR
    Frame rate mode                          : Variable
    Language                                 : en
    Language                                 : English
    Language                                 : English
    Language                                 : en
    Language                                 : eng
    Language                                 : en
    Default                                  : Yes
    Default                                  : Yes
    Forced                                   : No
    Forced                                   : No

    Audio
    Count                                    : 272
    Count of stream of this kind             : 1
    Kind of stream                           : Audio
    Kind of stream                           : Audio
    Stream identifier                        : 0
    StreamOrder                              : 0
    ID                                       : 1
    ID                                       : 1
    Unique ID                                : 32224324715799545
    Format                                   : Opus
    Format/Url                               : http://opus-codec.org/
    Commercial name                          : Opus
    Internet media type                      : audio/opus
    Codec ID                                 : A_OPUS
    Codec ID/Url                             : http://opus-codec.org
    Codec                                    : Opus
    Codec                                    : Opus
    Codec/Family                             : PCM
    Channel(s)                               : 1
    Channel(s)                               : 1 channel
    Channel positions                        : Front: C
    Channel positions                        : 1/0/0
    Sampling rate                            : 48000
    Sampling rate                            : 48.0 KHz
    Compression mode                         : Lossy
    Compression mode                         : Lossy
    Delay                                    : 718
    Delay                                    : 718ms
    Delay                                    : 718ms
    Delay                                    : 718ms
    Delay                                    : 00:00:00.718
    Delay, origin                            : Container
    Delay, origin                            : Container
    Language                                 : en
    Language                                 : English
    Language                                 : English
    Language                                 : en
    Language                                 : eng
    Language                                 : en
    Default                                  : Yes
    Default                                  : Yes
    Forced                                   : No
    Forced                                   : No

    What did I do wrong ? Do I have to re-encode it after the chunks get appended ? Is there some attribute I’m missing ? VP9 is supposed to reduce file sizes drastically.

  • How can I correctly provide a fake webcam input to Chrome ?

    30 août 2018, par doppelgreener

    I’m trying to run end-to-end testing in Chrome for a product that requires a webcam feed halfway through to operate. From what I understand this means providing a fake webcam video to Chrome using the --use-file-for-fake-video-capture="/path/to/video.y4m" command line argument. It will then use that as a webcam video.

    However, no matter what y4m file I provide, I get the following error from Chrome running under these conditions :

    DOMException: Could not start video source
    {
     code: 0,
     message: "Could not start video source",
     name: "NotReadableError"
    }

    Notably I can provide an audio file just fine using --use-file-for-fake-audio-capture and Chrome will work with it well. The video has been my sticking point.

    This error comes out of the following straightforward mediaDevices request :

    navigator.mediaDevices.getUserMedia({ video: true, audio: true })
     .then(data => {
       // do stuff
     })
     .catch(err => {
       // oh no!
     });

    (This always hits the “oh no !” branch when a video file is provided.)

    What I’ve tried so far

    I’ve been running Chrome with the following command line arguments (newlines added for readability), and I’m using a Mac hence the open command :

    open -a "Google Chrome" --args
     --disable-gpu
     --use-fake-device-for-media-stream
     --use-file-for-fake-video-capture="~/Documents/mock/webcam.y4m"
     --use-file-for-fake-audio-capture="~/Documents/mock/microphone.wav"

    webcam.y4m and microphone.wav were generated from a video file I recorded.

    I first recorded a twenty-second mp4 video using my browser’s MediaRecorder, downloaded the result, and converted it using the following command line commands :

    ffmpeg -y -i original.mp4 -f wav -vn microphone.wav
    ffmpeg -y -i original.mp4 webcam.y4m

    When this didn’t work, I tried the same using a twenty-second movie file I recorded in Quicktime :

    ffmpeg -y -i original.mov -f wav -vn microphone.wav
    ffmpeg -y -i original.mov webcam.y4m

    When that also failed, I went straight to the Chromium file that explains fake video capture, went to the example y4m file list it provided, and downloaded the grandma file and provided that as a command line argument to Chrome instead :

    open -a "Google Chrome" --args
     --disable-gpu
     --use-fake-device-for-media-stream
     --use-file-for-fake-video-capture="~/Documents/mock/grandma_qcif.y4m"
     --use-file-for-fake-audio-capture="~/Documents/mock/microphone.wav"

    Chrome provides me with the exact same error in all of these situations.

    The only time Chrome doesn’t error out with that mediaDevices request is when I omit the video completely :

    open -a "Google Chrome" --args
     --disable-gpu
     --use-fake-device-for-media-stream
     --use-file-for-fake-audio-capture="~/Documents/mock/microphone.wav"

    Accounting for C420mpeg2

    TestRTC suggests Chrome will “crash” if I give it a C420mpeg2 file, and recommends that simply replacing the metadata fixes the issue. Indeed the video file I generate from ffmpeg gives me the following header :

    YUV4MPEG2 W1280 H720 F30:1 Ip A1:1 C420mpeg2 XYSCSS=420MPEG2

    Chrome doesn’t actually crash when run with this file, I just get the error above. If I edit the video file to the following header though per TestRTC’s recommendations I get the same situation :

    YUV4MPEG2 W1280 H720 F30:1 Ip A1:1 C420 XYSCSS=420MPEG2

    The video file still gives me the above error in these conditions.

    What can/should I do ?

    How should I be providing a video file to Chrome for this command line argument ?

    How should I be recording or creating the video file ?

    How should I convert it to y4m ?

  • How can I correctly provide a mock webcam video to Chrome ?

    15 décembre 2022, par doppelgreener

    I'm trying to run end-to-end testing in Chrome for a product that requires a webcam feed halfway through to operate. From what I understand this means providing a fake webcam video to Chrome using the --use-file-for-fake-video-capture="/path/to/video.y4m" command line argument. It will then use that as a webcam video.

    



    However, no matter what y4m file I provide, I get the following error from Chrome running under these conditions :

    



    DOMException: Could not start video source
{
  code: 0,
  message: "Could not start video source",
  name: "NotReadableError"
}


    



    Notably I can provide an audio file just fine using --use-file-for-fake-audio-capture and Chrome will work with it well. The video has been my sticking point.

    



    This error comes out of the following straightforward mediaDevices request :

    



    navigator.mediaDevices.getUserMedia({ video: true, audio: true })
  .then(data => {
    // do stuff
  })
  .catch(err => {
    // oh no!
  });


    



    (This always hits the “oh no !” branch when a video file is provided.)

    



    What I've tried so far

    



    I've been running Chrome with the following command line arguments (newlines added for readability), and I'm using a Mac hence the open command :

    





    open -a "Google Chrome" --args
  --disable-gpu
  --use-fake-device-for-media-stream
  --use-file-for-fake-video-capture="~/Documents/mock/webcam.y4m"
  --use-file-for-fake-audio-capture="~/Documents/mock/microphone.wav"


    



    webcam.y4m and microphone.wav were generated from a video file I recorded.

    



    I first recorded a twenty-second mp4 video using my browser's MediaRecorder, downloaded the result, and converted it using the following command line commands :

    



    ffmpeg -y -i original.mp4 -f wav -vn microphone.wav
ffmpeg -y -i original.mp4 webcam.y4m


    



    When this didn't work, I tried the same using a twenty-second movie file I recorded in Quicktime :

    



    ffmpeg -y -i original.mov -f wav -vn microphone.wav
ffmpeg -y -i original.mov webcam.y4m


    



    When that also failed, I went straight to the Chromium file that explains fake video capture, went to the example y4m file list it provided, and downloaded the grandma file and provided that as a command line argument to Chrome instead :

    



    open -a "Google Chrome" --args
  --disable-gpu
  --use-fake-device-for-media-stream
  --use-file-for-fake-video-capture="~/Documents/mock/grandma_qcif.y4m"
  --use-file-for-fake-audio-capture="~/Documents/mock/microphone.wav"


    



    Chrome provides me with the exact same error in all of these situations.

    



    The only time Chrome doesn't error out with that mediaDevices request is when I omit the video completely :

    



    open -a "Google Chrome" --args
  --disable-gpu
  --use-fake-device-for-media-stream
  --use-file-for-fake-audio-capture="~/Documents/mock/microphone.wav"


    



    Accounting for C420mpeg2

    



    TestRTC suggests Chrome will “crash” if I give it a C420mpeg2 file, and recommends that simply replacing the metadata fixes the issue. Indeed the video file I generate from ffmpeg gives me the following header :

    



    YUV4MPEG2 W1280 H720 F30:1 Ip A1:1 C420mpeg2 XYSCSS=420MPEG2


    



    Chrome doesn't actually crash when run with this file, I just get the error above. If I edit the video file to the following header though per TestRTC's recommendations I get the same situation :

    



    YUV4MPEG2 W1280 H720 F30:1 Ip A1:1 C420 XYSCSS=420MPEG2


    



    The video file still gives me the above error in these conditions.

    



    What can/should I do ?

    



    How should I be providing a video file to Chrome for this command line argument ?

    



    How should I be recording or creating the video file ?

    



    How should I convert it to y4m ?