
Recherche avancée
Médias (91)
-
Les Miserables
9 décembre 2019, par
Mis à jour : Décembre 2019
Langue : français
Type : Textuel
-
VideoHandle
8 novembre 2019, par
Mis à jour : Novembre 2019
Langue : français
Type : Video
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
-
Un test - mauritanie
3 avril 2014, par
Mis à jour : Avril 2014
Langue : français
Type : Textuel
-
Pourquoi Obama lit il mes mails ?
4 février 2014, par
Mis à jour : Février 2014
Langue : français
-
IMG 0222
6 octobre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Image
Autres articles (42)
-
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 (...) -
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 -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;
Sur d’autres sites (6775)
-
error when I try to seek on a streaming with ffmpeg and flask
29 juillet 2021, par Martin Oller ExpositoI want to get a seekable stream from a google drive file but
When calling 127.0.0.1:500/, it works and it returns the video stream but it does not show me the duration of the video nor does it allow me to advance or rewind it




I have also done tests using an html player and it gives me an error in the content length and it seems that after 8 seconds it starts to upload the duration of the file up to 10 seconds (the total duration of the file is 10s)




import threading
from flask import Flask, request
from flask.helpers import stream_with_context
import requests
import subprocess
from requests import Response

from flask import request, make_response, Response, stream_with_context, send_file



app = Flask(__name__)

@app.route('/<id>')
def index(id):
 
 range = request.headers.get('Range')
 
 
 token = "ya29.a0ARrdaM8vW_pKmGhIRleJiZ9fuoprk2-zS0bgJPaslD3V4idJ6wK52_iwJE8MOYnj7kCOWl5m2oHlEWc3LEWcPt5-b4nemoC7SKy7l-4QO1DviJnPBfVeHruAU27I_UE3gMPRV4H-Tk1ZLrNp56UfxyR-ObAx"

 headers = {
 "Authorization":"Bearer "+token
 }
 if (range != None):
 headers = {
 "Authorization": "Bearer " + token,
 "Range":range
 }

 url = "https://www.googleapis.com/drive/v3/files/"+id+"?alt=media"
 r = requests.get(url, headers=headers, stream=True)
 
 
 def getVideoStreaming():
 for chunck in r.iter_content(1024):
 if chunck:
 process.stdin.write(chunck)
 process.stdin.close()

 thread = threading.Thread(target=getVideoStreaming)
 


 command = ("ffmpeg","-i", "-","-y","-vcodec","copy","-movflags", "frag_keyframe+empty_moov","-f","mp4","pipe:1")
 process = subprocess.Popen(command,shell=True,stdout = subprocess.PIPE,stdin=subprocess.PIPE)

 thread.start()
 
 
 def readingFfmpeg():
 
 for data in iter(process.stdout.readline, b''):
 if not data:
 break
 yield data
 
 
 
 response = Response(stream_with_context(readingFfmpeg()),mimetype=r.headers.get('Content-Type'))
 
 response.headers.set('Content-Range',r.headers.get('Content-Range'))
 response.headers.set('Cache-Control', r.headers.get('Cache-Control'))
 response.headers.set('Content-Length', r.headers.get('Content-Length'))
 
 
 
 if(range != None):
 return response,200
 else:
 return response,206
 
</id>


-
hls.js unable to maintain seek with live video [only] stream
15 décembre 2024, par RobI am encoding a live 25 FPS 950x540 H.264 video-only stream using the latest (built from source) FFmpeg, 10 segments in the manifest, each of 5 seconds, and consuming that stream on another machine on my local LAN in [incognito to avoid cache issues] Chrome with the latest
hls.js
(cdn.jsdelivr.net/npm/hls.js@latest). The encoded video plays but not reliably ; I have two problems :

- 

- When the stream is running, the
hls.js
client starts to be unable to sync with the video stream after a few minutes, complaining of being beyond the end of the sync window and, on re-sync, getting empty buffers. - The
hls.js
client will not sync to the stream unless I start the stream and the client at the same time : if thehls.js
client tries to use the stream a few 10's of seconds after it has started it again fails to sync with the stream. The only way I can start the stream successfully is if the.m3u8
file is deleted first, so the browser cannot find the file, then the client reads the file and begins streaming. Chrome's F12 window says things like "[stream-controller] : Playback : 0.000 is located too far from the end of live sliding playlist : 49.92, reset currentTime to : 44.920", which might be expected but then more mysteriously says "[abr] buffer is empty, optimal quality level 0", something which definitely doesn't happen in the succese case.






Obviously I have something fundamentally wrong, I just can't figure out what. My HLS flags to FFmpeg are
discont_start
andomit_endlist
and the client has been directed not to cache. Here is a sample.m3u8
output file :

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:5
#EXT-X-MEDIA-SEQUENCE:30
#EXTINF:5.120000,
http://10.10.1.16/watchdog30.ts
#EXTINF:4.880000,
http://10.10.1.16/watchdog31.ts
#EXTINF:5.120000,
http://10.10.1.16/watchdog32.ts
#EXTINF:4.880000,
http://10.10.1.16/watchdog33.ts
#EXTINF:5.120000,
http://10.10.1.16/watchdog34.ts
#EXTINF:4.880000,
http://10.10.1.16/watchdog35.ts
#EXTINF:5.120000,
http://10.10.1.16/watchdog36.ts
#EXTINF:4.880000,
http://10.10.1.16/watchdog37.ts
#EXTINF:5.120000,
http://10.10.1.16/watchdog38.ts
#EXTINF:4.880000,
http://10.10.1.16/watchdog39.ts



I've tried also adding the flags
independent_segments
and inclusion ofprogram_date_time
, which have not helped.

What have I missed ?


My full code (FFMpeg is driven at its C API) can be found here : https://github.com/RobMeades/watchdog/blob/83e718390f779a7ef98d2be009784e8be5deaf5f/software/watchdog.cpp#L933. This code is running on a Raspberry Pi 5 under Raspbian latest.


- When the stream is running, the
-
FFMPEG : Encoding WEBM with fast-seek and copyts leads to wrong video lenght
1er février 2020, par TheOverlord2DI’m trying to convert a scene from a soft-subbed MKV file into a hard-subbed WEBM file with two-pass. The video encodes fine, but the file shows the wrong length when opened on a media player (it’s showing as if I had encoded the original file from the starting point all the way to the end).
This is the command I’m using :
set timestamp=-ss 12:59.069 -to 16:14.277
ffmpeg -y %timestamp% -copyts -i source.mkv -shortest -c:v libvpx-vp9 -pass 1 -b:v 0 -crf 33 -threads 8 -speed 4 -tile-columns 6 -frame-parallel 1 -an -sn -vf scale=-1:720,subtitles=source.mkv -f webm NUL
ffmpeg -y %timestamp% -copyts -i source.mkv -shortest -c:v libvpx-vp9 -pass 2 -b:v 0 -crf 33 -threads 8 -speed 2 -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 -c:a libopus -b:a 64k -sn -vf scale=-1:720,subtitles=source.mkv -f webm out.webmWhen opening the video in MPC-BE, the video plays regularly until around the point shown on https://i.stack.imgur.com/6bRwc.png (which is where the scene I wanted to cut out ends) then it just skips to the end of the file, and this wrong length is giving me all sorts of issues when I try to use the encoded video.