
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (28)
-
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 (...) -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...)
Sur d’autres sites (6183)
-
avformat/iamf_parse : reject ambisonics mode > 1
29 novembre 2024, par Michael Niedermayeravformat/iamf_parse : reject ambisonics mode > 1
ambisonics mode > 1 does not initialize any layer but layer 0
is unconditionally dereferencedFixes : poc-2024-11
Fixes : null pointer dereference
Found-by : 苏童 <220235212@seu.edu.cn>
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
Stream H264 raw data on RTSP server
1er janvier, par AitazazI have H264 hex string data saved in a list.
The data is in correct format as it is being received, I am trying to stream it to RTSP server.


I have stream the data in realtime as it is from a dashcam.


The RTSP server is deployed but when I stream frames to it, the connection is created and then ends in an instant (does not last for a second)


The code is mentioned below which performs this streaming task.


def h264_stream_to_rtsp(data_list, rtsp_url):
 try:
 ffmpeg_command = [
 "ffmpeg", 
 "-f", "h264",
 "-i", "-",
 "-vcodec", "libx264",
 "-preset", "fast",
 "-f", "rtsp",
 "-analyzeduration", "5000000",
 "-probesize", "5000000", 
 rtsp_url # The RTSP URL to stream to
 ]
 
 ffmpeg_process = subprocess.Popen(ffmpeg_command, stdin=subprocess.PIPE)

 for index, hex_data in enumerate(data_list):
 # print(f"Processing hex data {index + 1}/{len(data_list)}...")

 if len(hex_data) % 2 != 0:
 hex_data = '0' + hex_data # Append a leading zero if length is odd

 binary_data = binascii.unhexlify(hex_data)

 ffmpeg_process.stdin.write(binary_data)

 ffmpeg_process.stdin.close()

 ffmpeg_process.wait()
 print("Stream completed.")

 except KeyboardInterrupt:
 print("Stopping live stream.")
 except Exception as e:
 print(f"Error: {e}")



Logs from the RTSP server are mentioned below :


2025/01/01 10:56:04 INF [RTSP] [conn 20.174.9.78:35474] opened
2025/01/01 10:56:04 INF [RTSP] [session 1d2bb871] created by 20.174.9.78:35474
2025/01/01 10:56:04 INF [RTSP] [session 1d2bb871] is publishing to path 'live', 1 track (H264)
2025/01/01 10:56:04 INF [RTSP] [session 1d2bb871] destroyed: torn down by 20.174.9.78:35474
2025/01/01 10:56:04 INF [RTSP] [conn 20.174.9.78:35474] closed: EOF
2025/01/01 10:56:48 INF [RTSP] [conn 20.174.9.78:54448] opened
2025/01/01 10:56:48 INF [RTSP] [session b6a95e71] created by 20.174.9.78:54448
2025/01/01 10:56:48 INF [RTSP] [session b6a95e71] is publishing to path 'live', 1 track (H264)
2025/01/01 10:56:48 INF [RTSP] [session b6a95e71] destroyed: torn down by 20.174.9.78:54448



How can I stream continuously ?


-
How to reinsert edited metadata stream information from the FFMETADATAFILE file ? [closed]
6 septembre 2024, par SENYCHI'm working on simplifying and speeding up the process of editing video metadata for user convenience. I've successfully edited metadata streams using console commands, such as :


ffmpeg -i INPUT.mp4 -map 0 -metadata:s:0 "handler_name=An other video" -metadata:s:1 "handler_name=An other audio recording in russian" -metadata:s:2 "handler_name=An other audio recording in english" -metadata:s:3 "handler_name=An other audio recording in japanese" -c copy OUTPUT.mp4



However, I'd like to accomplish this through a ffmetadata file. Here's the approach I've taken :


ffmpeg -t 0 -i INPUT.mp4 -map 0 -c copy -f ffmetadata ffmetadata.txt -hide_banner



Original ffmetadata.txt is :


;FFMETADATA1
major_brand=isom
minor_version=512
compatible_brands=isomiso2avc1mp41
encoder=Lavf61.5.101
[STREAM]
language=und
handler_name=The best video
vendor_id=[0][0][0][0]
[STREAM]
language=rus
handler_name=The best russian language
vendor_id=[0][0][0][0]
[STREAM]
language=eng
handler_name=The best english language
vendor_id=[0][0][0][0]
[STREAM]
language=jpn
handler_name=The best japanese language
vendor_id=[0][0][0][0]



Edit the ffmetadata.txt file to update the handler_name values :


;FFMETADATA1
major_brand=isom
minor_version=512
compatible_brands=isomiso2avc1mp41
encoder=Lavf61.5.101
[STREAM]
language=und
handler_name=An other video
vendor_id=[0][0][0][0]
[STREAM]
language=rus
handler_name=An other audio recording in russian
vendor_id=[0][0][0][0]
[STREAM]
language=eng
handler_name=An other audio recording in english
vendor_id=[0][0][0][0]
[STREAM]
language=jpn
handler_name=An other audio recording in japanese
vendor_id=[0][0][0][0]



Attempt to apply the updated metadata from ffmetadata2.txt :


C:\Users\Alexander\Videos>ffmpeg -i INPUT.mp4 -i ffmetadata2.txt -map 0:v -map 0:a -map_metadata 1 -c copy OUTPUT2.mp4 -hide_banner



Despite these steps, I've noticed that only the global metadata is updated, while the metadata for each stream remains unchanged. The console output shows that metadata for each stream is not updated as expected.


What am I missing ? How can I ensure that the stream-specific metadata is also updated correctly when using a ffmetadata file ?


Additional Information :


- 

- FFmpeg version : 2024-08-26-git-98610fe95f-full_build
- The ffmetadata file format and the approach I've used should be correct according to the FFmpeg documentation.






I would greatly appreciate any recommendations or suggestions on how to solve this problem !


I found a bad solution for my problem, but it still isn't ideal as it requires specifying
-map_metadata:s:N 1:s:N
for each stream individually, which is quite cumbersome. Is there a way to simplify this process and avoid having to set metadata for each stream separately ?

The command I’m using is :


C:\Users\Alexander\Videos>ffmpeg -i INPUT.mp4 -i ffmetadata2.txt -map 0 -map_metadata:s:0 1:s:0 -map_metadata:s:1 1:s:1 -map_metadata:s:2 1:s:2 -map_metadata:s:3 1:s:3 -c copy OUTPUT2.mp4 -hide_banner



This works, but having to specify
-map_metadata:s:N
for each stream creates extra work, especially as the number of streams increases. Is there a more efficient way to handle this ?