
Recherche avancée
Médias (91)
-
Spoon - Revenge !
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
My Morning Jacket - One Big Holiday
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Zap Mama - Wadidyusay ?
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
David Byrne - My Fair Lady
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Beastie Boys - Now Get Busy
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
Autres articles (66)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Publier sur MédiaSpip
13 juin 2013Puis-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 -
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)
Sur d’autres sites (5106)
-
ffmpeg code changes
12 juillet 2012, par toutou0091To install FFmpeg, I followed the instructionsin this web sit http://buildall.wordpress.com/2011/05/09/how-to-compile-and-install-ffmpeg-in-ubuntu-11-04/ and it works well. In the file "mpegvideo_enc.c" there is a variable called "qp". I added in this file the istruction printf to display this varaible. I redid after : ". / configure" and "make" and it works as well. The Result of this compilation gives no executable file. I would like to know why the printf that I added in the code is not displayed ?
Thank u in advance. -
Different code(.java file) for different platform ?
2 mars 2016, par AR792I have a code where image data is passed from bitmap to FFmpeg frame recorder and converted to a video. But i need to make small changes while running it on LG G3(armv7) from Asus zenfone 5(x86).
Following are the class variables that create the issue :(declared under, class Main Activity)
inputWidth = 1024 ;
inputHeight = 650 ;
Following is the method where the issue occurs :
byte [] getNV21(int inputWidth, int inputHeight, Bitmap bitmap) {
int [] argb = new int[inputWidth * inputHeight];
bitmap.getPixels(argb, 0, inputWidth, 0, 0, inputWidth, inputHeight);
byte [] yuv = new byte[inputWidth*inputHeight*3/2];
encodeYUV420SP(yuv, argb, inputWidth, inputHeight);
return yuv;
}
void encodeYUV420SP(byte[] yuv420sp, int[] argb, int width, int height) {
final int frameSize = width * height;
int yIndex = 0;
int uvIndex = frameSize;
int a, R, G, B, Y, U, V;
int index = 0;
for (int j = 0; j < height; j++) {
for (int i = 0; i < width; i++) {
a = (argb[index] & 0xff000000) >> 24; // a is not used obviously
R = (argb[index] & 0xff0000) >> 16;
G = (argb[index] & 0xff00) >> 8;
B = (argb[index] & 0xff) >> 0;
// well known RGB to YUV algorithm
Y = ( ( 66 * R + 129 * G + 25 * B + 128) >> 8) + 16;
U = ( ( -38 * R - 74 * G + 112 * B + 128) >> 8) + 128;
V = ( ( 112 * R - 94 * G - 18 * B + 128) >> 8) + 128;
// NV21 has a plane of Y and interleaved planes of VU each sampled by a factor of 2
// meaning for every 4 Y pixels there are 1 V and 1 U. Note the sampling is every other
// pixel AND every other scanline.
yuv420sp[yIndex++] = (byte) ((Y < 0) ? 0 : ((Y > 255) ? 255 : Y));
if (j % 2 == 0 && index % 2 == 0) {
yuv420sp[uvIndex++] = (byte)((V<0) ? 0 : ((V > 255) ? 255 : V));
yuv420sp[uvIndex++] = (byte)((U<0) ? 0 : ((U > 255) ? 255 : U));
}
index ++;
}
}
}Working CODE :
LG G3 :I can use the above variables at any place in the code to get the required output.
Bitmap size returned = 2734200Asus Zenfone 5 : Except at creating the bitmap, I have to use everywhere else bitmap.getHeight() and bitmap.getWidth(), to get the required output.
Surprisingly here Bitmap size returned = 725760 (So its not setting according to set bitmap parameters ?)
INCORRECT CODE :
LG G3 : IF i use bitmap.getHeight() and bitmap.getWidth(), i get java.lang.ArrayIndexOutOfBoundsException : length = 102354 , index = 102354. @getNV21 method
Asus Zenfone 5 : If i use inputWidth , inputHeight i get
java.lang.IllegalArgumentException : x + width must be <= bitmap.width() @getNV21 methodHow can i generalize the above code for both phones ?
-
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"]



'''