
Recherche avancée
Médias (91)
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
-
USGS Real-time Earthquakes
8 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
SWFUpload Process
6 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (50)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (11345)
-
Streaming HLS with Nginx & FFMPEG : How to prevent repeating or skipping scenes (.ts) when playback ?
31 août 2022, par FugenI set up HLS streaming server using Nginx & FFMPEG, then i watch it using vlc or ffplay on another pc. The problem is sometimes it repeating scenes or skipping scenes for few seconds then it continue like normal, it happens at random but occurs occasionally and not always on the same spots.


Here is sample of ffplay log :


[http @ 000002c6e2611c00] Opening 'http://172.20.120.75:8080/hls/test-3.ts' for reading
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-VERSION:3')sq= 0B f=0/0
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-DISCONTINUITY')
[http @ 000002c6e2614500] Opening 'http://172.20.120.75:8080/hls/test-3.ts' for reading
[http @ 000002c6e2611c00] Opening 'http://172.20.120.75:8080/hls/test-4.ts' for reading
[http @ 000002c6e81c8140] Opening 'http://172.20.120.75:8080/hls/test.m3u8' for reading
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-VERSION:3')sq= 0B f=1/1
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-DISCONTINUITY')
[http @ 000002c6e2614500] Opening 'http://172.20.120.75:8080/hls/test-3.ts' for reading
[http @ 000002c6e2611c00] Opening 'http://172.20.120.75:8080/hls/test-4.ts' for reading
[http @ 000002c6e81c8140] Opening 'http://172.20.120.75:8080/hls/test.m3u8' for reading
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-VERSION:3')sq= 0B f=2/2
[http @ 000002c6e2614500] Opening 'http://172.20.120.75:8080/hls/test-6.ts' for reading
[http @ 000002c6e2611c00] Opening 'http://172.20.120.75:8080/hls/test-7.ts' for reading
[http @ 000002c6e81c8140] Opening 'http://172.20.120.75:8080/hls/test.m3u8' for reading
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-VERSION:3')sq= 0B f=2/2
[http @ 000002c6e2614500] Opening 'http://172.20.120.75:8080/hls/test-7.ts' for reading
[http @ 000002c6e81c8140] Opening 'http://172.20.120.75:8080/hls/test.m3u8' for reading
[hls @ 000002c6e260bcc0] Skip ('#EXT-X-VERSION:3')sq= 0B f=2/2
[http @ 000002c6e2611c00] Opening 'http://172.20.120.75:8080/hls/test-8.ts' for reading



From that log, repeating scenes are :
test-3.ts
,test-4.ts
,test-7.ts
, and skipped scene :test-5.ts
.
My question is : how to prevent this ?

When i checked .m3u8 playlist on server side it seems normal, no repeated or skipped .ts file. Here is .m3u8 file :


#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:17
#EXT-X-TARGETDURATION:4
#EXTINF:3.600,
test-1.ts
#EXTINF:3.560,
test-2.ts
#EXTINF:3.600,
test-3.ts
#EXTINF:3.600,
test-4.ts
#EXTINF:3.600,
test-5.ts
#EXTINF:3.600,
test-6.ts
#EXTINF:3.600,
test-7.ts
#EXTINF:3.520,
test-8.ts
#EXTINF:3.600,



My Nginx Configuration :


worker_processes 4;
events {
 worker_connections 1024;
 use epoll;
 multi_accept on;
}

# RTMP configuration
rtmp {
 server {
 listen 1935; # Listen on standard RTMP port
 chunk_size 4096;

 application show {
 live on;
 # Turn on HLS
 hls on;
 hls_path /tmp/hls/;
 hls_fragment 3;
 hls_playlist_length 60;
 # disable consuming the stream from nginx as rtmp
 deny play all;
 }
 }
}

http {
 sendfile off;
 tcp_nopush on;
 tcp_nodelay on;
 reset_timedout_connection on;
 directio 512;
 default_type application/octet-stream;

 server {
 listen 8080;

 location /hls {
 # Disable cache
 add_header 'Cache-Control' 'no-cache';
 access_log off;
 # CORS setup
 add_header 'Access-Control-Allow-Origin' '*' always;
 add_header 'Access-Control-Expose-Headers' 'Content-Length';
 # allow CORS preflight requests
 if ($request_method = 'OPTIONS') {
 add_header 'Access-Control-Allow-Origin' '*';
 add_header 'Access-Control-Max-Age' 1728000;
 add_header 'Content-Type' 'text/plain charset=UTF-8';
 add_header 'Content-Length' 0;
 return 204;
 }

 types {
 application/dash+xml mpd;
 application/vnd.apple.mpegurl m3u8;
 video/mp2t ts;
 }

 root /tmp/;
 }
location /nginx_status {
 # Turn on stats
 stub_status on;
 allow all;
 }
}
}



My FFMPEG Command :


ffmpeg -re -stream_loop -1 -i 'video1.mp4' -vcodec libx264 -vprofile baseline -g 30 -acodec aac -strict -2 -f flv 'rtmp://172.20.120.75/show/test' &



Thank You for Your Help.


-
ffplay : allow borderless playback windows
1er février 2017, par Lucas Sanderyffplay : allow borderless playback windows
For a pure video tile effect, and enabling better integration of playback windows
into other programs. It would improve the looks in many situations and avoid ugly
hacks like this : http://stackoverflow.com/q/31465630/315024Signed-off-by : Lucas Sandery <lucas-sandery@users.noreply.github.com>
Signed-off-by : Marton Balint <cus@passwd.hu> -
How to get frame-by-frame audio from the video in python
7 juin 2023, par Usman ArshadSo,first of all the description of my program is that I am viewing a video using opencv and whenever I press "p" the video paused for 5 seconds.At last I am saving that updated video in the same directory.I want to add audio to this video and whenever "p" pressed the audio must also be stopped for 5 second until next frame.


import cv2

def save_frames(frames, output_filename, fps):
 # Get video information from the first frame
 height, width, _ = frames[0].shape

 # Create a VideoWriter object to save the frames
 fourcc = cv2.VideoWriter_fourcc(*'mp4v')
 output = cv2.VideoWriter(output_filename, fourcc, fps, (width, height))

 # Write each frame to the video file
 for frame in frames:
 output.write(frame)

 # Release the VideoWriter
 output.release()
 
def main():
 # Load the video
 video_path = 'input_video.mp4'
 cap = cv2.VideoCapture(video_path)


 frames = []
 fps = cap.get(cv2.CAP_PROP_FPS)

 while cap.isOpened():
 # Read the current frame
 ret, frame = cap.read()

 if not ret:
 break

 # Display the frame
 cv2.imshow('Video', frame)

 # Append the frame to the list
 frames.append(frame)
 # Wait for key press
 key = cv2.waitKey(int(1000 / fps))

 if key == ord('p'):
 # Pause the video for 5 seconds
 paused = True
 for _ in range(int(fps * 5)):
 frames.append(frame)
 cv2.waitKey(int(1000 / fps))
 paused = False

 # Release the VideoCapture
 cap.release()

 # Save the frames to a video file
 output_filename = 'output.mp4'
 save_frames(frames, output_filename, fps)

if __name__ == '__main__':
 main()