
Recherche avancée
Autres articles (105)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
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 ;
Sur d’autres sites (9266)
-
Django StreamingHttpResponse : How to quit Popen process when client disconnects ?
2 avril 2022, par seriousm4xIn django, i want to convert a m3u8 playlist to mp4 and stream it to the client with ffmpeg pipe. The code works and the ffmpeg process also quits, but only when client waits till the end and received the whole file.


I want to quit the process when the client disconnects but the process keeps running forever.


I have this code :


import subprocess
from functools import partial
from django.http.response import StreamingHttpResponse
from django.shortcuts import get_object_or_404
from django.utils.text import slugify


def stream(request, uuid):
 vod = get_object_or_404(Vod, uuid=uuid)

 def iterator(proc):
 for data in iter(partial(proc.stdout.read, 4096), b""):
 if not data:
 proc.kill()
 yield data

 cmd = ["ffmpeg", "-i", "input.m3u8", "-c", "copy", "-bsf:a", "aac_adtstoasc", "-movflags", "frag_keyframe+empty_moov", "-f", "mp4", "-"]
 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
 response = StreamingHttpResponse(iterator(proc), content_type="video/mp4")
 response["Content-Disposition"] = f"attachment; filename={slugify(vod.date)}-{slugify(vod.title)}.mp4"
 return response




I've seen this answer but I'm not sure if I could use threading to solve my problem.


-
FFMPEG Implement RTSP Client, high speed playback
11 juillet 2021, par TTGroupI am writing software to play videos that have been recorded from NVR. I have completed most of the work, but there is one more feature that allows the user to change the play speed such as 0.5x, 2x, 4x, 8x ...


I searched the internet all day and still couldn't find any suggestions. Here is my summary code below.


auto pFormatCtx = avformat_alloc_context();

av_dict_set_int(&opts, "rw_timeout", 5000000, 0);
av_dict_set_int(&opts, "tcp_nodelay", 1, 0);
av_dict_set_int(&opts, "stimeout", 10000000, 0);
av_dict_set(&opts, "user_agent", "Mozilla/5.0", 0);
av_dict_set(&opts, "rtsp_transport", "tcp", 0);
av_dict_set(&opts, "rtsp_flags", "prefer_tcp", 0);
av_dict_set_int(&opts, "buffer_size", BUFSIZE, 0);

int err = avformat_open_input(&pFormatCtx, fullRtspUri, NULL, &opts);
if(err < 0)
 return;
 
err = avformat_find_stream_info(pFormatCtx, NULL);
if (err < 0)
 return;
pFormatCtx->flags |= AVFMT_FLAG_NONBLOCK;
pFormatCtx->flags |= AVFMT_FLAG_DISCARD_CORRUPT;
pFormatCtx->flags |= AVFMT_FLAG_NOBUFFER; 
av_dump_format(pFormatCtx, 0, fullRtspUri, 0);
 
int videoStreamInd = -1;
for (int i = 0; i < pFormatCtx->nb_streams; i++)
{
 AVStream* stream = pFormatCtx->streams[i];
 if (stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
 {
 if (videoStreamInd == -1)
 {
 videoStreamInd = i;
 break;
 }
 } 
}

if (videoStreamInd == -1)
 return; 
auto videoStream = pFormatCtx->streams[videoStreamInd];

isRunning = true;
while(isRunning)
{
 ret = av_read_frame(pFormatCtx, avPacket);
 if (ret < 0)
 return; 

 if (avPacket->stream_index != videoStreamInd)
 continue;
 
 //Code for render process here............
}



I have read through this NVR API documentation and see support for 2x, 4x speed play as below


Play in 2× Speed:
PLAY rtsp://10.17.133.46:554/ISAPI/streaming/tracks/101?starttime=20170313T230652Z&endtime=20170314T025706Z RTSP/1.0
CSeq:6
Authorization: Digest username="admin", 
realm="4419b66d2485", 
nonce="a0ecd9b1586ff9461f02f910035d0486", 
uri="rtsp://10.17.133.46:554/ISAPI/streaming/tracks/101?starttime=20170313T230652Z&endtime=20170314T025706Z", 
response="fb986d385a7d839052ec4f0b2b70c631"
Session:2049381566;timeout=60
Scale:2.000
User-Agent:NKPlayer-1.00.00.081112

RTSP/1.0 200 OK
CSeq: 6
Session: 2049381566
Scale: 2.000
RTP-Info: url=trackID=1;seq=1,url=trackID=2;seq=1
Date: Tue, Mar 14 2017 10:57:24 GMT



How to play RTSP video with speeds of 0.5x, 2x, 4x ...?
Everyone who can assist me in this case, I am very grateful.


-
Should a long Running video processing task to be done client side or server side
27 avril 2021, par Ritwiz SinhaI was creating an application in react for uploading video and using a REST API to send that to the server and store in S3. I also wanted the simple audio version of the video for some other tasks and I am confused as to what might be the better way :


- 

- Creating audio file on the fly when it is needed using node-ffmpeg package and not store it anywhere
- Start converting the video file to audio on the browser client only, and posting that to the server for storage along with the video.
- Just post the video to the server and use queue system for creating a new task for video conversion to audio and then save that to the S3 storage.
The second method seems to be saving some compute power on the server but it might be a problem if the video upload completes, audio conversion is still going on and the client disconnects.
Would appreciate some help, thanks.