Recherche avancée

Médias (91)

Autres articles (98)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • 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

Sur d’autres sites (8603)

  • How can I encode a video to play on a DLink DSM-520 using FFMPEG ?

    17 octobre 2020, par tolsen64

    I have been searching, testing, and coming up with nothing for over a week. I want to use FFMPEG to convert mp4's and mkv's to AVI files that will play on my DLink DSM-520. Mencoder will do it. The files that FFMPEG generates cause the player to lock up less than a minute into the video. First, here's what I use to encode the file using Mencoder (scraped from the test.bat file that PocketDIVXEncoder generates :

    



    mencoder.exe ftwd105.mp4 -af volnorm -srate 44100 -oac mp3lame -lameopts mode=0:cbr:br=128 -noodml -vf pp=ac,scale=720:404,crop=720:400,harddup -sws 9 -ovc lavc -lavcopts vcodec=mpeg4:mbd=1:last_pred=2:vstrict=1:threads=2:vmax_b_frames=0:vbitrate=1200 -ffourcc XVID -o ftwd105_HDTV.avi


    



    The output file plays perfectly on the DSM-520. Looking at the file using FFPROBE, I see this :

    



    Input #0, avi, from 'ftwd105_HDTV.avi':
  Metadata:
    encoder         : MEncoder Redxii-SVN-r37527-4.9.3 (x86_64)
  Duration: 00:44:32.96, start: 0.000000, bitrate: 1193 kb/s
    Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 720x400 [SAR 1:1 DAR 9:5], 1053 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 24k tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 128 kb/s


    



    So now I try the same thing with FFMPEG.

    



    ffmpeg -i ftwd105.mp4 -vcodec mpeg4 -vtag XVID -b:v 1200k -s 720x400 -acodec libmp3lame -ab 128k -ar 44100 -ac 2 -f avi ftwd105_ffmpeg.avi


    



    This file does not play on the media player. It plays choppy with only clicking for sound for about 15-30 seconds, then it freezes. Looking at it with FFPROBE, it looks exactly the same as the one created by Mencoder.

    



    Input #0, avi, from 'ftwd105_ffmpeg.avi':
  Metadata:
    encoder         : Lavf57.0.100
  Duration: 00:44:33.14, start: 0.000000, bitrate: 1305 kb/s
    Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 720x400 [SAR 1:1 DAR 9:5], 1165 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 24k tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 128 kb/s


    



    So now I encode the video using Xvid4PSP. It plays perfectly fine and FFPROBE shows this :

    



    Input #0, avi, from 'ftwd105_ps2.avi':
  Metadata:
    encoder         : VirtualDubMod 1.5.10.3 | www.virtualdub-fr.org || (build 2550/release)
  Duration: 00:44:33.09, start: 0.000000, bitrate: 861 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x400 [SAR 1:1 DAR 9:5], 723 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 128 kb/s


    



    It's using Advanced Simple Profile so I look this up and change my FFMPEG options :

    



    ffmpeg -i ftwd105.mp4 -vcodec mpeg4 -vtag XVID -b:v 1200k -s 720x400 -profile:v 15 -level 0 -acodec libmp3lame -ab 128k -ar 44100 -ac 2 -f avi ftwd105_ffmpeg.avi


    



    But though the output file looks the same using FFPROBE as the one made by Xvid4PSP, it still doesn't play on the DSM-520.

    



    Input #0, avi, from 'ftwd105_ffmpeg_asp.avi':
  Metadata:
    encoder         : Lavf57.0.100
  Duration: 00:44:33.14, start: 0.000000, bitrate: 1305 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x400 [SAR 1:1 DAR 9:5], 1165 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 24k tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 128 kb/s


    



    So now i'm at a loss. Is FFMPEG incapable of generating a file that the DSM-520 can play ? The reason I want to use FFMPEG over Mencoder is that it's much faster. What takes FFMPEG 15 minutes takes Mencoder 40.

    



    I should note that all the files created by FFMPEG play fine on the PC and on my Visio television. The DSM-520 is hooked up to a bedroom tv that isn't a smart tv.

    



    Edit : I also tried libxvid in place of mpeg4 with the same results.

    


  • 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 ?

    


  • 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 ?