
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (74)
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
MediaSPIP : Modification des droits de création d’objets et de publication définitive
11 novembre 2010, parPar défaut, MediaSPIP permet de créer 5 types d’objets.
Toujours par défaut les droits de création et de publication définitive de ces objets sont réservés aux administrateurs, mais ils sont bien entendu configurables par les webmestres.
Ces droits sont ainsi bloqués pour plusieurs raisons : parce que le fait d’autoriser à publier doit être la volonté du webmestre pas de l’ensemble de la plateforme et donc ne pas être un choix par défaut ; parce qu’avoir un compte peut servir à autre choses également, (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (7053)
-
dnn_backend_openvino.c : refine code for error handle
18 novembre 2020, par Guo, Yejun -
When I run code in Docker I get a Django error [Errno 2]. When running locally everything works. Why ?
8 février 2021, par Bartłomiej KokoszkaI don't know what's going on. A script run by Django works fine, but not through Docker and Django. An error is returned :


Pic Errno 2 No such file or directory


Below is the code of the function with the error and the code of the Dockerfile.


'''


def mediainfo(filepath):
 



Original code :




prober = get_prober_name()
 command_args = [
 "-v", "quiet",
 "-show_format",
 "-show_streams",
 filepath
 ]

 command = [prober, '-of', 'old'] + command_args





Modified code :




command = f"ffprobe -v error -show_format -show_streams -select_streams v:0 {filepath}"





The rest of the functions :


res = Popen(command, stdout=PIPE)
 output = res.communicate()[0].decode("utf-8")

 if res.returncode != 0:
 output = Popen(command, stdout=PIPE).communicate()[0].decode("utf-8")

 rgx = re.compile(r"(?:(?P.*?):)?(?P<key>.*?)\=(?P<value>.*?)$")
 info = {}

 if sys.platform == 'win32':
 output = output.replace("\r", "")

 for line in output.split("\n"):
 # print(line)
 mobj = rgx.match(line)

 if mobj:
 # print(mobj.groups())
 inner_dict, key, value = mobj.groups()

 if inner_dict:
 try:
 info[inner_dict]
 except KeyError:
 info[inner_dict] = {}
 info[inner_dict][key] = value
 else:
 info[key] = value

 return info
</value></key>


'''


Code of the Dockerfile


'''


FROM python:3.7 as base

EXPOSE 80

WORKDIR /app
COPY . /app


ENV PYTHONDONTWRITEBYTECODE=1

ENV PYTHONUNBUFFERED=1

RUN pip install --upgrade pip
RUN echo 'deb http://deb.debian.org/debian buster-backports main contrib non-free' >> /etc/apt/sources.list
RUN apt-get update

RUN apt-get -y install ffmpeg
RUN apt-get update

COPY requirements.txt .
RUN python -m pip install -r requirements.txt

FROM base as prod

ENTRYPOINT ["python","manage.py","runserver","0.0.0.0:80"]



'''


-
Pydub AudioSegment.from_file() fails for mp3 audio file : Decoding failed. ffmpeg returned error code : 1,
27 mars 2021, par Nisuga JayawardanaCouldn't find any fix. Looks like a bug. How to fix this ?


# Grab the file from the request
 file_uploaded = request.FILES.get('sourceFile')
 file_path = uploads_base_path + file_uploaded.name
 
 # saving the uploaded file
 open(file_path, 'wb')

 extension = file_uploaded.name.split('.')[-1]
 with open(file_path, "rb") as wav_file:
 audio_segment = AudioSegment.from_file(wav_file, format=extension) <-------------Error

 # create .wav filename for the file
 wavFileName = uploads_base_path + 'out.wav'
 print(wavFileName)

 # convert audio file to .wav type
 audio_segment.export(wavFileName,"wav")



// Pydub Error

Decoding failed. ffmpeg returned error code : 1

Output from ffmpeg/avlib :

ffmpeg version N-101739-gcad3a5d715 Copyright (c) 2000-2021 the FFmpeg developers

built with gcc 9.3-win32 (GCC) 20200320

// FFMPEG Error

[cache @ 000001c52157fdc0] Inner protocol failed to seekback end : -40

Last message repeated 1 times

[mp3 @ 000001c52157f400] Failed to read frame size : Could not seek to 1026.

[cache @ 000001c52157fdc0] Statistics, cache hits:0 cache misses:0

cache:pipe:0 : Invalid argument