
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (49)
-
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
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 -
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 (...)
Sur d’autres sites (10902)
-
electron app fluent-ffmpeg " Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height"
27 juillet 2020, par MartinI am trying to run an ffmpeg command in my electron app. I have created the function ffmpegTest() based off instructions for setting up ffmpeg here :


https://alexandercleasby.dev/blog/use-ffmpeg-electron


and the example query for ffmpeg-fluent here :


https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/blob/master/examples/image2video.js


function ffmpegTest(){
 console.log('ffmpeg-test')
 //require the ffmpeg package so we can use ffmpeg using JS
 const ffmpeg = require('fluent-ffmpeg');
 //Get the paths to the packaged versions of the binaries we want to use
 const ffmpegPath = require('ffmpeg-static').replace(
 'app.asar',
 'app.asar.unpacked'
 );
 const ffprobePath = require('ffprobe-static').path.replace(
 'app.asar',
 'app.asar.unpacked'
 );
 //tell the ffmpeg package where it can find the needed binaries.
 ffmpeg.setFfmpegPath(ffmpegPath);
 ffmpeg.setFfprobePath(ffprobePath);
 
 var imgPath = "C:\\Users\\marti\\Documents\\martinradio\\uploads\\israel song festival 1979\\front.jpg"
 var outputPath = "C:\\Users\\marti\\Documents\\martinradio\\uploads\\israel song festival 1979\\output.m4v"

 // make sure you set the correct path to your video file
 var proc = ffmpeg(imgPath)
 // loop for 5 seconds
 .loop(5)
 // using 25 fps
 .fps(25)
 // setup event handlers
 .on('end', function() {
 console.log('file has been converted succesfully');
 })
 .on('error', function(err) {
 console.log('an error happened: ' + err.message);
 })
 // save to file
 .save(outputPath);

 console.log("end of ffmpeg-test")
}



it is trying to convert an image to a video, my filepaths are accurate, but when I run this function, I get this output in console :


ffmpeg-test
index.js:137 end of ffmpeg-test
index.js:132 an error happened: ffmpeg exited with code 1: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!



After the error prints out, I can see my output.m4v file inside my output folder, but it is 0KB in size and wont open. Is there some way I can specify my bit_rate / rate / width / height in my fluent-ffmpeg command so I can run this simple ffmpeg command ?


thanks


-
what is the meaning of the v4l2-ctl —list-device ?
26 janvier 2021, par mcgregor94086The High level Problem :


I have a custom multi-camera array that I have attached to a Raspberry Pi via some USB hubs, and I need a way to quickly identify which camera needs attention when any camera fails to respond to an image capture request.


Can "v4l2-ctl —list_devices" help me ?


I am trying to determine if
"v4l2-ctl —list_devices" can help me more quickly identify which one is missing. My thought was to look at which cameras are reporting, and then notice which one is NOT reporting, and investigate the missing one.


My question is can I identify each reporting camera either for the v4l2-ctl output, or from "FFmpeg -list_formats"


Here is the output I get from v4l2-ctl :


$ v4l2-ctl --list-device 
bcm2835-codec-decode (platform:bcm2835-codec):
 /dev/video10
 /dev/video11
 /dev/video12

bcm2835-isp (platform:bcm2835-isp):
 /dev/video13
 /dev/video14
 /dev/video15
 /dev/video16

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.1.2.1.1):
 /dev/video4
 /dev/video5

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.1.2.1.2):
 /dev/video6
 /dev/video7

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.1.2.1.3):
 /dev/video8
 /dev/video9

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.1.2.1.4):
 /dev/video17
 /dev/video18

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.1.2.2):
 /dev/video0
 /dev/video1

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.1.2.3):
 /dev/video2
 /dev/video3

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.1.3.1.1):
 /dev/video21
 /dev/video22

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.1.3.1.2):
 /dev/video25
 /dev/video26

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.1.3.1.4):
 /dev/video29
 /dev/video30

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.1.3.2):
 /dev/video19
 /dev/video20

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.1.3.3):
 /dev/video23
 /dev/video24

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.1.3.4):
 /dev/video27
 /dev/video28

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.2.1.2):
 /dev/video35
 /dev/video36

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.2.1.3):
 /dev/video39
 /dev/video40

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.2.1.4):
 /dev/video41
 /dev/video42

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.2.2):
 /dev/video31
 /dev/video32

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.2.3):
 /dev/video33
 /dev/video34

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.2.4):
 /dev/video37
 /dev/video38

FHD Camera: FHD Camera (usb-0000:01:00.0-1.2.4.2):
 /dev/video43
 /dev/video44



All the USB cameras in my array each report the same first field (in this case "FHD Camera") so I can't use the name as a unique identifier.


Each "FHD Camera" is assigned two different /dev/videoNN ids (one will be assigned for the mpeg format, and the other for the UYV format). However these /dev/videoNN assignments change each time the computer reboots.


The sequence that cameras are listed in the output also changes each time the v4l2-ctl command runs. So that also is of no help


v4l2-ctl also reports another field, beginning "usb-0000 :" followed by a series numbers (e.g. "01:00.0-1.2.2.4").


I am wondering if this number string ties in any way to the physical USB bus, and would remain permanent across reboots.


The v4l2-ctl help documentation merely says that the —list-devices flag will list the video devices, but these additional fields and their meaning is not explained.


Alternatively, for each camera that is responding, I can query the device with
"ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/videoNN", yielding a response like this :


$ ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video8
[video4linux2,v4l2 @ 0x1a391c0] Compressed: mjpeg : Motion-JPEG : 640x480 1280x720 640x360 320x240 1920x1080
[video4linux2,v4l2 @ 0x1a391c0] Raw : yuyv422 : YUYV 4:2:2 : 640x480 1280x720 640x360 320x240 1920x1080
/dev/video8: Immediate exit requested



This ffmpeg query shows me that the device is also registered as "0x1a391c0". I am not yet sure whether these identifiers are stable across reboots, and if they are, whether they are stable with the physical camera, or if they are just a stable identifier to the USB Hub location of the camera.


My request :


Can someone explain to me how the "device name", /dev/videoNN identifier, usb-0000:01:00.0-1.2.2.4 identifier, and 0x1a391c0 are assigned ?


The responding order of the items listed in v4l2-ctl changes each time it runs.


Is this reflecting that all cameras are polled simultaneously, but acquisition of the bus for response transmission is random ?


Addendum


Further investigation shows me that the "0x-------" identifiers do not seem to be stable across reboots either.


The "usb-0000:01:00.0-1.2.2.2" identifier DOES seem to have a somewhat stable meaning. I have (5) 7-port usb hubs attached to my RPi 400. 4 of these are branch hubs that feed into a master hub, and the master hub feeds into the RPi.


After the 0-1. in the identifier there is either 3 or 4 digits. If there are only 3, the last digit is a port identifier 2, 3, or 4.


If there are 4 digits, then the 2nd to last digit will be a 1, and 1.1, 1.2, 1.3, and 1.4 will represent the last 4 physical ports on that hub.


Ironically, while the same port identifiers are always used in the same order on each of my (identical brand/model) hubs, they are NOT in ascending or descending sequence in terms of their physical sequence on the hubs.


I have deduced from this that each of my hubs actually uses two USB 4 port chips. So the first chip is getting the single digits, while the 1st port on that 1st chip is feeding the 2nd chip.


The 2nd digit in my identifiers is identifying which branch hub the device is on, 1,2,3 or 4. The first digit is 1, which seems to be identifying that all the branches are children of the master hub.


These addresses seem to be stable across reboots as long as all of the USB hubs are already connected at boot up. If not all are connected, those that are connected first will get the lowest hub number identifiers.


I don't know if this tree address identifier behavior would be the same on other hubs, but perhaps these observations will be of some use to anyone else trying to find stable identifiers in their own multi hub and multi-device architecture.


-
Creating video from list of images using ffmpeg
13 août 2019, par haseebSummary
From given code, second function taking UI values and passing to first one. from log, first two lines shows command list and command string.
What’s irritating me is, if I copied second line from log (dos cmd) and paste it in a cmd prompt, it works successfully and produces video correctly. but running it via gui
subprocess
, errors out.Task Description
Directory contains thousand of images each after few minutes of a construction project. I need to create a video from data (images) per day basis. I have successfully extracted list of images, etc, and have data.
utils.py :
def framesToVideoViaCount(srcFile,outputFile,start,count,rate):
# ffmpeg -start_number 1 -i test_%04d.png -vframes 100 -vcodec mpeg4 test.mp4
# "C:\\Users\\lalat\\Desktop\\03008427633\\output_%04d.png"
# ffmpeg -start_number 50 -i "C:\\Users\\lalat\\Desktop\\03008427633\\output_%04d.png" -vframes 200 -vcodec mpeg4 "C:\\Users\\lalat\\Desktop\\day1.mp4"
command = [ 'ffmpeg',
# '-loglevel', 'fatal',
'-r %d' %(rate),
'-start_number %d' %(start) ,
'-i "%s"' %(srcFile),
'-vframes %d' %(count),
'-vcodec mpeg4' ]
# command.append ('fps=%d' % (fps))
command.append (outputFile)
print ("COMMAND: " , command)
print ("DOS CMD: ", ' '.join(command))
ffmpeg = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE )
out, err = ffmpeg.communicate()
if(err) : print('error',err); return None;
print (out)Actual GUI function call in tk gui app :
def approachByCount(self):
tdate = datetime(year=int(self.fyear.get()), month=int(self.fmonth.get()), day=int(self.fdate.get()))
# now = datetime.datetime.now()
outputName = str(tdate.strftime("%Y%m%d")) + ".txt"
outputVid = str(tdate.strftime("%Y%m%d")) + ".mp4"
files = os.listdir(self.userDir)
selected = []
for afile in files:
afile = os.path.join(self.userDir,afile)
sdate = datetime.fromtimestamp(os.path.getmtime(afile))
if sdate.date() == tdate.date():
selected.append(afile)
# get first file name
srcfilename = os.path.basename(selected[0])
srcfilename,ext = srcfilename.split(".")
filename,pad = srcfilename.split("_")
srcfilename = os.path.join(self.userDir,filename+"_%0"+str(len(pad))+"d."+ext)
start = int(pad)
count = len(selected)
utils.framesToVideoViaCount(srcfilename,outputVid,start,count,25)ERROR log
COMMAND: ['ffmpeg', '-r 25', '-start_number 1', '-i "C:\\Users\\lalat\\Desktop\\03008427633\\output_%04d.png"', '-vframes 382', '-vcodec mpeg4', '20190810.mp4']
DOC CMD: ffmpeg -r 25 -start_number 1 -i "C:\Users\lalat\Desktop\03008427633\output_%04d.png" -vframes 382 -vcodec mpeg4 20190810.mp4
error b"ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers\r\n
built with gcc 8.2.1 (GCC) 20181017\r\n
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth\r\n
libavutil 56. 22.100 / 56. 22.100\r\n
libavcodec 58. 35.100 / 58. 35.100\r\n
libavformat 58. 20.100 / 58. 20.100\r\n
libavdevice 58. 5.100 / 58. 5.100\r\n
libavfilter 7. 40.101 / 7. 40.101\r\n
libswscale 5. 3.100 / 5. 3.100\r\n
libswresample 3. 3.100 / 3. 3.100\r\n
libpostproc 55. 3.100 / 55. 3.100\r\n
Unrecognized option 'r 25'.\r\n
Error splitting the argument list: Option not found\r\n"