
Recherche avancée
Autres articles (41)
-
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) (...)
-
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (11424)
-
x264enc not respecting timestamps
23 mai 2015, par Austin A.I am trying to write a gstreamer pipeline to read video from a FIFO on disk as raw 720p RGB images, then encode the frames using x264, and save an .mkv file to disk. Here is my current pipeline :
gst-launch-1.0 --eos-on-shutdown -v \
filesrc location="/path/to/fifo_name" do-timestamp=true \
! videoparse format="GST_VIDEO_FORMAT_RGB" width="1280" height="720" \
framerate="2997/100" \
! videoconvert \
! "video/x-raw, format=(string)I420, width=(int)1280,\
height=(int)720" \
! videorate \
! "video/x-raw,framerate=(fraction)2997/100" \
! x264enc \
! matroskamux name=mux \
! filesink location=/path/to/output.mkv sync=falseThe frames are normally pushed onto the fifo at a regular rate (29.97 fps), but sometimes there will be a dropped frame or two, so there might be a delay of 66ms or 100ms between adjacent frames instead of the regular 33ms. However, the
x264enc
element is not respecting those timestamps, because it gives each frame the same 33ms duration, and skips over those dropped frames without the appropriate delay. This makes the video play back faster than expected.To test that this was indeed the
x264enc
element causing issues, I tried skipping the encoder and just showing the result in a display, and this puts the correct delays into the video :gst-launch-1.0 --eos-on-shutdown -v \
filesrc location="/path/to/fifo_name" do-timestamp=true \
! videoparse format="GST_VIDEO_FORMAT_RGB" width="1280" height="720" \
framerate="2997/100" \
! videoconvert \
! "video/x-raw, format=(string)I420, width=(int)1280,\
height=(int)720" \
! videorate \
! "video/x-raw,framerate=(fraction)2997/100" \
! xvimagesink sync=falseSo, something about the x264 encoder is not respecting the timestamps it’s given.
According to the x264 options page, I can provide my own timestamps in a file and give it to x264 with a ’
tcfile-in
’ parameter. But when I try to pass that in throughx264enc
’soption-string
parameter as! x264enc option-string="tcfile-in=/path/to/timestamp.txt"
I get a
Bad name for option tcfile-in=/path/to/timestamp.txt
error.
Any ideas ?
-
How to create a live stream in dash format from mp4 file or m3u8 list ? (ffmpeg)
30 juin 2017, par jorge.luengoI have been trying different ways of running dash live streams from mp4 or m3u8 but none of them worked fined. I want to use ffmpeg because of my server conditions.
This command has been the one that did something but it didn’t work as I expected :ffmpeg-3.3.2-64bit-static/ffmpeg -i reencoded24eng.mp4 -vf yadif=0 -r 30 -vcodec libx264 -keyint_min 60 -g 60 -b:v 1000k -ac 2 -strict 2 -acodec aac -ab 64k -map 0:v -map 0:a -f dash -min_seg_duration 2000 -use_template 1 -use_timeline 1 -init_seg_name init-\$RepresentationID\$.mp4 -dash 1 -media_seg_name test-\$RepresentationID\$-\$Number\$.mp4 test.mpd
The error that the dash-if conformance tool provides is the following one :
Start XLink resolving
XLink resolving successful
Start MPD validation
MPD validation successful - DASH is valid !
Start Schematron validation
location="/[local-name()=’MPD’ and namespace-uri()=’urn:mpeg:dash:schema:mpd:2011’]/[local-name()=’Period’ and >namespace-uri()=’urn:mpeg:dash:schema:mpd:2011’]">
If the MPD is dynamic the Period element shall have an id.location="/[local-name()=’MPD’ and namespace-uri()=’urn:mpeg:dash:schema:mpd:2011’]/[local-name()=’Period’ and >namespace-uri()=’urn:mpeg:dash:schema:mpd:2011’]/*local[1]">
Common attributes for AdaptationSet and Representation shall either be in >one of the elements but not in both.Schematron validation not successful - DASH is not valid !
BUILD SUCCESSFUL
Total time : 5 secondsCould anyone help me with this ?
-
NGINX | FFMPEG Not creating files in designated directory, Regular nginx works, but not the one with ffmpeg
23 février 2021, par ThinkedWe're trying to setup multiple streams that have a delay on them through nginx. We have got the nginx server working on our livestream, but for our delayed ones running through ffmpeg, no files are even created.


Relevant parts of the config :


rtmp {
 server {
 listen 1935; # default port: 1935
 chunk_size 4096;
 allow play all;

 application live {
 allow play all;
 live on;
 # on_publish path_to_stream_key_validation.php
 record off;

 # hls
 hls on;
 hls_nested on;
 hls_path /HLS/live;
 hls_fragment 10s;

 # creates the delayed webcam stream
 exec /usr/local/nginx/hls.sh $app $name;
 }

 # creates the http-location for our delayed webcam HLS stream - "http://my-ip/mobile/my-stream-key/index.m3u8"
 application delay {
 allow play all;
 live on;
 hls on;
 hls_nested on;
 hls_path /HLS/delay;
 hls_fragment 10s;
 }
 #DELAY0
 application delay0 {
 allow play all;
 live on;
 hls on;
 hls_nested on;
 hls_path /HLS/delay0;
 hls_fragment 10s;
 }
 }
}





nginx.conf


#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
 worker_connections 1024;
}


http {
 include mime.types;
 default_type application/octet-stream;

 #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
 # '$status $body_bytes_sent "$http_referer" '
 # '"$http_user_agent" "$http_x_forwarded_for"';

 #access_log logs/access.log main;

 sendfile on;
 #tcp_nopush on;

 #keepalive_timeout 0;
 keepalive_timeout 65;

 #gzip on;

 server {
 listen 80;
 server_name localhost;

 #charset koi8-r;

 #access_log logs/host.access.log main;

 location / {
 root html;
 index index.php index.html index.htm;
 }

 #error_page 404 /404.html;

 # redirect server error pages to the static page /50x.html
 #
 error_page 500 502 503 504 /50x.html;
 location = /50x.html {
 root html;
 }

 # proxy the PHP scripts to Apache listening on 127.0.0.1:80
 #
 #location ~ \.php$ {
 # proxy_pass http://127.0.0.1;
 #}

 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

 location ~ \.php$ {
 root html;
 fastcgi_pass 127.0.0.1:9000;
 fastcgi_index index.php;
 # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
 # fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 include fastcgi_params;
 }
 #LIVE
 location /live {
 types {
 application/vnd.apple.mpegurl m3u8;
 }
 alias /HLS/live;
 add_header Cache-Control no-cache;
 }
 #DELAY
 location /delay {
 types {
 application/vnd.apple.mpegurl m3u8;
 }
 alias /HLS/delay;
 add_header Cache-Control no-cache;
 }
 #DELAY0
 location /delay0 {
 types {
 application/vnd.apple.mpegurl m3u8;
 }
 alias /HLS/delay0;
 add_header Cache-Control no-cache;
 }
 #DELAY1
 location /delay1 {
 types {
 application/vnd.apple.mpegurl m3u8;
 }
 alias /HLS/delay1;
 add_header Cache-Control no-cache;
 }
 #DELAY2
 location /delay2 {
 types {
 application/vnd.apple.mpegurl m3u8;
 }
 alias /HLS/delay2;
 add_header Cache-Control no-cache;
 }
 #DELAY3
 location /delay3 {
 types {
 application/vnd.apple.mpegurl m3u8;
 }
 alias /HLS/delay3;
 add_header Cache-Control no-cache;
 }

 # deny access to .htaccess files, if Apache's document root
 # concurs with nginx's one
 #
 #location ~ /\.ht {
 # deny all;
 #}
 }


 # another virtual host using mix of IP-, name-, and port-based configuration
 #
 #server {
 # listen 8000;
 # listen somename:8080;
 # server_name somename alias another.alias;

 # location / {
 # root html;
 # index index.html index.htm;
 # }
 #}


 # HTTPS server
 #
 #server {
 # listen 443 ssl;
 # server_name localhost;

 # ssl_certificate cert.pem;
 # ssl_certificate_key cert.key;

 # ssl_session_cache shared:SSL:1m;
 # ssl_session_timeout 5m;

 # ssl_ciphers HIGH:!aNULL:!MD5;
 # ssl_prefer_server_ciphers on;

 # location / {
 # root html;
 # index index.html index.htm;
 # }
 #}

}

rtmp {
 server {
 listen 1935; # default port: 1935
 chunk_size 4096;
 allow play all;

 application live {
 allow play all;
 live on;
 # on_publish path_to_stream_key_validation.php
 record off;

 # hls
 hls on;
 hls_nested on;
 hls_path /HLS/live;
 hls_fragment 10s;

 # creates the delayed webcam stream
 #exec ffmpeg -i rtmp://127.0.0.1:1935/$app/$name -acodec copy -c:v libx264 -preset veryfast -profile:v baseline -b:v 400k maxrate 400k -bufsize 400k -threads 0 -r 30 -f flv rtmp://127.0.0.1:1935/delay3/$;
 
 #exec ffmpeg -i rtmp://127.0.0.1:1935/$app/$name -acodec copy -c:v libx264 -preset veryfast -profile:v baseline -vsync cfr -s 480x360 -b:v 400k maxrate 400k -bufsize 400k -threads 0 -r 30 -f flv rtmp://127.0.0.1:1935/delay0/$;

 exec /usr/local/nginx/hls.sh $app $name;


 # exec ffmpeg -i rtmp://127.0.0.1:1935/$app/$name -acodec copy -c:v libx264 -preset veryfast -profile:v baseline -vsync cfr -s 1920x1080 -b:v 400k maxrate 400k -bufsize 400k -threads 0 -r 30 -f flv -filter_complex "[0:v]crop=480:270:0:0[out1];[0:v]crop=480:270:480:0[out2];[0:v]crop=480:270:960:0[out2];[0:v]crop=480:270:1440:0[out2]" -map [out1] -map 0:a rtmp://127.0.0.1:1935/delay0/$ -map [out2] -map 0:a rtmp://127.0.0.1:1935/delay1/$ -map [out3] -map 0:a rtmp://127.0.0.1:1935/delay2/$ -map [out4] -map 0:a rtmp://127.0.0.1:1935/delay3/$;
 }

 # creates the http-location for our delayed webcam HLS stream - "http://my-ip/mobile/my-stream-key/index.m3u8"
 application delay {
 allow play all;
 live on;
 hls on;
 hls_nested on;
 hls_path /HLS/delay;
 hls_fragment 10s;
 }
 #DELAY0
 application delay0 {
 allow play all;
 live on;
 hls on;
 hls_nested on;
 hls_path /HLS/delay0;
 hls_fragment 10s;
 }
 #DELAY1
 application delay1 {
 allow play all;
 live on;
 hls on;
 hls_nested on;
 hls_path /HLS/delay1;
 hls_fragment 10s;
 }
 #DELAY2
 application delay2 {
 allow play all;
 live on;
 hls on;
 hls_nested on;
 hls_path /HLS/delay2;
 hls_fragment 10s;
 }
 #DELAY3
 application delay3 {
 allow play all;
 live on;
 hls on;
 hls_nested on;
 hls_path /HLS/delay3;
 hls_fragment 10s;
 }

 }
}



We just tested a shell script variant of the exec function so here is the shellscript :


ffmpeg -i rtmp://127.0.0.1:1935/$app/$name -acodec copy -c:v libx264 -preset veryfast -profile:v baseline -vsync cfr -s 480x360 -b:v 400k maxrate 400k -bufsize 400k -threads 0 -r 30 -f flv rtmp://127.0.0.1:1935/delay0/$