Recherche avancée

Médias (0)

Mot : - Tags -/signalement

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

Autres articles (112)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

Sur d’autres sites (10067)

  • AWS Lambda Docker image with librosa and ffmpeg

    4 août 2022, par loretoparisi

    I'm using this Dockerfile to build an image for AWS Lambda having librosa and ffmpeg with python3.7 :

    


    ARG FUNCTION_DIR="/function"
FROM python:3.7.4-slim-buster as build-image

# librosa and ffmpeg dependencies
RUN apt-get update && apt-get install -y \
    software-properties-common \
    libsndfile1-dev \
    ffmpeg

# Install aws-lambda-cpp build dependencies
RUN apt-get update && \
  apt-get install -y \
  g++ \
  make \
  cmake \
  unzip \
  libcurl4-openssl-dev

# Include global arg in this stage of the build
ARG FUNCTION_DIR
# Create function directory
RUN mkdir -p ${FUNCTION_DIR}

# Copy function code
COPY app.py ${FUNCTION_DIR}

# Install the runtime interface client
RUN pip install \
        --target ${FUNCTION_DIR} \
        awslambdaric

# Multi-stage build: grab a fresh copy of the base image
FROM python:3.7.4-slim-buster

# Include global arg in this stage of the build
ARG FUNCTION_DIR
# Set working directory to function root directory
WORKDIR ${FUNCTION_DIR}

# Copy in the build image dependencies
COPY --from=build-image ${FUNCTION_DIR} ${FUNCTION_DIR}

EXPOSE 8080
ENTRYPOINT [ "/usr/local/bin/python", "-m", "awslambdaric" ]
CMD [ "app.handler" ]


    


    The build works ok, but I cannot run the image :

    


    docker run -e AWS_LAMBDA_RUNTIME_API=localhost:9000 --rm -it -p 9000:8080  lambda:latest&#xA;Executing &#x27;app.handler&#x27; in function directory &#x27;/function&#x27;&#xA;[ERROR] [1628271126733] LAMBDA_RUNTIME Failed to get next invocation. No Response from endpoint&#xA;Traceback (most recent call last):&#xA;  File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main&#xA;    "__main__", mod_spec)&#xA;  File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code&#xA;    exec(code, run_globals)&#xA;  File "/function/awslambdaric/__main__.py", line 21, in <module>&#xA;    main(sys.argv)&#xA;  File "/function/awslambdaric/__main__.py", line 17, in main&#xA;    bootstrap.run(app_root, handler, lambda_runtime_api_addr)&#xA;  File "/function/awslambdaric/bootstrap.py", line 399, in run&#xA;    event_request = lambda_runtime_client.wait_next_invocation()&#xA;  File "/function/awslambdaric/lambda_runtime_client.py", line 76, in wait_next_invocation&#xA;    response_body, headers = runtime_client.next()&#xA;RuntimeError: Failed to get next&#xA;</module>

    &#xA;

    I therefore tried this simplified Dockerfile that is based on the AWS EC2 CentOS with package manager yum :

    &#xA;

    FROM public.ecr.aws/lambda/python:3.8&#xA;&#xA;# libsndfile&#xA;RUN curl -o libsndfile-1.0.28-alt1.x86_64.rpm http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//libsndfile-1.0.28-alt1.x86_64.rpm &#xA;RUN curl -o libsndfile-devel-1.0.28-alt1.x86_64.rpm http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//libsndfile-devel-1.0.28-alt1.x86_64.rpm&#xA;#ffmpeg&#xA;RUN curl -o ffmpeg-4.4-alt5.x86_64.rpm  http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//ffmpeg-4.4-alt5.x86_64.rpm &#xA;&#xA;RUN yum localinstall \&#xA;    libsndfile-devel-1.0.28-alt1.x86_64.rpm \&#xA;    fmpeg-4.4-alt5.x86_64.rpm&#xA;&#xA;# Create function directory&#xA;WORKDIR /app&#xA;&#xA;# Copy function code&#xA;COPY app.py .&#xA;&#xA;COPY requirements.txt .&#xA;RUN pip install -r requirements.txt&#xA;&#xA;EXPOSE 8080&#xA;# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)&#xA;CMD ["/app/app.handler"]&#xA;

    &#xA;

    In this case, the image builds and run and I can invoke the handler :

    &#xA;

    docker run --rm -it -p 9000:8080  lambda:latest&#xA;INFO[0000] exec &#x27;/var/runtime/bootstrap&#x27; (cwd=/app, handler=) &#xA;curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d &#x27;{}&#x27;&#xA;

    &#xA;

    but I librosa complains about the libsndfile1 installation :

    &#xA;

    Traceback (most recent call last):&#xA;  File "/var/runtime/bootstrap.py", line 452, in main&#xA;    request_handler = _get_handler(handler)&#xA;  File "/var/runtime/bootstrap.py", line 46, in _get_handler&#xA;    m = imp.load_module(modname, file_handle, pathname, desc)&#xA;  File "/var/lang/lib/python3.8/imp.py", line 234, in load_module&#xA;    return load_source(name, filename, file)&#xA;  File "/var/lang/lib/python3.8/imp.py", line 171, in load_source&#xA;    module = _load(spec)&#xA;  File "<frozen>", line 702, in _load&#xA;  File "<frozen>", line 671, in _load_unlocked&#xA;  File "<frozen>", line 848, in exec_module&#xA;  File "<frozen>", line 219, in _call_with_frames_removed&#xA;  File "/app/app.py", line 7, in <module>&#xA;    import librosa&#xA;  File "/var/lang/lib/python3.8/site-packages/librosa/__init__.py", line 211, in <module>&#xA;    from . import core&#xA;  File "/var/lang/lib/python3.8/site-packages/librosa/core/__init__.py", line 6, in <module>&#xA;    from .audio import *  # pylint: disable=wildcard-import&#xA;  File "/var/lang/lib/python3.8/site-packages/librosa/core/audio.py", line 8, in <module>&#xA;    import soundfile as sf&#xA;  File "/var/lang/lib/python3.8/site-packages/soundfile.py", line 142, in <module>&#xA;    raise OSError(&#x27;sndfile library not found&#x27;)&#xA;OSError: sndfile library not found&#xA;&#xA;During handling of the above exception, another exception occurred:&#xA;&#xA;    Traceback (most recent call last):&#xA;      File "/var/runtime/bootstrap.py", line 480, in <module>&#xA;        main()&#xA;      File "/var/runtime/bootstrap.py", line 457, in main&#xA;        lambda_runtime_client.post_init_error(to_json(error_result))&#xA;      File "/var/runtime/lambda_runtime_client.py", line 42, in post_init_error&#xA;        response = runtime_connection.getresponse()&#xA;      File "/var/lang/lib/python3.8/http/client.py", line 1344, in getresponse&#xA;        response.begin()&#xA;      File "/var/lang/lib/python3.8/http/client.py", line 307, in begin&#xA;        version, status, reason = self._read_status()&#xA;      File "/var/lang/lib/python3.8/http/client.py", line 276, in _read_status&#xA;        raise RemoteDisconnected("Remote end closed connection without"&#xA;    http.client.RemoteDisconnected: Remote end closed connection without response&#xA;    WARN[0023] First fatal error stored in appctx: Runtime.ExitError &#xA;    WARN[0023] Process 16(bootstrap) exited: Runtime exited with error: exit status 1 &#xA;    ERRO[0023] Init failed                                   InvokeID= error="Runtime exited with error: exit status 1"&#xA;    WARN[0023] Failed to send default error response: ErrInvalidInvokeID &#xA;    ERRO[0023] INIT DONE failed: Runtime.ExitError          &#xA;    WARN[0023] Reset initiated: ReserveFail &#xA;</module></module></module></module></module></module></frozen></frozen></frozen></frozen>

    &#xA;

    The strange thing in this case (yum and rmp) is that the installation seems to work fine :

    &#xA;

    => CACHED [2/9] RUN curl -o libsndfile-1.0.28-alt1.x86_64.rpm http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//libsndfile-1.0.2  0.0s&#xA; => CACHED [3/9] RUN curl -o libsndfile-devel-1.0.28-alt1.x86_64.rpm http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//libsndfile  0.0s&#xA; => CACHED [4/9] RUN curl -o ffmpeg-4.4-alt5.x86_64.rpm  http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//ffmpeg-4.4-alt5.x86_64  0.0s&#xA; => CACHED [5/9] RUN yum localinstall     libsndfile-devel-1.0.28-alt1.x86_64.rpm     fmpeg-4.4-alt5.x86_64.rpm  &#xA;

    &#xA;

  • Anomalie #3205 (Nouveau) : [Plugin-dist Mots] Incompatibilité avec l’API d’édition d’objet ?

    13 avril 2014, par charles razack

    Il semblerait que la création d’un groupe de mots par le biais l’API d’édition d’objet ne fonctionne pas.
    A première vue, on dirait que c’est dû à un souci de nommage de fonctions au niveau du plugin.

    Pour reproduire, dans le traitement d’un formulaire par ex. :

    include_spip('action/editer_objet');<br />$set = array('titre'=>'Mon super titre',, 'tables_liees'=>'articles');<br />$id_groupe = objet_inserer('groupe_mots', '', $set);

    var_dump($id_groupe); renvoie NULL et pour cause : le groupe de mots n’a pas été créé.

    Cause probable :

    Dans le fichier action/editer_groupe_mots.php du plugin, les fonctions sont nommées groupemots_xxx() au lieu de groupe_mots_xxx(),
    ce qui fait que la fonction objet_inserer() de l’API ne les trouve pas.
    Du coup elle tente une insertion "générique" qui pour une raison ou une autre ne fonctionne pas (pb avec sql_insertq ligne 209, je n’ai pas regardé ce qui cloche exactement).

  • Use ffmpeg with paths in flutter

    19 septembre 2023, par ivan reyes

    I have no idea how to use ffmpeg from paths. In all the examples I have seen use files from assets, and this solution does not apply to my problem.

    &#xA;

    This is an example that is in another question here : How to extract audio from video using ffmpeg-kit with flutter

    &#xA;

    @override&#xA;  void initState() {&#xA;    // TODO: implement initState&#xA;    super.initState();&#xA;    getAudio();&#xA;  }&#xA;&#xA;  getAudio() async {&#xA;    await FFmpegKit.execute(&#xA;            "ffmpeg -i D:/Dart and Flutter/Projects/Jmm/firebase_task/assets/videos/flutter.mp4 -q:a 0 -map a D:/Dart and Flutter/Projects/Jmm/firebase_task/assets/videos/flutter_audio.mp3")&#xA;        .then((value) async {&#xA;      var returnCode = await value.getReturnCode();&#xA;      if (ReturnCode.isSuccess(returnCode)) {&#xA;        print(&#x27;succsses&#x27;);&#xA;      } else {&#xA;        print(&#x27;fail&#x27;);&#xA;      }&#xA;    });&#xA;  }&#xA;

    &#xA;

    but, again, they convert the files from assets.

    &#xA;

    I hope you can help, thank you very much

    &#xA;

    I tried to adapt the solution that they apply in the link provided, and I expected to have an audio file, but, this did not happen

    &#xA;