
Recherche avancée
Autres articles (72)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...) -
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)
Sur d’autres sites (11840)
-
scipy.io.wavfile.read() the stdout from FFmpeg
28 février 2018, par PhuckMyLifeAfter searching for a long time, I still cannot find the solution to use
scipy.io.wavfile.read()
to read the bytes from thestdout
of FFmpeg 3.3.6.Here is the example code working perfectly. However, it needs to save a converted file to disk.
import subprocess
import scipy.io.wavfile as wavfile
command = 'ffmpeg -i in.mp3 out.wav'
subprocess.run(command)
with open('out.wav', 'rb') as wf:
rate, signal = wavfile.read(wf)
print(rate, signal)And here is the code I try to get the FFmpeg output from stdout and load it into scipy wavfile.
import io
import subprocess
import scipy.io.wavfile as wavfile
command = 'ffmpeg -i in.mp3 -f wav -'
proc = subprocess.run(command, stdout=subprocess.PIPE)
rate, signal = wavfile.read(io.BytesIO(proc.stdout))
print(rate, signal)Sadly, it raises a
ValueError
.Traceback (most recent call last):
File ".\err.py", line 8, in <module>
rate, signal = wavfile.read(io.BytesIO(proc.stdout))
File "C:\Users\Sean Wu\AppData\Local\Programs\Python\Python36\lib\site-
packages\scipy\io\wavfile.py", line 246, in read
raise ValueError("Unexpected end of file.")
ValueError: Unexpected end of file.
</module>Are there any methods to solve this problem ?
-
How to read h264 stream as a file from the USB webcam directly in c++ without using opencv ?
6 mars 2018, par iroboI am able to read a video file of h264 format and doing some machine learning inference on top of it. The code works absolutely fine for input from a file. Below code is a sample code from Deepstream SDK
FileDataProvider(const char *szFilePath, simplelogger::Logger *logger)
: logger_(logger)
{
fp_ = fopen(szFilePath, "rb");
//fp_ = fopen("/dev/video0", "rb");
if (nullptr == fp_) {
LOG_ERROR(logger, "Failed to open file " << szFilePath);
exit(1);
}
pLoadBuf_ = new uint8_t[nLoadBuf_];
pPktBuf_ = new uint8_t[nPktBuf_];
assert(nullptr != pLoadBuf_);
}
~FileDataProvider() {
if (fp_) {
fclose(fp_);
}
if (pLoadBuf_) {
delete [] pLoadBuf_;
}
if (pPktBuf_) {
delete [] pPktBuf_;
}
}What is requirement ?
- Read from the Logitech c920 webcam instead for video file.
- I know How to read from webcam using opencv. But I don’t want to use opencv here.
My Research
- Using v4l we can get the stream and display it in vlc.
- Camera supports below formats.
@ubox : $ v4l2-ctl —device=/dev/video1 —list-formats
ioctl : VIDIOC_ENUM_FMT Index : 0 Type : Video Capture
Pixel Format : ’YUYV’ Name : YUYV 4:2:2Index : 1 Type : Video Capture Pixel Format : ’H264’
(compressed) Name : H.264Index : 2 Type : Video Capture Pixel Format : ’MJPG’
(compressed) Name : Motion-JPEG- Reading output of a USB webcam in Linux
vlc v4l2:///dev/video1 --v4l2-chroma=h264
- this displays the video from the webcam.
How to do this ?
Now how to feed this live stream into
above sample code such that it reads from the webcam rather than file ?[update-1]
In otherwords, does v4l has some options to write the video stream as h264 formant ? So that, I can read that file like before(above code) when its(v4l) writing to disk.
[update-2]
we can use ffmpeg instead of v4c. If any solutions for using ffmpeg to save the video stream into disk continuously, so that other programs reads that file ?
-
How to read h264 stream as a file from the USB webcam directly in c/c++ without using opencv ?
23 novembre 2022, par ajayrameshI am able to read a video file of h264 format and doing some machine learning inference on top of it. The code works absolutely fine for input from a file. Below code is a sample code from Deepstream SDK



FileDataProvider(const char *szFilePath, simplelogger::Logger *logger)
 : logger_(logger)
 {
 fp_ = fopen(szFilePath, "rb");

 //fp_ = fopen("/dev/video0", "rb");


 if (nullptr == fp_) {
 LOG_ERROR(logger, "Failed to open file " << szFilePath);
 exit(1);
 }
 pLoadBuf_ = new uint8_t[nLoadBuf_];
 pPktBuf_ = new uint8_t[nPktBuf_];
 assert(nullptr != pLoadBuf_);
 }
 ~FileDataProvider() {
 if (fp_) {
 fclose(fp_);
 }
 if (pLoadBuf_) {
 delete [] pLoadBuf_;
 }
 if (pPktBuf_) {
 delete [] pPktBuf_;
 }
 }




What is requirement ?



- 

- Read from the Logitech c920 webcam instead for video file.
- I know How to read from webcam using opencv. But I don't want to use opencv here.







My Research



- 

- Using v4l we can get the stream and display it in vlc.
- Camera supports below formats.









@ubox : $ v4l2-ctl —device=/dev/video1 —list-formats

 

ioctl : VIDIOC_ENUM_FMT Index : 0 Type : Video Capture
 Pixel Format : 'YUYV' Name : YUYV 4:2:2

 

Index : 1 Type : Video Capture Pixel Format : 'H264'
 (compressed) Name : H.264

 

Index : 2 Type : Video Capture Pixel Format : 'MJPG'
 (compressed) Name : Motion-JPEG





- 

- Reading output of a USB webcam in Linux
vlc v4l2:///dev/video1 --v4l2-chroma=h264
- this displays the video from the webcam.







How to do this ?
- Now how to feed this live stream into
 above sample code such that it reads from the webcam rather than file ?



[update-1]
- In otherwords, does v4l has some options to write the video stream as h264 formant ? So that, I can read that file like before(above code) when its(v4l) writing to disk.



[update-2]
- we can use ffmpeg instead of v4l. If any solutions for using ffmpeg to save the video stream into disk continuously, so that other programs reads that file ?