
Advanced search
Medias (91)
-
Chuck D with Fine Arts Militia - No Meaning No
15 September 2011, by
Updated: September 2011
Language: English
Type: Audio
-
Paul Westerberg - Looking Up in Heaven
15 September 2011, by
Updated: September 2011
Language: English
Type: Audio
-
Le Tigre - Fake French
15 September 2011, by
Updated: September 2011
Language: English
Type: Audio
-
Thievery Corporation - DC 3000
15 September 2011, by
Updated: September 2011
Language: English
Type: Audio
-
Dan the Automator - Relaxation Spa Treatment
15 September 2011, by
Updated: September 2011
Language: English
Type: Audio
-
Gilberto Gil - Oslodum
15 September 2011, by
Updated: September 2011
Language: English
Type: Audio
Other articles (42)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 September 2013, byCertains 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;
-
Ecrire une actualité
21 June 2013, byPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
Publier sur MédiaSpip
13 June 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
On other websites (5776)
-
Problem importing whatsapp-web.js nodejs module in electron react app
26 May 2021, by Sunil ShahI am trying to build an electron react app. I need to integrate this node modules https://www.npmjs.com/package/whatsapp-web.js in my electron react app. My main.js of electron looks like this:




// Modules to control application life and create native browser window
const { app, BrowserWindow } = require("electron");
const path = require("path");

function createWindow() {
 // Create the browser window.
 const mainWindow = new BrowserWindow({
 width: 800,
 height: 600,
 webPreferences: {
 webSecurity: false,
 },
 });

 // and load the index.html of the app.
 mainWindow.loadURL("your ip address:3000");

 // Open the DevTools.
 // mainWindow.webContents.openDevTools()
}

app.whenReady().then(() => {
 createWindow();

 app.on("activate", function () {
 // On macOS it's common to re-create a window in the app when the
 // dock icon is clicked and there are no other windows open.
 if (BrowserWindow.getAllWindows().length === 0) createWindow();
 });
});

// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on("window-all-closed", function () {
 if (process.platform !== "darwin") app.quit();
});

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.







And the React code where i want to import whatsapp-web.js module looks like




import React from "react";
import styled from "styled-components";
const qrcode = require('qrcode-terminal');
const Client = require('whatsapp-web.js');
function Error() {
 var client = new Client();
 client.initialize();
 console.log(client);
 console.log(qrcode);
 return (
 <container>
 <errorimage src="https://cdn4.iconfinder.com/data/icons/smiley-vol-3-2/48/134-512.png"></errorimage>
 <errormessage>Oops, you are not connected to any number.</errormessage>
 </container>
 );
}

export default Error;

const Container = styled.div`
 display: flex;
 height: 100vh;
 width: 100%;
 padding-top: 20vh;
 position: center;
 /* align-items: center; */
 justify-content: center;
`;

const ErrorImage = styled.img`
 background-color: transparent;
 background-repeat: no-repeat;
 background-size: cover;
 object-fit: contain;

 width: 25%;
 height: 25%;

 /* border: 2px solid black; */
`;

const ErrorMessage = styled.div`
 margin: 10px;
 width: 50%;
 height: 25%;
 /* top: 20px; */
 font-size: 30px;
 align-items: center;
 font-family: "Lucida Console", "Courier New", monospace;
 /* font-weight: bold; */
`;







Now everytime I try to import const Client = require('whatsapp-web.js') It throws error like this:
**
[0] ./node_modules/fluent-ffmpeg/index.js
[0] Module not found: Can't resolve './lib-cov/fluent-ffmpeg' in 'D:\Sunil\Zarir_app-main\Zarir_app-main\node_modules\fluent-ffmpeg'
[0] Compiling...
[0] Failed to compile.


and I tried the solution
https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/issues/573#issuecomment-305408048
and other resources but still nothing works and just loops in errors and errors.
Please help if you have any information related to it.
Thank you.


-
Shutil not detecting ffmpeg module and python3 incorrectly, all when compiled with pyinstaller
9 June 2021, by vanillaRight now I am almost finished with my version of my app. The last thing I am having trouble with is detecting the FFmpeg module, to warn users that they need it for certain features that have been added this version. When I run the script through my python interpreter in terminal, which the directories of it is in my library frameworks directory, The
shutil
will run as expected and return the version or whatever as I do have it installed. However, when I compile it and launch specifically the one windowed, with no console output, it doesn’t work. Now what I mean by that it returns none type.

From talking to someone in my previous Reddit thread I tried printing out
python3
and seeing what directories that would bring withshutil.which(‘python3’)
. Interesting enough, when put into my tkinter text field (don't have a console) it would bring up my python binary from the directory/usr/bin/python3
. The one I have all my modules for it and everything installed on is the one:

>>> import shutil
>>> print(shutil.which('python3'))
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3



So we can see that there are to installations or whatever of python3 interpreters (I believe I am saying this right), and I am confused on maybe I am being hinted to use the python3 binary from /usr/bin/ to compile it with pyinstaller and install the needed modules with /usr/bin/pip3 with it?


A user from the reddit thread I made below made a alternative:




I tested it on my computer after fixing a bug, and both the shutil and os methods work. It seems to be a problem on your end, which is strange. What version of Python do you have? Also in your script right above testing for ffmpeg, try inserting this line:
print('ffmpeg' in os.listdir('/usr/local/bin'))




This other method with
os
unfortunately returned a None as well. I am ultimately trying to have some kind of method to reliably detect ffmpegs's binary on all operating systems. If anyone can provide some insight as to what may cause problems similar to these or knows other solutions, or can identify some kind of hiccup I can avoid that would be amazing.

I have a hunch since
shutil
when compiled returned the bin directory for python3 instead of the framework one that actually has all the modules installed, that could mean something to me to try using pyinstaller with that one instead?

Thanks!


https://www.reddit.com/r/learnpython/comments/nu3a1d/functionallity_supposedly_of_shutilwhichffmpeg/


-
How to receive byte-stream by using gstreamer with python subprocess module or gst-launch-1.0 command?
21 April 2022, by yuniversiI want to receive byte-stream by using gstreamer with python subprocess module.
Now I can successfully use ffmpeg to pull the byte-stream. As shown below.


import cv2
import subprocess as sp


height = 714
width = 420
rtsp_url = 'rtsp://127.0.0.1:8554/video'

# command
command = ['ffmpeg',
 '-i', rtsp_url,
 '-f', 'rawvideo',
 '-s',str(width)+'*'+str(height),
 '-pix_fmt', 'bgr24',
 '-fflags', 'nobuffer',
 '-']

p = sp.Popen(command, stdout=sp.PIPE, bufsize=10**8)

while True:
 raw_image = p.stdout.read(width*height*3)
 image = np.fromstring(raw_image, dtype='uint8')
 image = image.reshape((height,width,3)).copy()
 cv2.imshow('image', image)
 key = cv2.waitKey(20)



I want to use gstreamer command instead of ffmpeg. So far, I have realized writing byte-stream to a file by using gstreamer command line.


gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/video latency=0 drop-on-latency=true ! rtph264depay ! video/x-h264, stream-format='byte-stream' ! filesink location=/home/name/stdout



But it can't output byte-stream to pipe, so the terminal dosen't display byte-stream, not like ffmpeg command. How to change this command to output byte-stream through pipe so I can read from pipe.
Thank you for taking the time to answer for me!


This is RTSP streaming code.


import cv2
import time
import subprocess as sp
import numpy as np


rtsp_url = 'rtsp://127.0.0.1:8554/video'
video_path = r'test.mp4'
cap = cv2.VideoCapture(video_path)

# Get video information
fps = int(cap.get(cv2.CAP_PROP_FPS))
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
print('fps={}'.format(fps))

# command
command = ['ffmpeg',
 '-re',
 '-y',
 '-stream_loop', '-1',
 '-f', 'rawvideo',
 '-vcodec', 'rawvideo',
 '-pix_fmt', 'bgr24',
 '-s', "{}x{}".format(width, height),
 '-r', str(fps),
 '-i', '-',
 '-c:v', 'libx264',
 '-pix_fmt', 'yuv420p',
 '-preset', 'ultrafast',
 # '-flags2', 'local_header',
 '-bsf:v', "'dump_extra=freq=k'", 
 '-keyint_min', '60',
 '-g', '60',
 '-sc_threshold', '0', 
 '-f', 'rtsp',
 '-rtsp_transport', 'tcp',
 '-muxdelay', '0.1', 
 rtsp_url]

p = sp.Popen(command, stdin=sp.PIPE)

cnt = 0
t_start = time.time()
while (cap.isOpened()):
 t_cur = time.time()-t_start

 ret, frame = cap.read()
 if not ret:
 cnt += 1
 print("count: {}".format(cnt))
 cap = cv2.VideoCapture(video_path)
 continue

 p.stdin.write(frame.tobytes())

 cv2.imshow('real_time', frame)

 key = cv2.waitKey(20)
 if key == 27:
 p.terminate()
 break