
Recherche avancée
Autres articles (106)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (13726)
-
Broken pipe when writing video file with moviepy in azure [closed]
5 juin 2024, par LydiaI have a program that retrieves images (png) and audio files from Azure Blob Storage to merge them into a video, which is then written to a temporary file and saved back to Blob Storage. I'm coding in **Python **and here is the function I use from MoviePy :

final_clip.write_videofile(temp_file_name, fps=24, codec='libx264', audio_codec='mp3')

I have containerized my code, and the **Docker **image works perfectly on my machine. However, once deployed on Azure, I encounter this problem with writing the video :

Failed: [Errno 32] Broken pipe MoviePy error: FFMPEG encountered the following error while writing file /tmp/tmp81o22bka.mp4: b'' Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_writer.py", line 136, in write_frame self.proc.stdin.write(img_array.tobytes()) BrokenPipeError: [Errno 32] Broken pipe During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/site/wwwroot/function_app.py", line 102, in generate_simple_video image_clip.write_videofile(temp_file_name, fps=24) File "", line 2, in write_videofile File "/usr/local/lib/python3.8/site-packages/moviepy/decorators.py", line 54, in requires_duration return f(clip, *a, **k) File "", line 2, in write_videofile File "/usr/local/lib/python3.8/site-packages/moviepy/decorators.py", line 135, in use_clip_fps_by_default return f(clip, *new_a, **new_kw) File "", line 2, in write_videofile File "/usr/local/lib/python3.8/site-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB return f(clip, *a, **k) File "/usr/local/lib/python3.8/site-packages/moviepy/video/VideoClip.py", line 300, in write_videofile ffmpeg_write_video(self, filename, fps, codec, File "/usr/local/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_writer.py", line 228, in ffmpeg_write_video writer.write_frame(frame) File "/usr/local/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_writer.py", line 180, in write_frame raise IOError(error) OSError: [Errno 32] Broken pipe MoviePy error: FFMPEG encountered the following error while writing file /tmp/tmp81o22bka.mp4: b''



From my online research, everyone suggests that it’s a resource issue (lack of RAM and CPU). I increased these resources in the Azure Function App configuration, but I still face the same problem.


I took a step-by-step approach to check for compatibility issues with the MoviePy function. I created a small 30-second video without audio, and it worked. Then, I added more options such as more images, audio, etc., but it failed.


I suspected a timeout issue, but even with an execution time of one minute only, it still fails.


I am out of ideas to test and really need help.


Thank you in advance.


-
How to pipe in and pipe out of ffmpeg in python ? [closed]
22 mai 2024, par sa_penguinI want to use ffmpeg as a middleman to perform a functionality. The camera frames will be read through opencv and passed to ffmpeg for processing. FFMPEG need to pass the processed frames to opencv for displaying. Below is what I tried. The code hangs and is not displaying anything. Any help will be appreciated.


import cv2
import math
import subprocess as sp

import ffmpeg
import numpy as np


def main():
 cap = cv2.VideoCapture(0)
 if not cap.isOpened():
 print("Camera can't open\nexit")
 return -1
 width = 640
 height = 480
 fps = 30

out = process = (
 ffmpeg
 .input('pipe:', vsync=0, hwaccel='cuda', hwaccel_output_format='cuda', format='rawvideo', pix_fmt='bgr24', s=f'{width}x{height}', r=f'{fps}')
 .filter('setsar', sar=1) # Keep the aspect ratio
 .output('pipe:', format='rawvideo', pix_fmt='bgr24')
 .run_async(pipe_stdin=True, pipe_stdout=True)
)

while True:
 success, frame = cap.read()
 img = cv2.cvtColor(frame, cv2.COLOR_BayerBG2BGR)
 process.stdin.write(img.tobytes())

 arr = np.frombuffer(process.stdout.read(width*height*3), dtype=np.uint8)
 cv2.imshow("webcam",arr))
 cv2.waitKey(0)


if __name__ == "__main__":
 main()



-
pylwdrone and ffmpeg-python : pipe:0 : Invalid data found when processing input [closed]
8 mai 2024, par Saail ChavanI am using a lewei camera on my drone and i have managed to get the stream using https://github.com/meekworth/pylwdrone, i want to do basic image processing like face or object detection or qr code scan which i am unable to do


when i use this command in terminal :


$ pylwdrone stream start --out-file - | ffplay -i -fflags nobuffer -flags low_delay -probesize 32 -sync ext -



i get a clear feed with no errors




When i am using the script in python i am getting errors and the feed is bit lagged and skips frames


pipe:0: Invalid data found when processing input



ERROR :




import cv2
import numpy as np
import pylwdrone
import ffmpeg
import sys

drone = pylwdrone.LWDrone()
drone.set_time()

window_name = 'Drone Video Stream'
cv2.namedWindow(window_name, cv2.WINDOW_NORMAL)

for packet in drone.start_video_stream():
 try:

 out, _ = (
 ffmpeg.input('pipe:0')
 .output('pipe:', format='rawvideo', pix_fmt='bgr24')
 .run(input=packet.frame_bytes, capture_stdout=True, capture_stderr=True)
 )
 frame = np.frombuffer(out, np.uint8)
 height, width = 1152, 2048
 frame = frame.reshape((height, width, 3))


 # Display video stream
 cv2.imshow(window_name, frame)

 # Check for 'q' key to exit
 if cv2.waitKey(1) & 0xFF == ord('q'):
 break

 except ffmpeg.Error as e:
 print('An error occurred:', e.stderr.decode(), file=sys.stderr)

cv2.destroyAllWindows()
drone.stop_video_stream()