Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

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

Autres articles (99)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

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

  • Encoding video using FFmpeg and FreeImage

    14 mai 2014, par mike

    I have to make a video encoder to encode video using mjpeg codec from many jpgs saved on the disk. I use FreeImage to load images and ffmpeg to encode. Unfortunately, the output video isn’t that what I expect. I can’t play it in MPC. VLC can play it but there is only a single quick flash of the last picture I loaded. I want to have 1 fps video and for example I loaded 4 frames so my video should last 4 seconds.

    Input pictures are in BGR24 pixel format.

    What is more, when I run my code I got swscaler warning that picture format YUVJ420P is deprecated but I cant find another pixel format which is suitable for MJPEG codec.

    Here is my source code :

    AVPixelFormat in_pix_fmt = AV_PIX_FMT_BGR24;
    AVPixelFormat out_pix_fmt = AV_PIX_FMT_YUVJ420P;

    AVCodec *pCodec;
    AVCodecContext *pCodecCtx = NULL;
    int out_size = 0;
    int size, outbuf_size, i, outpic_size, w, h;
    FILE *file;
    const char *videofile_name = "test_video_cpp.avi";
    AVFrame *picture, *outpic;
    uint8_t *outbuf, *picture_buf, *outpic_buf;

    av_register_all();

    pCodec = avcodec_find_encoder(CODEC_ID_MJPEG);
    if (!pCodec)
    {
       cout << "Codec not found\n\n";
       return 1;
    }

    pCodecCtx = avcodec_alloc_context3(pCodec);
    picture = avcodec_alloc_frame();
    outpic = avcodec_alloc_frame();

    pCodecCtx->codec_id = CODEC_ID_MJPEG;
    pCodecCtx->codec_type = AVMEDIA_TYPE_VIDEO;
    pCodecCtx->pix_fmt = out_pix_fmt;
    pCodecCtx->bit_rate = 400000;
    pCodecCtx->width = 1688;            
    pCodecCtx->height = 728;
    pCodecCtx->time_base.num = 1;          
    pCodecCtx->time_base.den = 1;       //fps
    pCodecCtx->max_b_frames = 0;

    outbuf_size = 500000;
    outbuf = new uint8_t[outbuf_size];

    if (avcodec_open2(pCodecCtx, pCodec, NULL) < 0)     //open codec
    {
       cout << "Could not open codec\n";
       exit(1);
    }

    file = fopen(videofile_name, "wb");                 //open file
    if (!file)
    {
       cout << "Could not open " << videofile_name << endl;
       exit(1);
    }

    outpic_size = avpicture_get_size(out_pix_fmt, pCodecCtx->width, pCodecCtx->height);
    outpic_buf = new uint8_t[outpic_size];
    cout << "Outpic size was setted to: " << outpic_size << endl;

    size = pCodecCtx->width * pCodecCtx->height;
    picture_buf = new uint8_t[size * 3];


    for (i = 1; i < 5; i++)
    {  
       fflush(stdout);

       stringstream ss;
       ss << i;
       filename = name + ss.str() + ext;
       path = dir + filename;

       dib = FreeImage_Load(FIF_JPEG, path.c_str(), 0);

       picture_buf = FreeImage_GetBits(dib);

               h = FreeImage_GetHeight(dib);
       w = FreeImage_GetWidth(dib);

       avpicture_fill((AVPicture*)picture, picture_buf, in_pix_fmt, w, h);
       avpicture_fill((AVPicture*)outpic, outpic_buf, out_pix_fmt, pCodecCtx->width, pCodecCtx->height);

       struct SwsContext* fooContext = sws_getContext(w, h, in_pix_fmt, pCodecCtx->width, pCodecCtx->height, out_pix_fmt, SWS_BICUBIC, NULL, NULL, NULL);

       sws_scale(fooContext, picture->data, picture->linesize, 0, pCodecCtx->height, outpic->data, outpic->linesize);

       //encode single frame
       out_size = avcodec_encode_video(pCodecCtx, outpic_buf, outpic_size, outpic);
       cout << "encoding frame " << i << "(size=" << out_size << ")\n";
       fwrite(outbuf, 1, out_size, file);

    }

    //encode delayed frames
    for ( ; out_size; i++)
    {
       fflush(stdout);
       out_size = avcodec_encode_video(pCodecCtx, outbuf, outbuf_size, NULL);
       cout << "write frame " << i << "(size=" << out_size << ")\n";
       fwrite(outbuf, 1, out_size, file);
    }

    outbuf[0] = 0x00;
    outbuf[1] = 0x00;
    outbuf[2] = 0x01;
    outbuf[3] = 0xb7;
    fwrite(outbuf, 1, 4, file);

    fclose(file);
    delete outbuf;
    avcodec_close(pCodecCtx);
    av_free(pCodecCtx);
    avpicture_free((AVPicture*)picture);
    avpicture_free((AVPicture*)outpic);
    delete picture_buf;
    delete outpic_buf;
  • Can't install FFMPEG using pip

    22 juin 2023, par turrnut

    I tried to install ffmpeg using pip like this

    


    pip install ffmpeg


    


    However I got the following error :

    


    Collecting ffmpeg&#xA;  Using cached ffmpeg-1.4.tar.gz (5.1 kB)&#xA;  Preparing metadata (setup.py) ... error&#xA;  error: subprocess-exited-with-error&#xA;&#xA;  &#xD7; python setup.py egg_info did not run successfully.&#xA;  │ exit code: 1&#xA;  ╰─> [34 lines of output]&#xA;      Traceback (most recent call last):&#xA;        File "<string>", line 2, in <module>&#xA;        File "", line 34, in <module>&#xA;        File "C:\Users\vwu20\AppData\Local\Temp\pip-install-rdqrdeeq\ffmpeg_3cdda176f3f04ceea4a14d868e94924e\setup.py", line 13, in <module>&#xA;          setup(&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 87, in setup&#xA;          return distutils.core.setup(**attrs)&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 147, in setup&#xA;          _setup_distribution = dist = klass(attrs)&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 476, in __init__&#xA;          _Distribution.__init__(&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 282, in __init__&#xA;          self.finalize_options()&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 899, in finalize_options&#xA;          for ep in sorted(loaded, key=by_order):&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 898, in <lambda>&#xA;          loaded = map(lambda e: e.load(), filtered)&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\importlib\metadata\__init__.py", line 171, in load&#xA;          module = import_module(match.group(&#x27;module&#x27;))&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module&#xA;          return _bootstrap._gcd_import(name[level:], package, level)&#xA;        File "<frozen>", line 1050, in _gcd_import&#xA;        File "<frozen>", line 1027, in _find_and_load&#xA;        File "<frozen>", line 1006, in _find_and_load_unlocked&#xA;        File "<frozen>", line 688, in _load_unlocked&#xA;        File "<frozen>", line 883, in exec_module&#xA;        File "<frozen>", line 241, in _call_with_frames_removed&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\build_app.py", line 37, in <module>&#xA;          from py2app.create_appbundle import create_appbundle&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\create_appbundle.py", line 9, in <module>&#xA;          from py2app.util import make_exec, makedirs, mergecopy, mergetree, skipscm&#xA;        File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\util.py", line 5, in <module>&#xA;          import fcntl&#xA;      ModuleNotFoundError: No module named &#x27;fcntl&#x27;&#xA;      [end of output]&#xA;&#xA;  note: This error originates from a subprocess, and is likely not a problem with pip.&#xA;error: metadata-generation-failed&#xA;&#xA;&#xD7; Encountered error while generating package metadata.&#xA;╰─> See above for output.&#xA;&#xA;note: This is an issue with the package mentioned above, not pip.&#xA;hint: See above for details.&#xA;</module></module></module></frozen></frozen></frozen></frozen></frozen></frozen></lambda></module></module></module></string>

    &#xA;

    The error message says that it's missing a package called fcntl, so i tried to install it using

    &#xA;

    pip install fcntl&#xA;

    &#xA;

    The attempt to install fcntl produce the following error :

    &#xA;

    ERROR: Could not find a version that satisfies the requirement fcntl (from versions: none)&#xA;ERROR: No matching distribution found for fcntl&#xA;

    &#xA;

    Can anyone tell me what I did wrong ? I am using windows 11, python 3.10, pip 23.1.2&#xA;Help would be appreciated.

    &#xA;

  • How to fix the problem I'm having with FFmpeg ?

    23 février 2023, par John

    I'm working with the ffmpeg library to convert mp4 video files to mp3 audio files.&#xA;Here is my code :

    &#xA;

    package com.exer;&#xA;&#xA;&#xA;import android.app.Activity;&#xA;import android.app.ProgressDialog;&#xA;import android.os.Bundle;&#xA;import android.os.Environment;&#xA;import android.widget.Toast;&#xA;import com.github.hiteshsondhi88.libffmpeg.ExecuteBinaryResponseHandler;&#xA;import com.github.hiteshsondhi88.libffmpeg.FFmpeg;&#xA;import com.github.hiteshsondhi88.libffmpeg.FFmpegLoadBinaryResponseHandler;&#xA;&#xA;public class MainActivity extends Activity {&#xA;    &#xA;    FFmpeg ffmpeg;&#xA;    private ProgressDialog progressDialog;&#xA;    &#xA;    &#xA;    @Override&#xA;    protected void onCreate(Bundle savedInstanceState) {&#xA;        super.onCreate(savedInstanceState);&#xA;        setContentView(R.layout.activity_main);&#xA;    &#xA;        &#xA;        &#xA;        try {&#xA;            setUp();&#xA;            String[] command = {&#xA;                "-i", getPaths()&#x2B;"/dir/input.mp4", "-vn", getPaths()&#x2B;"/dir/output.mp3"&#xA;            };&#xA;            //convert("ffmpeg -i input.mp4 -vn output.mp3");&#xA;            convert(command);&#xA;            &#xA;        } catch (Exception e) {&#xA;            Toast.makeText(getApplicationContext(), e.getCause().toString(), Toast.LENGTH_SHORT).show();&#xA;        }&#xA;    }&#xA;    &#xA;    &#xA;    public void setUp() throws Exception {&#xA;        &#xA;        if(ffmpeg == null) {&#xA;            &#xA;            ffmpeg = FFmpeg.getInstance(this);&#xA;            ffmpeg.loadBinary(new FFmpegLoadBinaryResponseHandler(){&#xA;                    &#xA;            @Override&#xA;            public void onFailure() {&#xA;                Toast.makeText(getApplicationContext(), "failed to load library", Toast.LENGTH_SHORT).show();   &#xA;            }&#xA;                    &#xA;            @Override&#xA;            public void onSuccess() {&#xA;                Toast.makeText(getApplicationContext(), "loaded!", Toast.LENGTH_SHORT).show();&#xA;            }&#xA;                    &#xA;            @Override&#xA;            public void onStart() {&#xA;                        &#xA;            }&#xA;                    &#xA;            @Override&#xA;            public void onFinish() {&#xA;                        &#xA;            }&#xA;                    &#xA;                    &#xA;            });&#xA;            &#xA;        }&#xA;        &#xA;    }&#xA;    &#xA;    &#xA;    private void convert(String[] cmd) throws Exception {&#xA;        &#xA;        ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler(){&#xA;            &#xA;            @Override&#xA;            public void onFailure(String message){&#xA;                super.onFailure(message);&#xA;            }&#xA;            &#xA;            @Override&#xA;            public void onFinish(){&#xA;                super.onFinish();&#xA;                Toast.makeText(getApplicationContext(), "finished!", Toast.LENGTH_SHORT).show();&#xA;            }&#xA;            &#xA;            @Override&#xA;            public void onStart(){&#xA;                super.onStart();&#xA;                Toast.makeText(getApplicationContext(), "start conversion...", Toast.LENGTH_SHORT).show();&#xA;            }&#xA;            &#xA;            @Override&#xA;            public void onProgress(String message){&#xA;                super.onProgress(message);&#xA;            }&#xA;        });&#xA;        &#xA;    &#xA;    }&#xA;    &#xA;    private String getPaths() {&#xA;        return Environment.getExternalStorageDirectory().getPath();&#xA;    }&#xA;    &#xA;}&#xA;

    &#xA;

    When I run the app, the Toast messages are shown :

    &#xA;

    loaded!&#xA;start converting...&#xA;finished! as I write them in the functions, apart that nothing else happens the file is not converted what's wrong ?

    &#xA;

    Here my manifest file :

    &#xA;

    &lt;?xml version="1.0" encoding="utf-8"?>&#xA;<manifest package="com.exer">&#xA;    &#xA;    &#xA;    &#xA;    &#xA;    &#xA;        &#xA;            &#xA;                <action></action>&#xA;&#xA;                <category></category>&#xA;            &#xA;        &#xA;    &#xA;&#xA;</manifest>&#xA;

    &#xA;

    I've tried to delete the specified file on the phone to see what erros I might got, but still those three Toasts.

    &#xA;