Recherche avancée

Médias (0)

Mot : - Tags -/images

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

Autres articles (91)

  • Les sons

    15 mai 2013, par
  • Soumettre bugs et patchs

    10 avril 2011

    Un logiciel n’est malheureusement jamais parfait...
    Si vous pensez avoir mis la main sur un bug, reportez le dans notre système de tickets en prenant bien soin de nous remonter certaines informations pertinentes : le type de navigateur et sa version exacte avec lequel vous avez l’anomalie ; une explication la plus précise possible du problème rencontré ; si possibles les étapes pour reproduire le problème ; un lien vers le site / la page en question ;
    Si vous pensez avoir résolu vous même le bug (...)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (6777)

  • Hide ffmpeg's console window when running YoutubeDL in GUI application

    23 juin 2016, par Slayther

    I’m developing a basic application which can download YouTube videos. Throughout the development, I had several quirks, including issues with formats.

    I decided to use a hopefully foolproof format syntax that youtube-dl will happily download for me in almost any case.

    Part of my YoutubeDL options look like this :

    self.ydl_opts = {
       'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best',
       'quiet': True,
       'progress_hooks': [self.ydl_progress],
       'outtmpl': None
    }

    The outtmpl is inserted later on when output folder is chosen by the user.

    Since I’m using this format string, youtube-dl uses ffmpeg to merge(?) the audio and video if they are downloaded separately.

    When it does that, it opens very annoying console windows that capture the focus and interrupt other things I might be doing while the videos are downloading.

    My question is, how can I prevent ffmpeg or youtube-dl from creating those console windows from appearing, aka. how can I hide them ?

    EDIT :

    I’ll provide bare bones script that reproduces the problem :

    from __future__ import unicode_literals
    from PyQt4 import QtGui, QtCore
    import youtube_dl, sys

    def on_progress(info):
       print info.get("_percent_str", "Finished")

    ydl_opts = {
       'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best',
       'progress_hooks': [on_progress],
       'quiet': True,
       'outtmpl': "C:/Users/Raketa/Desktop/%(title)s.%(ext)s"
    }

    ydl = youtube_dl.YoutubeDL(ydl_opts)

    class DownloadThread(QtCore.QThread):
       def __init__(self):
           super(DownloadThread, self).__init__()
           self.start()

       def __del__(self):
           self.wait()

       def run(self):
           print "Download start"
           ydl.download(["https://www.youtube.com/watch?v=uy7BiiOI_No"])
           print "Download end"

    class Application(QtGui.QMainWindow):
       def __init__(self):
           super(Application, self).__init__()
           self.dl_thread = DownloadThread()

       def run(self):
           self.show()

    def main():
       master = QtGui.QApplication(sys.argv)

       app = Application()
       app.run()

       sys.exit(master.exec_())

    if __name__ == '__main__':
       main()

    2(?) consoles appear at start of each download and 1 longer lasting console appears when both video and audio are downloaded. When downloading longer videos, the last console becomes unbearable.

    Is it possible to get rid of those ?

  • How to render a frame to a screen window via D3D11

    19 juin 2024, par mercuric taylor

    I have successfully decoded a video using FFmpeg with the AV_HWDEVICE_TYPE_D3D11VA decoder, and I currently have a AVFrame on the GPU.

    


    To render this frame, my approach includes the following steps :

    


    1.I created a D3D class. Besides the basic initialization (device, context, viewport), the core part is texture. To directly copy the frame on the GPU to the shared texture, I have the following two functions.

    


    void D3D::InitScence(ID3D11Device* device, UINT width, UINT height) {&#xA;    D3D11_TEXTURE2D_DESC tdesc = {};&#xA;    tdesc.Width = width;&#xA;    tdesc.Height = height;&#xA;    tdesc.MipLevels = 1;&#xA;    tdesc.ArraySize = 1;&#xA;    tdesc.Format = DXGI_FORMAT_NV12;&#xA;    tdesc.SampleDesc.Count = 1;&#xA;    tdesc.Usage = D3D11_USAGE_DEFAULT;&#xA;    tdesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;&#xA;    tdesc.CPUAccessFlags = 0;&#xA;    tdesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED;&#xA;&#xA;    HRESULT hr = device->CreateTexture2D(&amp;tdesc, nullptr, sharedTexture.GetAddressOf());&#xA;    if (FAILED(hr)) {&#xA;        throw std::runtime_error("Failed to create shared texture.");&#xA;    }&#xA;&#xA;    ComPtr<idxgiresource> dxgiResource;&#xA;    sharedTexture.As(&amp;dxgiResource);&#xA;    hr = dxgiResource->GetSharedHandle(&amp;sharedHandle);&#xA;    if (FAILED(hr)) {&#xA;        throw std::runtime_error("Failed to get shared handle.");&#xA;    }&#xA;&#xA;    D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {};&#xA;    srvDesc.Format = DXGI_FORMAT_R8_UNORM;&#xA;    srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;&#xA;    srvDesc.Texture2D.MostDetailedMip = 0;&#xA;    srvDesc.Texture2D.MipLevels = 1;&#xA;&#xA;    hr = device->CreateShaderResourceView(sharedTexture.Get(), &amp;srvDesc, srvY.GetAddressOf());&#xA;    if (FAILED(hr)) {&#xA;        throw std::runtime_error("Failed to create SRV for Y plane.");&#xA;    }&#xA;&#xA;    srvDesc.Format = DXGI_FORMAT_R8G8_UNORM;&#xA;    hr = device->CreateShaderResourceView(sharedTexture.Get(), &amp;srvDesc, srvUV.GetAddressOf());&#xA;    if (FAILED(hr)) {&#xA;        throw std::runtime_error("Failed to create SRV for UV plane.");&#xA;    }&#xA;}&#xA;&#xA;void D3D::RenderFrame() {&#xA;   &#xA;    float clearColor[4] = { 0.0f, 0.0f, 0.0f, 1.0f };&#xA;    deviceContext->ClearRenderTargetView(backbuffer.Get(), clearColor);&#xA;&#xA;    &#xA;    ID3D11ShaderResourceView* srvs[] = { srvY.Get(), srvUV.Get() };&#xA;    deviceContext->PSSetShaderResources(0, 2, srvs);&#xA;&#xA;  &#xA;    deviceContext->IASetInputLayout(inputLayout.Get());&#xA;    deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);&#xA;    UINT stride = sizeof(Vertex);&#xA;    UINT offset = 0;&#xA;    deviceContext->IASetVertexBuffers(0, 1, vertexBuffer.GetAddressOf(), &amp;stride, &amp;offset);&#xA;    deviceContext->IASetIndexBuffer(indexBuffer.Get(), DXGI_FORMAT_R32_UINT, 0);&#xA;&#xA;    deviceContext->VSSetShader(vertexShader.Get(), nullptr, 0);&#xA;    deviceContext->PSSetShader(pixelShader.Get(), nullptr, 0);&#xA;&#xA;    deviceContext->DrawIndexed(6, 0, 0);&#xA;&#xA;    swapchain->Present(1, 0);&#xA;}&#xA;&#xA;</idxgiresource>

    &#xA;

    The function to copy the AVFrame to the shared texture is this one, and I call it after successfully decoding a frame :

    &#xA;

    void Decode::UpdateVideoTexture(AVFrame* frame, D3D&amp; dxInstance)&#xA;{&#xA;    ID3D11Texture2D* t_frame = (ID3D11Texture2D*)frame->data[0];&#xA;&#xA;    ComPtr<id3d11device> device;&#xA;    t_frame->GetDevice(device.GetAddressOf());&#xA;&#xA;    ComPtr<id3d11devicecontext> deviceCtx;&#xA;    device->GetImmediateContext(&amp;deviceCtx);&#xA;&#xA;    ComPtr<id3d11texture2d> videoTexture;&#xA;    device->OpenSharedResource(dxInstance.sharedHandle, __uuidof(ID3D11Texture2D), (void**)&amp;videoTexture);&#xA;&#xA;    deviceCtx->CopySubresourceRegion(videoTexture.Get(), 0, 0, 0, 0, t_frame, 0, nullptr);&#xA;    deviceCtx->Flush();&#xA;}&#xA;</id3d11texture2d></id3d11devicecontext></id3d11device>

    &#xA;

    But obviously I didn't get the results I expected, and I couldn't find where the problem was. From the debug results, it seems that CopySubresourceRegion did not succeed.&#xA;Can anyone tell me where is the problem ? Or are there is any open source projects very similar to mine ?

    &#xA;

  • Fixes jQuery 1.5- code by using jQuery.ajaxSettings and not window.ajaxSettings (yeah, that was dumb).

    2 février 2011, par jaubourg

    m jquery.validate.js m jquery.validate.min.js Fixes jQuery 1.5- code by using jQuery.ajaxSettings and not window.ajaxSettings (yeah, that was dumb).