Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

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

Autres articles (40)

  • 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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (5017)

  • Why is ffmpeg linking with too many libraries ?

    2 décembre 2020, par Thomas

    I'm trying to build ffmpeg shared libraries for decoding video on Linux systems. The build is done on Arch Linux but the resulting shared libraries need to be as portable as possible.

    


    Fortunately, the functionality built into ffmpeg is sufficient, so I don't want to link with any libraries that might or might not be present on the target system. I'm taking libvdpau as an example of an unwanted dependency here, but there are many more.

    


    Here's what I tried :

    


    $ git clone https://git.ffmpeg.org/ffmpeg.git --branch n4.3.1 --depth 1
$ cd ffmpeg
$ mkdir build
$ cd build
$ ../configure \
    --enable-shared \
    --disable-programs --disable-doc \
    --disable-avdevice --disable-postproc --disable-avfilter \
    --disable-autodetect
$ make -j9


    


    Notice --disable-autodetect which should prevent autodetection of which dependencies happen to be present on the build system.

    


    And yet, when I check the resulting libraries, all of them have dependencies that I didn't ask for. For example :

    


    $ ldd libavcodec/libavcodec.so
    linux-vdso.so.1 (0x00007ffcd73cd000)
    libswresample.so.3 => /usr/lib/libswresample.so.3 (0x00007fba1e45c000)
    libavutil.so.56 => /usr/lib/libavutil.so.56 (0x00007fba1e1a7000)
    libm.so.6 => /usr/lib/libm.so.6 (0x00007fba1e061000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fba1e03f000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007fba1de76000)
    libsoxr.so.0 => /usr/lib/libsoxr.so.0 (0x00007fba1ddf4000)
    libva-drm.so.2 => /usr/lib/libva-drm.so.2 (0x00007fba1dded000)
    libva.so.2 => /usr/lib/libva.so.2 (0x00007fba1ddc0000)
    libva-x11.so.2 => /usr/lib/libva-x11.so.2 (0x00007fba1ddb8000)
    libvdpau.so.1 => /usr/lib/libvdpau.so.1 (0x00007fba1ddb3000)     <- Why is this here?
    libX11.so.6 => /usr/lib/libX11.so.6 (0x00007fba1dc72000)
    libdrm.so.2 => /usr/lib/libdrm.so.2 (0x00007fba1dc5d000)
    libmfx.so.1 => /usr/lib/libmfx.so.1 (0x00007fba1dc4d000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fba1dc47000)
    /usr/lib64/ld-linux-x86-64.so.2 (0x00007fba1f971000)
    libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007fba1dc06000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x00007fba1dbf1000)
    libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007fba1dbe8000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007fba1dbbc000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fba1d9df000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fba1d9c5000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x00007fba1d9c0000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007fba1d9b8000)


    


    I also tried listing all disable flags explicitly, such as --disable-vdpau, but this didn't change anything ; libvdpau.so.1 is still listed in ldd output.

    


    Maybe they are just being linked, but not actually used ? readelf -d seems to point in that direction :

    


    $ ls */*.so
libavcodec/libavcodec.so    libavutil/libavutil.so          libswscale/libswscale.so
libavformat/libavformat.so  libswresample/libswresample.so
$ readelf -d */*.so | grep 'Shared library:' | sort -u
 0x0000000000000001 (NEEDED)             Shared library: [libavcodec.so.58]
 0x0000000000000001 (NEEDED)             Shared library: [libavutil.so.56]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libswresample.so.3]


    


    This is a nice and tight set of dependencies, the way I actually want them to be.

    


    So maybe the build system is stupid and always adds all detected libraries to the linker command line anyway ? To suppress this, I tried adding --extra-ldflags=-Wl,--as-needed, but that doesn't seem to have any effect either.

    


    The resulting linker command line looks like this (abridged) :

    


    $ make -n libavcodec/libavcodec.so.58
gcc \
    -shared \
    -Wl,-soname,libavcodec.so.58 \
    -Wl,-Bsymbolic \
    -Wl,--version-script,libavcodec/libavcodec.ver \
    -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample \
    -Wl,--as-needed \
    -Wl,-z,noexecstack \
    -Wl,--warn-common \
    -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample \
    -Wl,--as-needed \
    -o libavcodec/libavcodec.so.58 \
    [...all .o files...] \
    -lswresample -lavutil -pthread -lm -lm -pthread -lm


    


    It looks like -Wl,--as-needed was already added anyway.

    


    Interestingly, -Llibavdevice is also listed, even though I passed --disable-avdevice --disable-postproc --disable-avfilter to the configure script. That might be a clue : it would pick up my system's libavdevice, which of course comes with far more dependencies. Still I'd expect -Wl,--as-needed to trim these unbuilt dependencies out as well.

    


    Where do these dependencies come from, and how do I get rid of them ?

    


  • Decoded YUV shows green edge when rendered with OpenGL

    2 février 2023, par Alex

    Any idea, why decoded YUV -> RGB(shader conversion) has that extra green edge on the right side ?
    
Almost any 1080X1920 video seems to have this issue.

    


    enter image description here

    


    A screen recording of the issue is uploaded here https://imgur.com/a/JtUZq4h

    


    Once I manually scale up the texture width, I can see it fills up to the viewport, but it would be nice if I could fix the actual cause. Is it some padding that's part of YUV colorspace ? What else could it be ?

    


    My model is -1 to 1, filling the entire width
    
The texture coordinates are also 0 to 1 ratio

    


    float vertices[] = {
    -1.0, 1.0f, 0.0f, 0.0,     // top left
     1.0f, 1.0f, 1.0, 0.0,      // top right
    -1.0f, -1.0f, 0.0f, 1.0f,  // bottom left
     1.0f, -1.0f, 1.0f, 1.0f    // bottom right
};


    


    Fragment Shader

    


    #version 330 core

in vec2 TexCoord;

out vec4 FragColor;
precision highp float;
uniform sampler2D textureY;
uniform sampler2D textureU;
uniform sampler2D textureV;
uniform float alpha;
uniform vec2 texScale;


void main()
{
    float y = texture(textureY, TexCoord / texScale).r;
    float u = texture(textureU, TexCoord / texScale).r - 0.5; 
    float v = texture(textureV, TexCoord / texScale).r - 0.5;
    
    vec3 rgb;
    
    //yuv - 709
    rgb.r = clamp(y + (1.402 * v), 0, 255);
    rgb.g = clamp(y - (0.2126 * 1.5748 / 0.7152) * u - (0.0722 * 1.8556 / 0.7152) * v, 0, 255);
    rgb.b = clamp(y + (1.8556 * u), 0,255);

    FragColor = vec4(rgb, 1.0);
} 


    


    Texture Class

    


    class VideoTexture {
   public:
    VideoTexture(Decoder *dec) : decoder(dec) {
        glGenTextures(1, &texture1);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glBindTexture(GL_TEXTURE_2D, texture1);
        glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, decoder->frameQueue.first().linesize[0], decoder->frameQueue.first().height, 0, format, GL_UNSIGNED_BYTE, 0);
        glGenerateMipmap(GL_TEXTURE_2D);

        glGenTextures(1, &texture2);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glBindTexture(GL_TEXTURE_2D, texture2);
        glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, decoder->frameQueue.first().linesize[1], decoder->frameQueue.first().height / 2, 0, format, GL_UNSIGNED_BYTE, 0);
        glGenerateMipmap(GL_TEXTURE_2D);

        glGenTextures(1, &texture3);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glBindTexture(GL_TEXTURE_2D, texture3);
        glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, decoder->frameQueue.first().linesize[2], decoder->frameQueue.first().height / 2, 0, format, GL_UNSIGNED_BYTE, 0);
        glGenerateMipmap(GL_TEXTURE_2D);
    }

    void Render(Shader *shader, Gui *gui) {
        if (decoder->frameQueue.isEmpty()) {
            return;
        }

        glActiveTexture(GL_TEXTURE0);
        glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, decoder->frameQueue.first().linesize[0], decoder->frameQueue.first().height, format, GL_UNSIGNED_BYTE, decoder->frameQueue.at(currentFrame).data[0]);
        glBindTexture(GL_TEXTURE_2D, texture1);
        shader->setInt("textureY", 0);

        glActiveTexture(GL_TEXTURE1);
        glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, decoder->frameQueue.first().linesize[1], decoder->frameQueue.first().height / 2, format, GL_UNSIGNED_BYTE, decoder->frameQueue.at(currentFrame).data[1]);
        glBindTexture(GL_TEXTURE_2D, texture2);
        shader->setInt("textureU", 1);

        glActiveTexture(GL_TEXTURE2);
        glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, decoder->frameQueue.first().linesize[2], decoder->frameQueue.first().height / 2, format, GL_UNSIGNED_BYTE, decoder->frameQueue.at(currentFrame).data[2]);
        glBindTexture(GL_TEXTURE_2D, texture3);
        shader->setInt("textureV", 2);
    }

    ~VideoTexture() {
        printf("\nVideo texture destructor");
        glDeleteTextures(1, &texture1);
        glDeleteTextures(1, &texture2);
        glDeleteTextures(1, &texture3);
    }

   private:
    GLuint texture1;
    GLuint texture2;
    GLuint texture3;
    GLint internalFormat = GL_RG8;
    GLint format = GL_RED;
    int currentFrame = 0;
    Decoder *decoder;
}


    


  • ffmpeg command to convert 720p to 1080p, 1440p, 2160p compatible with YouTube [closed]

    24 juin 2024, par Tendekai Muchenje

    I have a video that I created in Final Cut Pro. When i uploaded it to Youtube, it only maxes out at 720p. I would like it to have higher options like 1080, 1440 and 2160 even if the quality does not change. Maybe 2160 is impossible, but 1440p would be nice. I have tried this command, but the resulting file is unplayable, it only plays audio.

    


    ffmpeg -i Hey\ Girl.mov -vf scale=3840x2160:flags=lanczos -c:v libx264 -crf 13 -c:a aac -b:a 512k -preset slow hey_girl_hd.mov


    


    I am looking for a command that would make at least 1080 and 1440 work on YouTube. If 2160 can work, that would be great too. If it matters, here is all the info that ffprobe throws out about the file

    


    {
    "streams": [
        {
            "index": 0,
            "codec_name": "pcm_s24le",
            "codec_long_name": "PCM signed 24-bit little-endian",
            "codec_type": "audio",
            "codec_tag_string": "lpcm",
            "codec_tag": "0x6d63706c",
            "sample_fmt": "s32",
            "sample_rate": "48000",
            "channels": 2,
            "bits_per_sample": 24,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/48000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 8987200,
            "duration": "187.233333",
            "bit_rate": "2304000",
            "bits_per_raw_sample": "24",
            "nb_frames": "8987200",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "creation_time": "2024-04-15T23:26:08.000000Z",
                "language": "und",
                "handler_name": "Core Media Audio",
                "vendor_id": "[0][0][0][0]"
            }
        },
        {
            "index": 1,
            "codec_name": "prores",
            "codec_long_name": "Apple ProRes (iCodec Pro)",
            "profile": "Standard",
            "codec_type": "video",
            "codec_tag_string": "apcn",
            "codec_tag": "0x6e637061",
            "width": 1280,
            "height": 720,
            "coded_width": 1280,
            "coded_height": 720,
            "closed_captions": 0,
            "has_b_frames": 0,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "16:9",
            "pix_fmt": "yuv422p10le",
            "level": -99,
            "color_range": "tv",
            "color_space": "bt709",
            "color_transfer": "bt709",
            "color_primaries": "bt709",
            "field_order": "progressive",
            "refs": 1,
            "r_frame_rate": "60/1",
            "avg_frame_rate": "60/1",
            "time_base": "1/6000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 1123400,
            "duration": "187.233333",
            "bit_rate": "138655195",
            "bits_per_raw_sample": "10",
            "nb_frames": "11234",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "creation_time": "2024-04-15T23:26:08.000000Z",
                "language": "und",
                "handler_name": "Core Media Video",
                "vendor_id": "[0][0][0][0]",
                "encoder": "Apple ProRes 422",
                "timecode": "00:00:00:00"
            }
        },
        {
            "index": 2,
            "codec_type": "data",
            "codec_tag_string": "tmcd",
            "codec_tag": "0x64636d74",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "6000/100",
            "time_base": "1/6000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 1123400,
            "duration": "187.233333",
            "nb_frames": "1",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "creation_time": "2024-04-15T23:26:08.000000Z",
                "language": "und",
                "handler_name": "Core Media Time Code",
                "timecode": "00:00:00:00"
            }
        }
    ],
    "format": {
        "filename": "Hey Girl.mov",
        "nb_streams": 3,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.000000",
        "duration": "187.233333",
        "size": "3306875809",
        "bit_rate": "141294320",
        "probe_score": 100,
        "tags": {
            "major_brand": "qt  ",
            "minor_version": "0",
            "compatible_brands": "qt  ",
            "creation_time": "2024-04-15T23:26:08.000000Z",
            "com.apple.quicktime.keywords": "Hey GIRL",
            "com.apple.quicktime.description": "This video is about Hey Girl",
            "com.apple.quicktime.author": "Ja Mo",
            "com.apple.quicktime.displayname": "Hey Girl",
            "com.apple.quicktime.title": "Hey Girl"
        }
    }
}