
Recherche avancée
Autres articles (69)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (6407)
-
Decoding the h.264 stream from a serial port
18 mars, par PeterI would like to know if there is a reliable way to decode an H.264 NAL stream coming through a serial port using software.


So far, I have managed to decode a single frame using a python script. In this script, I first write the incoming data to a file, and when the end-of-frame marker 00_00_00_01 appears, I display the frame using ffplay.


import serial
import subprocess
import os
import time

ser = serial.Serial('COM3', 115200, timeout=1)
output_file = "output.264"

# Variable to store the ffplay process
ffplay_process = None

# Open the file for writing in binary mode
with open(output_file, "wb") as file:

 print("Writing bytes to output.264. Waiting for the end-of-frame marker 0x00000001.")

 buffer = bytearray()
 marker = b'\x00\x00\x00\x01'

 try:
 while True:
 if ser.in_waiting: # If there is data in the buffer
 data = ser.read(ser.in_waiting) # Read all available bytes
 buffer.extend(data)

 # Check if the end-of-frame marker is in the buffer
 while marker in buffer:
 index = buffer.index(marker) + len(marker) # Position after the marker
 frame = buffer[:index] # Extract the frame
 buffer = buffer[index:] # Keep the remaining data

 print(f"Frame recorded: {len(frame)} bytes")
 file.write(frame) # Write the frame to the file
 file.flush() # Force writing to disk

 # Close the ffplay window if it is already open
 if ffplay_process and ffplay_process.poll() is None:
 ffplay_process.terminate()
 ffplay_process.wait() # Wait for the process to terminate

 # Play the recorded frame, reopening the window
 ffplay_process = subprocess.Popen(["ffplay", "-f", "h264", "-i", output_file])

 except KeyboardInterrupt:
 print("\nRecording stopped.")
 finally:
 # Close the serial port and the ffplay process
 ser.close()



However, each time a new end-of-frame marker is detected, the ffplay window closes and reopens to show the next frame. It will flicker when transferring the video. Is there a way to display the frames in the same window for seamless playback when streaming video ?


Or is there a better approach or software that is more suited for this task ? I do not know where to start, so I will be glad for any hints.


-
How to create video by stitching together images (.png) where the serial on each image file increases by 6
10 avril 2024, par DataStatsExplorerI am trying to create a video (preferably mp4) from a series of png images. However, the name of each image file increases by 6 every frame. For example, I would have depthframe_0000 as the first frame, and depthframe_0001 for the next frame.


There are a few answers that have answered a similar question but I am unable to process the video when the image files are not increasing by 1.


I would like to keep the fps at 5. I am using ffmpeg as the suggested in the answers above but am open to any other suggestion.


The collab code that I have put together is as follows :


import subprocess

# Define the frame rate and the input/output paths
output_fps = 5
input_path = "/content/drive/MyDrive/depth/depthframe_%04d.png"
output_path = "/content/drive/MyDrive/depth.mp4"

# Create a list of the frames
frames = [input_path % i for i in range(0, 2671, 6)] # Update range as needed

# Write the list of frames to a temporary text file
with open('frames.txt', 'w') as f:
 for frame in frames:
 f.write(f"file '{frame}'\n")

# Create the command
command = [
 "ffmpeg",
 "-f", "concat",
 "-safe", "0",
 "-i", "frames.txt",
 "-c:v", "libx264",
 "-pix_fmt", "yuv420p",
 output_path
]

# Run the command
subprocess.run(command, check=True)



-
Stream video over serial port using FFmpeg [closed]
13 septembre 2020, par Rasoul SharifianI am using the FFmpeg library to stream videos by UDP and LAN cables, something like this :




But as our embedding systems just have serial ports the data must stream over the serial ports.
something like this :




So the question is : Is it possible to stream videos over the serial port using the FFmpeg library ? Or is there any other library that can compress and stream videos over serial ports ?


I also used a kind of Uart to ethernet converter hardware module to solve the problem and hopefully, this worked for me. But the project goal is to send video data over serial ports originally and not using some hardware converters.


Any suggestions would be helpful.