Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (29)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • 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

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (4620)

  • VB.Net Stream Bitmap/Image TO FFMpeg is not working :(

    6 février 2015, par Zakir_SZH

    I m trying to port images to FFMpeg using StandardInput. It’s not working somehow ? :(

    it’s throwing me bellow error :(

    enter image description here

    Here is the code i tried :

       Dim objBitmap As System.Drawing.Bitmap
       Dim objFProcess As System.Diagnostics.Process
       Dim objStream As System.IO.BinaryWriter
       Dim strFiles() As String
       Dim strEachFile As String
       Dim intFile As Integer
       Dim intFrame As Integer
       Dim intFLoop As Integer
       objFProcess = New System.Diagnostics.Process
       objFProcess.StartInfo.FileName = "c:\ffmpeg.exe"
       objFProcess.StartInfo.Arguments = "-r 1 -f image2pipe -i pipe:.bmp -pix_fmt yuv420p -crf 35.0 -vcodec libx264 -an -coder 1 -rc_lookahead 50 -threads 0 D:\test.mp4"
       objFProcess.StartInfo.UseShellExecute = False
       objFProcess.StartInfo.RedirectStandardInput = True
       objFProcess.StartInfo.RedirectStandardOutput = True
       objFProcess.StartInfo.RedirectStandardError = True
       rem objFProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
       rem objFProcess.StartInfo.CreateNoWindow = True
       objFProcess.Start()
       objStream = New System.IO.BinaryWriter(objFProcess.StandardInput.BaseStream)
       strFiles = My.Computer.Clipboard.GetText().Split({System.Environment.NewLine}, StringSplitOptions.None)
       intFrame = 0
       intFile = 0
       For Each strEachFile In strFiles
           rem MessageBox.Show(strEachFile)
           intFile = intFile + 1
           objBitmap = New System.Drawing.Bitmap(strEachFile)
           For intFLoop = 0 To 24
               intFrame = intFrame + 1
               cmd1.Text = intFile.ToString & "-" & intFrame.ToString
               My.Application.DoEvents()
               objBitmap.Save(objStream.BaseStream, System.Drawing.Imaging.ImageFormat.Bmp) Rem this line give me above (attached) error :(
           Next
           objBitmap.Dispose()
       Next
       System.Threading.Thread.Sleep(3000)
       objStream.Close()
       MessageBox.Show("Done!")
       rem objFProcess.Kill()

    any help would be highly appreciated

    thanks in advance...

    Edit-1 :
    As asked by some one :) here is :

    View Detail Result : (Sorry, the image is very large in width/height)

    enter image description here

    And here is the Copy Details Result :

    System.Runtime.InteropServices.ExternalException was unhandled
    ErrorCode=-2147467259
    Message=A generic error occurred in GDI+.
    Source=System.Drawing
    StackTrace:
      at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
      at System.Drawing.Image.Save(Stream stream, ImageFormat format)
      at FFMpeg_Stream.Form1.cmd1_Click(Object sender, EventArgs e) in g:\My Documents\FFMpeg Stream\FFMpeg Stream\Form1.vb:line 40
      at System.Windows.Forms.Control.OnClick(EventArgs e)
      at System.Windows.Forms.Button.OnClick(EventArgs e)
      at System.Windows.Forms.Button.WndProc(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
      at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
      at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
      at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
      at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
      at System.Windows.Forms.Control.WmCommand(Message& m)
      at System.Windows.Forms.Control.WndProc(Message& m)
      at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
      at System.Windows.Forms.Form.WndProc(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
      at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
      at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
      at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
      at System.Windows.Forms.Control.DefWndProc(Message& m)
      at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
      at System.Windows.Forms.Control.WndProc(Message& m)
      at System.Windows.Forms.ButtonBase.WndProc(Message& m)
      at System.Windows.Forms.Button.WndProc(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
      at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
      at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
      at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
      at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
      at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
      at System.Windows.Forms.Application.Run(ApplicationContext context)
      at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
      at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
      at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
      at FFMpeg_Stream.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
      at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
      at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
      at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
      at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
      at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
      at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
      at System.Threading.ThreadHelper.ThreadStart()
    InnerException:

    that’s all i can give as information :(

  • YUV4:2:0 conversion to RGB outputs overly green image

    27 février 2023, par luckybroma

    I'm decoding video and getting YUV 420 frames. In order to render them using D3D11, they need to get converted to RGB (or at least I assume that the render target view cannot be YUV itself).

    


    The YUV frames are all in planar format, meaning UV and not packed. I'm creating 3 textures and ShaderResourceViews of type DXGI_FORMAT_R8G8_UNORM. I'm copying each plane from the frame into it's own ShaderResourceView. I'm then relying on the sampler to account for the differences in size between the Y and UV planes. Black/White only looks great. If I add in color though, I get an overly Green Picture :
enter image description here

    


    I'm at a huge loss of what I could be doing wrong.. I've tried switching the UV and planes around, I've also tried tweaking the conversion values. I'm following Microsoft's guide on picture conversion.

    


    Here is my shader :

    


    min16float4 main(PixelShaderInput input) : SV_TARGET
{
    float y = YChannel.Sample(defaultSampler, input.texCoord).r;
    float u = UChannel.Sample(defaultSampler, input.texCoord).r - 0.5;
    float v = VChannel.Sample(defaultSampler, input.texCoord).r - 0.5;

    float r = y + 1.13983 * v;
    float g = y - 0.39465 * u - 0.58060 * v;
    float b = y + 2.03211 * u;

    return min16float4(r, g, b , 1.f);
}


    


    Creating my ShaderResourceViews :

    


    D3D11_TEXTURE2D_DESC texDesc;
    ZeroMemory(&texDesc, sizeof(texDesc));
    texDesc.Width = 1670;
    texDesc.Height = 626;
    texDesc.MipLevels = 1;
    texDesc.ArraySize = 1;
    texDesc.Format = DXGI_FORMAT_R8_UNORM;
    texDesc.SampleDesc.Count = 1;
    texDesc.SampleDesc.Quality = 0;
    texDesc.Usage = D3D11_USAGE_DYNAMIC;
    texDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
    texDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;


    dev->CreateTexture2D(&texDesc, NULL, &pYPictureTexture);
    dev->CreateTexture2D(&texDesc, NULL, &pUPictureTexture);
    dev->CreateTexture2D(&texDesc, NULL, &pVPictureTexture);
    
    D3D11_SHADER_RESOURCE_VIEW_DESC shaderResourceViewDesc;
    shaderResourceViewDesc.Format = DXGI_FORMAT_R8_UNORM;
    shaderResourceViewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
    shaderResourceViewDesc.Texture2D.MostDetailedMip = 0;
    shaderResourceViewDesc.Texture2D.MipLevels = 1;

    dev->CreateShaderResourceView(pYPictureTexture, &shaderResourceViewDesc, &pYPictureTextureResourceView);

    dev->CreateShaderResourceView(pUPictureTexture, &shaderResourceViewDesc, &pUPictureTextureResourceView);
    
    dev->CreateShaderResourceView(pVPictureTexture, &shaderResourceViewDesc, &pVPictureTextureResourceView);



    


    And then How I'm copying the decoded ffmpeg AVFrames :

    


        int height = 626;
    int width = 1670;    

    D3D11_MAPPED_SUBRESOURCE msY;
    D3D11_MAPPED_SUBRESOURCE msU;
    D3D11_MAPPED_SUBRESOURCE msV;
    devcon->Map(pYPictureTexture, 0, D3D11_MAP_WRITE_DISCARD, 0, &msY);

    memcpy(msY.pData, frame->data[0], height * width);
    devcon->Unmap(pYPictureTexture, 0);

    devcon->Map(pUPictureTexture, 0, D3D11_MAP_WRITE_DISCARD, 0, &msU);
    memcpy(msU.pData, frame->data[1], (height*width) / 4);
    devcon->Unmap(pUPictureTexture, 0);


    devcon->Map(pVPictureTexture, 0, D3D11_MAP_WRITE_DISCARD, 0, &msV);
    memcpy(msV.pData, frame->data[2], (height*width) / 4);
    devcon->Unmap(pVPictureTexture, 0);


    


    PS : Happy to provide any more additional requested code ! I just wanted to be concise as possible.

    


  • FFMpeg decoded audio frames and replaygain

    24 février 2017, par Rednemus

    I am doing a replaygain calculator on android. So i use ffmpeg for android to decode audio frames and then use lame’s replaygain to calculate the track gain.
    Here i’m only trying with sample format of 2 bytes and planar audio. Float_t is a typedef of float.

    int dataBytes = av_get_bytes_per_sample(codecContext->sample_fmt);
    for(int i =0;i< frame->nb_samples;i++){
            Float_t fright = (((uint32_t)frame->data[0][dataBytes*i]) << 8) + (uint32_t)frame->data[0][dataBytes*i+1];
            Float_t fleft = (((uint32_t)frame->data[1][dataBytes*i]) << 8) + (uint32_t)frame->data[1][dataBytes*i+1];
              int rez = AnalyzeSamples(&rg,&fleft,&fright, 1, 2);
              if(rez != GAIN_ANALYSIS_OK)
                      qDebug()<< "error in analysis";
    }

    The frame->data are uint8_t and music format is 2 bytes so i need to put together the bytes (fright for channel 0 and fleft for channel 1).
    AnalyseSamples comes from gain_analysis in lame library. When i use lame application I have a different gain output than in my application.
    I think the problem comes from this code but i cannot figure out what’s going on.
    Is there anything wrong with it ?