
Recherche avancée
Autres articles (35)
-
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
Other interesting software
13 avril 2011, parWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website : http://videopress.com/
License : GNU/GPL v2
Source code : (...) -
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 (8037)
-
Revision fb1f6f1db4 : Fix segment feature data type. It has a range of -255,255, so should be int16_t
7 juin 2013, par Ronald S. BultjeChanged Paths :
Modify /vp9/common/vp9_blockd.h
Fix segment feature data type.It has a range of -255,255, so should be int16_t, not int8_t.
Change-Id : I5ef4b6aefb6212b0f35f4754f3c4d73fddbc52a0
-
FFMPEG MP3 file size much larger than expected on Windows 10
8 avril 2018, par The GoraI’ve been using FFMPEG on Windows to :
- Convert iTunes M4A files to MP3s (with a bit rate of 128k) ; and
- Create 30 sec sample MP3s of the above MP3s (same bit rate).
When I run FFMEG on a Windows 7 64 bit machine, the size of the MP3s (both for 1. & 2.) is in line with the rough calculation of :
(Audio length in seconds) X (Bit rate)
For example, a 4 minute audio yields an approx. 3.7MB MP3 file ; a 30 second sample MP3 is approx. 470KB.
However when I run the same FFMPEG binary (copied from the Windows 7 machine) on a Windows 10 64 bit machine, all of the MP3s (both for 1. and for 2.) are inflated by approx 5MB. I’m using the same batch file on both machines to execute FFMEG with the required parameters, so pretty confident the difference is not down to user error.
My questions are :
- Why is there this apparent 5MB overhead on Windows 10 ? and more importantly ;
- What can I do to remove this ?
The large file size is a problem as the sample MP3s are to be put on a website for people to listen to a snippet of the song, and the webpage with multiple tags takes a long time to load completely (several minutes).
Here is the version and lib info :
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --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-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100And here are the command lines I’m using :
- ffmpeg -i input.m4a -id3v2_version 3 -b:a 128k -output.mp3
- ffmpeg -i input.m4a -ss 30 -t 30 -af "afade=in:st=30:d=5,afade=out:st=55:d=5" -id3v2_version 3 -b:a 128k -output.mp3
-
TypeError : expected str, bytes or os.PathLike object, not module when trying to sream openCv frames to rtmp server
30 novembre 2022, par seriouslyI am using openCv and face-recognition api to detect a face using a webcam then compare it with a previously taken image to check and see if the people on both images are the same and the openCv and face-recognition part of the code works properly now what I am trying to achieve is to stream the openCv processed video frames to an rtmp server so for this I am trying to use ffmpeg and running the command using subprocess but when I run the code I get error
TypeError: expected str, bytes or os.PathLike object, not module
. But I am writing the frames as bytes to stdin hencep.stdin.write(frame.tobytes())
. How can I fix it and properly stream my openCv frames to an rtmp server using ffmpeg. Thanks in advance.

Traceback (most recent call last):
 File "C:\Users\blah\blah\test.py", line 52, in <module>
 p = subprocess.Popen(command, stdin=subprocess.PIPE, shell=False)
 File "C:\Python310\lib\subprocess.py", line 969, in __init__
 self._execute_child(args, executable, preexec_fn, close_fds,
 File "C:\Python310\lib\subprocess.py", line 1378, in _execute_child
 args = list2cmdline(args)
 File "C:\Python310\lib\subprocess.py", line 561, in list2cmdline
 for arg in map(os.fsdecode, seq):
 File "C:\Python310\lib\os.py", line 822, in fsdecode
 filename = fspath(filename) # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not module
</module>


import cv2
import numpy as np
import face_recognition
import os
import subprocess
import ffmpeg

path = '../attendance_imgs'
imgs = []
classNames = []
myList = os.listdir(path)

for cls in myList:
 curruntImg = cv2.imread(f'{path}/{cls}')
 imgs.append(curruntImg)
 classNames.append(os.path.splitext(cls)[0])

def findEncodings(imgs):
 encodeList = []
 for img in imgs:
 img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
 encode = face_recognition.face_encodings(img)[0]
 encodeList.append(encode)
 return encodeList

encodeListKnown = findEncodings(imgs)
print('Encoding Complete')

cap = cv2.VideoCapture(0)

rtmp_url = "rtmp://127.0.0.1:1935/stream/webcam"

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))

# command and params for ffmpeg
command = [ffmpeg,
 '-y',
 '-f', 'rawvideo',
 '-vcodec', 'rawvideo',
 '-pix_fmt', 'bgr24',
 '-s', "{}x{}".format(width, height),
 '-r', str(fps),
 '-i', '-',
 '-c:v', 'libx264',
 '-pix_fmt', 'yuv420p',
 '-preset', 'ultrafast',
 '-f', 'flv',
 'rtmp://127.0.0.1:1935/stream/webcam']

p = subprocess.Popen(command, stdin=subprocess.PIPE, shell=False)


while True:
 ret, frame, success, img = cap.read()
 if not ret:
 print("frame read failed")
 break
 imgSmall = cv2.resize(img, (0,0), None, 0.25, 0.25)
 imgSmall = cv2.cvtColor(imgSmall, cv2.COLOR_BGR2RGB)

 currentFrameFaces = face_recognition.face_locations(imgSmall)
 currentFrameEncodings = face_recognition.face_encodings(imgSmall, currentFrameFaces)

 for encodeFace, faceLocation in zip(currentFrameEncodings, currentFrameFaces):
 matches = face_recognition.compare_faces(encodeListKnown, encodeFace)
 faceDistance = face_recognition.face_distance(encodeListKnown, encodeFace)
 matchIndex = np.argmin(faceDistance)

 if matches[matchIndex]:
 name = classNames[matchIndex].upper()
 y1, x2, y2, x1 = faceLocation
 y1, x2, y2, x1 = y1 * 4, x2 * 4, y2 * 4, x1 * 4 
 cv2.rectangle(img, (x1, y1), (x2, y2), (0, 255, 0), 2)
 cv2.rectangle(img, (x1, y2 - 35), (x2, y2), (0, 255, 0), cv2.FILLED)
 cv2.putText(img, name, (x1 + 6, y2 - 6), cv2.FONT_HERSHEY_DUPLEX, 1, (255, 255, 255), 2) 

 # write to pipe
 p.stdin.write(frame.tobytes())