
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (18)
-
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 -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...) -
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)
Sur d’autres sites (5146)
-
adding delay to an audio stream of a live feed in ffmpeg
19 avril 2020, par blackirishmanI am currently capturing video via a Blackmagic decklink card on macOS. My audio and video are out of sync. The audio is ahead about a second. I suspect the video is slower on account of encoding latency. My solution is to retard the audio using the ffmpeg adelay filter. I originally added a -af "adelay=1000|1000" to my command to delay the audio by 1000ms but I found that this audio filter did nothing. Consequently, I tried to build a complex_filter, but this failed. My command is producing too many streams that ffmpeg can't route them to the proper rtp endpoint. So what is the best way to delay the audio and can I select which streams map to rtp endpoints ?



ffmpeg \
-format_code 23ps \
-f decklink \
-i "DeckLink HD Extreme 3" \
-filter_complex "[0:a] adelay=2s|2s [delayed]" \
-map [delayed] -map 0:v \
-r 24 \
-g 1 \
-s 1920x1080 \
-quality realtime \
-speed 8 \
-threads 8 \
-row-mt 1 \
-tile-columns 2 \
-frame-parallel 1 \
-qmin 30 \
-qmax 35 \
-b:v 2000k \
-pix_fmt yuv420p \
-c:v libvpx-vp9 \
-strict experimental \
-an -f rtp rtp://myurl.com:5004?pkt_size=1300 \
-c:a libopus \
-b:a 128k \
-vn -f rtp rtp://myurl.com:5002?pkt_size=1300




adding a full log when running the command with out any delay :



-filter_complex "[0:a] adelay=2s|2s [delayed]" \
-map [delayed] -map 0:v \

ffmpeg version N-97362-g889ad93c88 Copyright (c) 2000-2020 the FFmpeg developers
 built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
 configuration: --prefix=/usr/local --pkg-config-flags=--static --extra-cflags='-fno-stack-check -I/Users/admin/Documents/ffmpeg_build/include -I/Users/admin/Documents/BDS/Mac/include' --extra-ldflags=-L/Users/admin/Documents/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/Users/admin/Documents/ffmpeg_build/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-decklink
 libavutil 56. 42.102 / 56. 42.102
 libavcodec 58. 80.100 / 58. 80.100
 libavformat 58. 42.100 / 58. 42.100
 libavdevice 58. 9.103 / 58. 9.103
 libavfilter 7. 77.101 / 7. 77.101
 libswscale 5. 6.101 / 5. 6.101
 libswresample 3. 6.100 / 3. 6.100
 libpostproc 55. 6.100 / 55. 6.100
[decklink @ 0x7fcfb2000000] Found Decklink mode 1920 x 1080 with rate 23.98
[decklink @ 0x7fcfb2000000] Frame received (#2) - No input signal detected - Frames dropped 1
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, decklink, from 'DeckLink HD Extreme 3':
 Duration: N/A, start: 0.000000, bitrate: 797002 kb/s
 Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
 Stream #0:1: Video: rawvideo (UYVY / 0x59565955), uyvy422(progressive), 1920x1080, 795466 kb/s, 23.98 tbr, 1000k tbn, 1000k tbc
[decklink @ 0x7fcfb2000000] Frame received (#3) - Input returned - Frames dropped 2
Stream mapping:
 Stream #0:1 -> #0:0 (rawvideo (native) -> vp9 (libvpx-vp9))
 Stream #0:0 -> #1:0 (pcm_s16le (native) -> opus (libopus))
Press [q] to stop, [?] for help
[libvpx-vp9 @ 0x7fcfb180d200] v1.8.2
Output #0, rtp, to 'rtp://myurl.com.com:5004?pkt_size=1300':
 Metadata:
 encoder : Lavf58.42.100
 Stream #0:0: Video: vp9 (libvpx-vp9), yuv420p, 1920x1080, q=30-35, 2000 kb/s, 24 fps, 90k tbn, 24 tbc
 Metadata:
 encoder : Lavc58.80.100 libvpx-vp9
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Output #1, rtp, to 'rtp://myrul.com:5002?pkt_size=1300':
 Metadata:
 encoder : Lavf58.42.100
 Stream #1:0: Audio: opus (libopus), 48000 Hz, stereo, s16, 128 kb/s
 Metadata:
 encoder : Lavc58.80.100 libopus
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
t=0 0
a=tool:libavformat 58.42.100
m=video 5004 RTP/AVP 96
c=IN IP4 54.183.58.143
b=AS:2000
a=rtpmap:96 VP9/90000
m=audio 5002 RTP/AVP 97
c=IN IP4 54.183.58.143
b=AS:128
a=rtpmap:97 opus/48000/2
a=fmtp:97 sprop-stereo=1

frame= 434 fps= 24 q=0.0 size= 37063kB time=00:00:18.09 bitrate=16780.7kbits/s speed=1.01x 



-
Waiting between FFMPEG scripts when creating .hdr/.chk and .mpd files on NGINX server using RTMP module
17 avril 2020, par Mathew KnightWonder if anyone might be able to suggest a solution to and issue i'm having.



I'm running some FFMPEG scripts inside a RTMP server block on an NGINX server running on Ubuntu 18.04.



Basically i'm ingesting the RTMP stream to the server then using FFMPEG to Demux into separate audio and video header and chunk files, then in separate scripts i'm creating two separate manifests for both the audio and video.



The player i have (a development ambisonic, 360 video player) is having problems reading the stream correctly and i believe this is due to the FFMPEG process for the manifests not waiting 2 seconds before running.



Is there a way to program a wait in between the scripts to facilitate this ?



furthermore, is there a way to make the manifest scripts only run once then quit ?



heres my current NGINX .conf



user root;
#user www-data;
worker_processes 1;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
 worker_connections 768;
 # multi_accept on;
}
http {
 ##
 # Basic Settings
 ##
 sendfile on;
 tcp_nopush on;
 tcp_nodelay on;
 keepalive_timeout 65;
 types_hash_max_size 2048;
 # server_tokens off;
 # server_names_hash_bucket_size 64;
 # server_name_in_redirect off;
 include /etc/nginx/mime.types;
 default_type application/octet-stream;
 ##
 # SSL Settings
 ##
 #ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
 #ssl_prefer_server_ciphers on;
 ##
 # Logging Settings
 ##
 access_log /var/log/nginx/access.log;
 error_log /var/log/nginx/error.log;
 ##
 # Gzip Settings
 ##
 ##
 # Virtual Host Configs
 ##
 include /etc/nginx/conf.d/*.conf;
 include /etc/nginx/sites-enabled/*;
}
rtmp {
 server {
 listen 1935;
 chunk_size 4096;

 application live {
 live on;
 record off;
 interleave off;
 wait_key on;
 meta on;
 wait_video off;
 idle_streams off;
 sync 300ms;
 session_relay on;
 #allow publish 127.0.0.1;
 #allow publish 192.168.2.0/24;
 allow publish all;
 #deny publish all;
 allow play all; 
 #RX stream to FFMPEG, demux audio and video, write .hdr files, start chunking DASH segments .chk
 exec_push sudo ffmpeg -y -re -i 'rtmp://localhost:1935/live/stream' -map 0:1 -pix_fmt yuv420p -maxrate 750k -bufsize 3000k -c:v libvpx-vp9 -s 1920x1080 -keyint_min 60 -g 60 -speed 6 -tile-columns 4 -frame-parallel 1 -threads 8 -static-thresh 0 -max-intra-rate 300 -deadline realtime -lag-in-frames 0 -error-resilient 1 -b:v 6000k -f webm_chunk -header "/var/www/html/dash/video_360.hdr" -chunk_start_index 1 "/var/www/html/dash/video_360_%d.chk" -map 0:2 -c:a libopus -mapping_family 255 -b:a 1024k -vn -f webm_chunk -audio_chunk_duration 2000 -header "/var/www/html/dash/audio_171.hdr" -chunk_start_index 1 "/var/www/html/dash/audio_171_%d.chk" 2>>/var/log/nginx/ffmpegChunk.log;

 #Create video manifest
 exec_push sudo ffmpeg -probesize 500M -analyzeduration 100M -f webm_dash_manifest -live 1 -i "/var/www/html/dash/video_360.hdr" -map 0 -c copy -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0" -chunk_start_index 1 -chunk_duration_ms 2000 -minimum_update_period 7200 "/var/www/html/dash/video.mpd" 2>>/var/log/nginx/ffmpegManifestVideo.log;
 #Create audio manifest
 exec_push sudo ffmpeg -probesize 500M -analyzeduration 100M -f webm_dash_manifest -live 1 -i "/var/www/html/dash/audio_171.hdr" -map 0 -c libopus -mapping_family 255 -f webm_dash_manifest -live 1 -adaptation_sets "id=1,streams=0" -chunk_start_index 1 -chunk_duration_ms 2000 -minimum_update_period 7200 "/var/www/html/dash/audio_16ch.mpd" 2>>/var/log/nginx/ffmpegManifestAudio.log;

 ##
 # Record the incoming stream
 ##
 # Record audio and video together
 record all;
 record_path /home/mathewknight/Desktop/StreamRecord/Master;
 record_notify on;
 # Record audio seperately
 recorder audio {
 record audio;
 record_path /home/mathewknight/Desktop/StreamRecord/Audio;
 record_suffix -%d-%b-%y-%T.audio.flv;
 record_notify on;
 }
 # Record video seperately
 recorder video{
 record video;
 record_path /home/mathewknight/Desktop/StreamRecord/Video;
 record_suffix -%d-%b-%y-%T.video.flv;
 record_notify on;
 }

 }


 }

}




-
ffmpeg creates empty mpd-file
1er avril 2021, par MacsterI'm trying to live stream a webm file using ffmpeg and Dash.js as a Player. Creating chunks with ffmpeg seems to work fine, but when want to create the manifest it says
Could not find codec parameters for stream 0 (Video: vp9, none, 640x480): unspecified pixel format Consider increasing the value for the 'analyzeduration' and 'probesize' options
and at the endOutput file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
.

Commands I use


ffmpeg -re -r 25 -i Dash/strm.webm
 -map 0:v:0
 -pix_fmt yuv420p
 -c:v libvpx-vp9
 -s 640x480 -keyint_min 25 -g 25 
 -speed 6 -threads 8 -static-thresh 0 -max-intra-rate 300 
 -deadline realtime -lag-in-frames 0 -error-resilient 1
 -f webm_chunk 
 -header "Dash/glass_360.hdr"
 -chunk_start_index 1
 Dash\glass_360_%d.chk



Manifest


ffmpeg ^
 -f webm_dash_manifest -live 1
 -r 25
 -i Dash/glass_360.hdr
 -c copy
 -map 0
 -r 25
 -framerate 25
 -f webm_dash_manifest -live 1
 -adaptation_sets "id=0,streams=0"
 -chunk_start_index 1
 -chunk_duration_ms 1000
 -time_shift_buffer_depth 7200
 -minimum_update_period 7200
 Dash/glass_live_manifest.mpd



Manifest Output


libavutil 56. 49.100 / 56. 49.100
 libavcodec 58. 87.101 / 58. 87.101
 libavformat 58. 43.100 / 58. 43.100
 libavdevice 58. 9.103 / 58. 9.103
 libavfilter 7. 83.100 / 7. 83.100
 libswscale 5. 6.101 / 5. 6.101
 libswresample 3. 6.100 / 3. 6.100
 libpostproc 55. 6.100 / 55. 6.100
[webm_dash_manifest @ 0000015f19f2ea40] Could not find codec parameters for stream 0 (Video: vp9, none, 640x480): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, webm_dash_manifest, from 'Dash/glass_360.hdr':
 Metadata:
 ENCODER : Lavf58.43.100
 Duration: N/A, bitrate: N/A
 Stream #0:0(eng): Video: vp9, none, 640x480, SAR 1:1 DAR 4:3, 1k tbr, 1k tbn, 1k tbc (default)
 Metadata:
 ALPHA_MODE : 1
 ENCODER : Lavc58.87.101 libvpx-vp9
 webm_dash_manifest_file_name: glass_360.hdr
 webm_dash_manifest_track_number: 1
Output #0, webm_dash_manifest, to 'stream_manifest.mpd':
 Metadata:
 encoder : Lavf58.43.100
 Stream #0:0(eng): Video: vp9, none, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 1k tbr, 1k tbn, 1k tbc (default)
 Metadata:
 ALPHA_MODE : 1
 ENCODER : Lavc58.87.101 libvpx-vp9
 webm_dash_manifest_file_name: glass_360.hdr
 webm_dash_manifest_track_number: 1
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=-1.0 Lsize= 1kB time=00:00:00.00 bitrate=N/A speed= 0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)



glass_live_manifest.mpd


<?xml version="1.0" encoding="UTF-8"?>

<period start="PT0S">
<adaptationset mimetype="video/webm" codecs="vp9" lang="eng" bitstreamswitching="true" subsegmentalignment="true" subsegmentstartswithsap="1">
<contentcomponent type="video"></contentcomponent>
<segmenttemplate timescale="1000" duration="1000" media="glass_$RepresentationID$_$Number$.chk" startnumber="1" initialization="glass_$RepresentationID$.hdr"></segmenttemplate>
<representation bandwidth="1000000" width="640" height="480" codecs="vp9" mimetype="video/webm" startswithsap="1"></representation>
</adaptationset>
</period>




UPDATE


I fixed the "warnings" by changing the comands like this :


ffmpeg -re -r 25 -i Dash/strm.webm
-map 0:v:0
-pix_fmt yuv420p
-c:v libvpx
-s 640x480 -keyint_min 60 -g 60 -speed 6 -tile-columns 4 -frame-parallel 1 -threads 8 -static-thresh 0 -max-intra-rate 300 -deadline realtime -lag-in-frames 0 -error-resilient 1
-b:v 3000k
-f webm_chunk
-header "Dash/glass_360.hdr"
-chunk_start_index 1 Dash/glass_360_%d.chk
-map 0:a:0
-c:a libvorbis
-b:a 128k -ar 44100
-f webm_chunk
-audio_chunk_duration 2000
-header Dash/glass_171.hdr
-chunk_start_index 1 Dash/glass_171_%d.chk

ffmpeg
-f webm_dash_manifest -live 1
-i Dash/glass_360.hdr
-f webm_dash_manifest -live 1
-i Dash/glass_171.hdr
-c copy
-map 0 -map 1
-f webm_dash_manifest -live 1
-adaptation_sets "id=0,streams=0 id=1,streams=1"
-chunk_start_index 1
-chunk_duration_ms 2000
-time_shift_buffer_depth 7200
-minimum_update_period 7200 Dash/glass_video_manifest.mpd



However, it's still not working.