Recherche avancée

Médias (91)

Autres articles (47)

  • 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 (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

  • 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 (6266)

  • How do I improve the quality of a video produced from still PNG images ?

    9 avril 2012, par cormullion

    I'm trying to create a video from a few hundred PNG images. The PNG images look OK to me, e.g. here are two in MacOS X Preview :

    two images

    They're about 1200 pixels square, 16 bit RGB, no transparency.

    But my attempt to make a few hundred of these into a video is encountering the following problem - nearly every frame has this yellow corruption (artefacts ?), that sort of blocky flickery stuff you see on poor quality videos :

    video still

    The ffmpeg command I'm using is something like this :

    ffmpeg -f image2 -i /tmp/image-%07d.png -vcodec mpeg4 -vb 20M -r 20 poincare.mov

    I've tried changing a few parameters, but I probably changed the wrong ones. Any idea which parameters I should be changing, and to what value ?

    Console output is :

    ffmpeg -f image2 -i /tmp/image-%07d.png -vcodec mpeg4 -vb 30M -r 30 poincare.mov
       FFmpeg version UNKNOWN, Copyright (c) 2000-2010 the FFmpeg developers
       built on Nov  9 2010 12:20:29 with gcc 4.2.1 (Apple Inc. build 5664)
       configuration: --prefix=/Users/worth/OtherApps/ffmpeg/ffmpeg/../local/x86_64 --enable-static --enable-shared --enable-gpl --enable-version3 --enable-libmp3lame --enable-pthreads --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-libvpx --enable-memalign-hack --disable-debug --disable-stripping --arch=x86_64
     libavutil     50.33. 0 / 50.33. 0
     libavcore      0.12. 0 /  0.12. 0
     libavcodec    52.94. 3 / 52.94. 3
     libavformat   52.84. 0 / 52.84. 0
     libavdevice   52. 2. 2 / 52. 2. 2
     libavfilter    1.59. 0 /  1.59. 0
     libswscale     0.12. 0 /  0.12. 0
       Input #0, image2, from '/tmp/image-%07d.png':
     Duration: 00:08:55.44, start: 0.000000, bitrate: N/A
       Stream #0.0: Video: png, rgb48be, 1200x1198, 25 fps, 25 tbr, 25 tbn, 25 tbc
    File 'poincare.mov' already exists. Overwrite ? [y/N] y
    [buffer @ 0x101301ae0] w:1200 h:1198 pixfmt:rgb48be
    [ffsink @ 0x101301d50] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
    [scale @ 0x101302090] w:1200 h:1198 fmt:rgb48be -> w:1200 h:1198 fmt:yuv420p flags:0xa0000004
    Output #0, mov, to 'poincare.mov':
     Metadata:
       encoder         : Lavf52.84.0
       Stream #0.0: Video: mpeg4, yuv420p, 1200x1198, q=2-31, 30000 kb/s, 30 tbn, 30 tbc
    Stream mapping:
     Stream #0.0 -> #0.0
    Press [q] to stop encoding
    frame=13386 fps= 27 q=2.0 Lsize=  536132kB time=535.43 bitrate=8202.7kbits/s    
    video:535981kB audio:0kB global headers:0kB muxing overhead 0.028261%
  • ffmpeg Error when evaluating the expression xxx for y when overlay

    23 mars 2023, par LF00

    I use ffmpeg to add a flip watermark on the wideo with overlay,

    


    This works well with x

    


    ffmpeg -hide_banner -i HLS_540.ts -i out.png -filter_complex "[0:v][1:v]overlay=x='-w+400+100*mod(t\,(W+w-400)/100)':y=250" out.mp4

    


    But when I set y with expression if(eq(mod(t,5),0),rand(0,100),y) it show's error.

    


    ffmpeg -hide_banner -i HLS_540.ts -i out.png -filter_complex "[0:v][1:v]overlay=x='-w+400+100*mod(t\,(W+w-400)/100)':y='if(eq(mod(t\,5)\,0)\,rand(0\,100)\,y)'" out.mp4

    


    [Parsed_overlay_0 @ 000002438ba6d880] [Eval @ 000000cf5a3fe2e0] Unknown function in 'rand(0,100),y)'
[Parsed_overlay_0 @ 000002438ba6d880] Error when evaluating the expression 'if(eq(mod(t,5),0),rand(0,100),y)' for y
[Parsed_overlay_0 @ 000002438ba6d880] Failed to configure input pad on Parsed_overlay_0


    


    While when I do like this ffplay -f lavfi -i "color=color=yellow" -vf "drawtext=text='s':x=if(eq(mod(t\,5)\,0)\,rand(0\,(W-tw))\,x+0.03*mod(t\,5)):y=if(eq(mod(t\,5)\,0)\,rand(0\,(H-th))\,y)" it works well.

    


    How can I set rand y in the failed command ?

    


    Envirionment :
win11, git-bash

    


    ffmpeg -version
ffmpeg version N-104863-g6cf55b9da2-20211213 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11.2.0 (crosstool-NG 1.24.0.498_5075e1f)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20211213
libavutil      57. 11.100 / 57. 11.100
libavcodec     59. 14.100 / 59. 14.100
libavformat    59. 10.100 / 59. 10.100
libavdevice    59.  0.101 / 59.  0.101
libavfilter     8. 20.100 /  8. 20.100
libswscale      6.  1.101 /  6.  1.101
libswresample   4.  0.100 /  4.  0.100
libpostproc    56.  0.100 / 56.  0.100


    


  • Surfaceview for subtitles alpha does not work

    27 mai 2018, par user654628

    Goal : trying to build video player with subtitles for android. Video can be low resolution but the subtitles should be resolution of phone (such that if video is 720p, the subtitles should render to screen size say 1080p).

    Issue : I am using FFMPEG to render a frame at say 720p but phone device is 1080p. I need to display subtitles that are different resolution than the subtitles resolution so pixel blending is difficult.

    I first tried to scale the frame (AVFrame) with sws_convert but each frame took 80ms so that is not an option (since it is running software).

    Then I tried two surface views, one for the video and one for subtitles where video would be 720p and subtitles SurfaceView is 1080p, then the video scales up to the phone size. The issue here is that the subtitles are not translucent. Black opacity 0 would be transparent but white with alpha 0 is still white. Why is this ?

    //Code from Java, the view that extends FrameLayout
    public VideoView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
       super(context, attrs, defStyleAttr);
       mVideoSurface = new SurfaceView(context);
       mSubtitlesSurface = new SurfaceView(context);
       addView(mVideoSurface);
       addView(mSubtitlesSurface);
       mVideoSurface.getHolder().addCallback(mSurfaceCallback);
       mSubtitlesSurface.getHolder().addCallback(mSurfaceCallback);
       mSubtitlesSurface.setZOrderMediaOverlay(true);
       mSubtitlesSurface.getHolder().setFormat(PixelFormat.TRANSLUCENT);
       //etc
    }

    Eventually I tried as a test to render a square to the subtitle surface view (C++)

    // Render the video frame, now render the subtitle frame
    ANativeWindow_Buffer buffer;
    ANativeWindow_setBuffersGeometry(subWindow, width, height, WINDOW_FORMAT_RGBA_8888);
    if ((ret = ANativeWindow_lock(subWindow, &buffer, NULL)) < 0) {
       return ret;
    }
    for (int j = height/2; j < height/2 + 100; j++) {
       for (int i = width/2; i < width/2 + 100; i++) {
           uint8_t * d =  (uint8_t*)buffer.bits + j * (buffer.stride * 4) + i * 4;
           d[0] = 0xff;
           d[1] = 0xff;
           d[2] = 0xFF;
           d[3] = 0;           /* alpha */

       }
    }
    ANativeWindow_unlockAndPost(subWindow);

    So above code should render a white square in the image with 0 alpha (so should be invisible), but it is shown. If I change it to yellow with alpha 0 it will be visible but not the correct color. If I change to white with 1 alpha, it is white and opaque. If I use black with alpha 0xCC, it is invisible, only if alpha is 0xFF then it is visible as black. Seems to have no translucency even though I added it to the SurfaceHolder. Why is it like this ? I can add more code if needed.

    Is my only option to do what I want to render frame as a texture in OpenGL and (GLSurfaceView), resize the image to phone resolution and blend the alpha subtitles onto the frame as a texture ?

    Thanks in advance.