Recherche avancée

Médias (0)

Mot : - Tags -/utilisateurs

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (111)

  • 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

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

  • Prérequis à l’installation

    31 janvier 2010, par

    Préambule
    Cet article n’a pas pour but de détailler les installations de ces logiciels mais plutôt de donner des informations sur leur configuration spécifique.
    Avant toute chose SPIPMotion tout comme MediaSPIP est fait pour tourner sur des distributions Linux de type Debian ou dérivées (Ubuntu...). Les documentations de ce site se réfèrent donc à ces distributions. Il est également possible de l’utiliser sur d’autres distributions Linux mais aucune garantie de bon fonctionnement n’est possible.
    Il (...)

Sur d’autres sites (9981)

  • FFMPEG Recording Audio from Adafruit I2S MEMS Microphone Having Issues

    24 juin 2021, par Turkey

    I am attempting to use FFMPEG to record and stream video off a Raspberry Pi Zero using the pi camera and the Adafruit I2S MEMS Microphone. I have successfully gotten video recording, but I am having trouble getting the audio correctly added on.

    


    I followed the directions at https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout/raspberry-pi-wiring-test and using their command of arecord -D dmic_sv -c2 -r 44100 -f S32_LE -t wav -V mono -v file.wav I do get a correct audio recording with no issues.

    


    However with my FFMPEG command of ffmpeg -f alsa -ar 44100 -ac 2 -c:a pcm_s32le -i default:CARD=sndrpii2scard -vcodec h264 -framerate 30 -i - -pix_fmt yuv420p -preset ultrafast -crf 0 -vcodec copy -codec:a aac -f segment -segment_time 1800 -segment_start_number 1 /RPICRecord%04d.mkv (The last bit starting at -f segment varies depending on recording vs streaming) I get audio that sorta just has a blip and then sounds like it's resetting. The actual recorded video also seems to not play correctly locally, however it does on YouTube. Testing with streaming the video and audio does the same, but it produces a consistent pattern on the audio blips. In the stream video I also finger snap 5 or so times, but you only ever hear 2, so it's for sure not recoding everything.

    


    


    My limited knowledge of FFMPEG has failed me here to understand why this happens or how to debug this further to work towards a fix. Let me know if there is any additional info or logs that would be beneficial.

    


  • FFmpeg change output to specific pixel format ?

    22 mars 2021, par R.martinez

    I am working on an openCV project, I have a stable running variant that is taking input from an HDMI capture card and using FFmpeg to output to a v4L2 loopback device (/dev/video0) my openCV project takes its input from /dev/video0.

    



    The issue comes when I try to use an rtsp feed, the following command works to send the feed to my loopback device :

    



    ffmpeg -rtsp_transport tcp -i rtsp://@192.168.1.27:552//stream1 -acodec rawvideo -vcodec rawvideo -f v4l2 /dev/video0


    



    And I am able to view that feed with VLC (on /dev/video0) no problem, however when I feed it to my openCV app, I get the following error :

    



    VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV


    



    When I run v4l2-ctl -d /dev/video0 --all on both working and non working variants this is what I get :

    



    Working output

    



    Format Video Output:
Width/Height      : 1920/1080
Pixel Format      : 'UYVY'
Field             : None
Bytes per Line    : 3840
Size Image        : 4147200
Colorspace        : sRGB
Transfer Function : Default
YCbCr Encoding    : Default
Quantization      : Default
Flags             : 


    



    Nonfunctional output

    



    Format Video Output:
Width/Height      : 1280/720
Pixel Format      : 'YU12'
Field             : None
Bytes per Line    : 1280
Size Image        : 1382400
Colorspace        : sRGB
Transfer Function : Default
YCbCr Encoding    : Default
Quantization      : Default
Flags             : 


    



    So I am concluding that the pixel format 'YU12' is not compatible with openCV while format 'UYVY' is. If it's possible, how do I set the output of FFmpeg to be in pixel format UYVY when the input is YU12 ?

    


  • ffmpeg produces video with misaligned frames

    28 mars 2023, par massivemoisture

    I have a WPF app that uses DeckLinkAPI to stream video from Blackmagic capture card (similar to their 'CapturePreviewCSharp' sample project, which can be found here : https://www.blackmagicdesign.com/developer/)

    


    'VideoInputFrameArrived' method is called when a video input frame arrives :

    


    void IDeckLinkInputCallback.VideoInputFrameArrived(IDeckLinkVideoInputFrame videoFrame, IDeckLinkAudioInputPacket audioPacket)
{
    if (videoFrame != null)
    {
        CurrentFrame = videoFrame;
        VideoFrameArrived?.Invoke(this, new DeckLinkDeviceInputVideoFrameEventArgs(videoFrame));
        GC.AddMemoryPressure(videoFrame.GetRowBytes() * videoFrame.GetHeight());
    }
}


    


    I want to record the stream to a file. So I open a ffmpeg process with these arguments :

    


    // My source is 1080p
string args = $".\\ffmpeg.exe -y -f rawvideo -pix_fmt bgra -s 1920x1080 -r 30 -i - -c:v libx264 -preset ultrafast -pix_fmt yuv420p -crf 23 \"{outputFilePath}\"";


    


    And I write to ffmpeg's pipe :

    


    // ffmpegInputStream = FfmpegProcess.StandardInput.BaseStream
public void WriteVideoFrameToProcessStream(Stream ffmpegInputStream)
{
    while (true)
    {
        if (isRecording == true)
        {
            if (ffmpegInputStream != null)
            {
                // Convert the frame to BGRA32 format and convert the video frame to a byte array
                byte[] frameData = ConvertVideoFrameToByteArray(CurrentFrame);
                // Write the frame data to the ffmpeg input stream
                ffmpegInputStream.Write(frameData, 0, frameData.Length);
            }
        }
    }
}


    


    But the video file output has misaligned frames. The frame looks like it has been shifted to the left. 1/5 of the frame on the right is supposed to be on the left.
enter image description here

    


    I tried saving the frameData byte array in WriteVideoFrameToProcessStream to an image file and it looks fine. What could be wrong here ?