
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (105)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
D’autres logiciels intéressants
12 avril 2011, parOn ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
Videopress
Site Internet : (...) -
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 (...)
Sur d’autres sites (7756)
-
France rules Google Analytics non-compliant with GDPR
11 février 2022, par Erin — Privacy -
Streaming RTSP (AspNet 5 API, FFMPEG, Angular 10, videoJs)
27 octobre 2022, par MephistoDescription :


I have an API (ASP.Net 5) which connect to an IP Camera through RTSP. The camera send a h264 stream converted with ffmpeg as m3u8 stream which is returned to the angular client as follow :


public async Task<actionresult> GetCameraH264Stream()
{
 string deviceIp = "rtsp://[CAMERA_IP]/";
 string recordingUri = "rtsp://[USER:PASSWORD]@[CAMERA_IP]/axis-media/media.amp";
 
 string output = Path.Combine(Path.GetTempPath(), Guid.NewGuid() + ".m3u8");
 var mediaInfo = await FFmpeg.GetMediaInfo(recordingUri);

 var conversionResult = FFmpeg.Conversions.New()
 .AddStream(mediaInfo.Streams)
 .SetOutput(output)
 .Start();
 
 // Allow any Cors
 Response.Headers.Add("Access-Control-Allow-Origin", "*");
 Response.Headers.Add("Cache-Control", "no-cache");
 
 // Open the file, and read the stream to return to the client
 FileStreamResult result = new FileStreamResult(System.IO.File.Open(output, FileMode.Open, FileAccess.Read, FileShare.Read), "application/octet-stream");
 result.EnableRangeProcessing = true;
 return result;
}
</actionresult>


If I call this methods directly, the browser download a file, which I can read with VLC.


In my Angular app, I have this component :


app-vjs-player :


@Component({
 selector: 'app-vjs-player',
 template: '<video class="video-js" controls="controls" muted="muted" playsinline="playsinline" preload="none"> 
 </video>',
 encapsulation: ViewEncapsulation.None,
 })
export class VjsPlayerComponent implements OnInit, OnDestroy {
 @ViewChild('target', {static: true}) target: ElementRef;
 
 @Input() options: {
 fluid: boolean,
 aspectRatio: string,
 autoplay: boolean,
 sources: {
 src: string,
 type: string,
 }[],
 vhs: {
 overrideNative: true
 },
 };
 player: videojs.Player;

 constructor(
 private elementRef: ElementRef,
 ) { }

 ngOnInit() {
 // instantiate Video.js
 this.player = videojs(this.target.nativeElement, this.options, function onPlayerReady() {
 console.log('onPlayerReady', this);
 });
 
 }

 ngOnDestroy() {
 // destroy player
 if (this.player) {
 this.player.dispose();
 }
 }
}




This component is used like this :


TS :


playerOptions = {
 fluid: false,
 aspectRatio: "16:9",
 autoplay: false,
 sources: [{
 src: 'https://localhost:44311/api/GetCameraH264Stream',
 type: 'application/x-mpegURL',
 }],
}



HTML :






Problem


All this seems to work pretty well, until vjs throw this error when the api return the stream :




ERROR : (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded, either because the server or network failed or because the format is not supported




When I open the network dev tools, the request status is "Canceled", but I don't know if videojs cancel it because the filestreal can't be read, or if it is because of the way the API return the stream.


Any idea ?


Source


Forwarding RTSP stream from IP Camera to Browser in ASP.NET Core






EDIT


- 

- I tried to limit the resolution and the bitrate but I can't configure the camera like that, there is other application using it. The camera do not have any streaming url allowing this configuration
- I have been able to get an image from my code after changing the content type of the api response. I changed :






FileStreamResult result = new FileStreamResult(System.IO.File.Open(output, FileMode.Open, FileAccess.Read, FileShare.Read), "application/octet-stream");



to


FileStreamResult result = new FileStreamResult(System.IO.File.Open(output, FileMode.Open, FileAccess.Read, FileShare.Read), "application/x-mpegURL");



With this the first packet is displayed, but the next requests are still canceled.


-
I can't get my backend working with frontend in production but in local environment [duplicate]
3 août 2024, par YouareGrouseChrisThis is the frontend code :


import React, { useState } from 'react';
import axios from 'axios';
import fileDownload from 'js-file-download';

function HomePage() {
 const [url, setUrl] = useState('');
 const [filename, setFilename] = useState('');

 const handleSubmit = async (e) => {
 e.preventDefault();
 try {
 const response = await axios.post('https://api-lnp5.onrender.com/api/download', { url, filename }, { responseType: 'blob' });
 fileDownload(response.data, filename);
 console.log(response.data); // handle the response as needed
 } catch (error) {
 console.error(error);
 }
 };

 return (
 <div classname="flex flex-col items-center justify-center h-screen overflow-hidden">
 <h1 classname="text-3xl font-bold mb-6">Download Reddit video!!!</h1>
 <form classname="flex flex-col items-center">
 <label classname="mb-4">
 <div classname="text-lg mb-4 inline-block">Video URL:</div>
 <div>
 <input type="text" value="{url}" />> setUrl(e.target.value)} required 
 className="border px-3 py-2 rounded focus:outline-none focus:ring focus:border-blue-300 w-96"/>
 </div>
 </label>
 <label classname="mb-4">
 <div classname="text-lg mb-4 inline-block">Filename:</div>
 <div>
 <input type="text" value="{filename}" />> setFilename(e.target.value)} required 
 className="border px-3 py-2 rounded focus:outline-none focus:ring focus:border-blue-300 w-96"/>
 </div>
 </label>
 <button type="submit" classname="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">Download</button>
 </form>
 </div>
 );
}

export default HomePage;



This is the backend code using python fastapi :


from fastapi import FastAPI, HTTPException

from fastapi.responses import FileResponse
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
import requests
import json
import subprocess
import os

app = FastAPI()

origins = [
 "https://videodownload-frontend.onrender.com", # replace with the origin of your frontend
]

app.add_middleware(
 CORSMiddleware,
 allow_origins=["*"],
 allow_credentials=True,
 allow_methods=["*"],
 allow_headers=["*"],
)

class Video(BaseModel):
 url: str
 filename: str


def get_unique_filename(filename):
 counter = 1
 base_filename, extension = os.path.splitext(filename)
 unique_filename = filename

 while os.path.isfile(unique_filename):
 unique_filename = f"{base_filename}({counter}){extension}"
 counter += 1

 return unique_filename

@app.post("/api/download")
async def download_video(video: Video):
 url = video.url
 filename = get_unique_filename(video.filename)

 url += '.json'
 response = requests.get(url, headers={'User-agent': 'Mozilla/5.0'})

 if response.status_code != 200:
 raise HTTPException(status_code=404, detail="Video not found")

 json_response = json.loads(response.text)
 video_url = json_response[0]["data"]["children"][0]["data"]["secure_media"]["reddit_video"]["fallback_url"]
 audio_url = video_url.rsplit('/', 1)[0] + '/DASH_audio.mp4'

 video_response = requests.get(video_url, stream=True)
 audio_response = requests.get(audio_url, stream=True)

 with open('video_temp.mp4', 'wb') as f:
 for chunk in video_response.iter_content(chunk_size=1024 * 1024):
 if chunk:
 f.write(chunk)
 if audio_response.status_code == 200:
 with open('audio_temp.mp4', 'wb') as f:
 for chunk in audio_response.iter_content(chunk_size=1024 * 1024):
 if chunk:
 f.write(chunk)
 subprocess.run(['ffmpeg', '-i', 'video_temp.mp4', '-i', 'audio_temp.mp4', '-c', 'copy', filename])
 else:
 os.rename('video_temp.mp4', filename)

 return FileResponse(filename, media_type='application/octet-stream', filename=filename)



I deployed the fastapi by docker to Render. When I start the frontend development server, I could communicate with the backend without problems. But when I deployed both frontend and backend to Render, it shows always the CORS policy




Why is it ? if I could communicate with backend when starting local development server, it should be not related to backend.


This is URL to my frontend : https://videodownload-frontend.onrender.com/


Thank you !


I tried reconnect and restart the web service, also I tried to add CORS in fastapi. The api works fine with local server opened up. What should I do to debug ? thank you