
Recherche avancée
Autres articles (86)
-
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 (...) -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)
Sur d’autres sites (5129)
-
Revision 8abd92f12f : Remove mode_skip_start and mask code for sub 8x8 This code serves no purpose in
4 octobre 2013, par Paul WilkinsChanged Paths :
Modify /vp9/encoder/vp9_rdopt.c
Remove mode_skip_start and mask code for sub 8x8This code serves no purpose in the re-factored sub 8x8 code.
Change-Id : I5364986224d1a28b71bcb046ec8557a3d14aaa47
-
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


-
I am streaming mp3 music via ffmpeg to a local rtmp server then converting to hls, but am having difficulties end to end testing
12 avril 2020, par SquirrelSenpaiI am streaming mp3 music via ffmpeg to a local rtmp server then converting to hls, but am having difficulties end to end testing. I am know test.m3u8 playlist should be produce, however I am unable to check inside /nginx/hls/ as it is locked by www-data during operation. I have tried multiple permutation of what I thought the output hls stream would be in vlc with no luck. localhost:8080/live/test.m3u8, localhost:8080/hls/test.m3u8



Any tips on effective testing would be much appreciated.



Technologies involved :



- 

- FFMPEG
- NGINX (This and the below 3 are part of a module)
- HLS
- RTMP











Working :



ffmpeg -hide_banner -i http://149.255.59.164:8138 -f mp3 test.mp3




Seemingly working, correctly reads files, shows conversion of some kind

size= 362kB time=00:00:23.09 bitrate= 128.3kbits/s speed=3.21x


fmpeg -hide_banner -i http://x.x.x.x:8138 -f mp3 rtmp://localhost:1935/live/test




Nginx.conf



user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
 worker_connections 768;
 # multi_accept on;
}

rtmp_auto_push on;

rtmp{

 server{

 listen 1935;

 chunk_size 4000;

 #one publisher, many subscribers

 application live {

 # enable live streaming
 live on;
 record off;

 # publish only from localhost
 allow publish 127.0.0.1;
 deny publish all;

 # hls - required for web browser consumption
 hls on;
 hls_path /tmp/hls;
 hls_fragment 3;
 hls_playlist_length 60;

 # disable consuming the streaming from nginx as rtmp
 deny play all;

 }

 }

}

# HTTP can be used for accessing RTMP stats
http {

 server {

 listen 8080;

 # This URL provides RTMP statistics in XML
 location /stat {
 rtmp_stat all;

 # Use this stylesheet to view XML as web page
 # in browser
 rtmp_stat_stylesheet stat.xsl;
 }

 location /stat.xsl {
 # XML stylesheet to view RTMP stats.
 # Copy stat.xsl wherever you want
 # and put the full directory path here
 root /path/to/stat.xsl/;
 }

 location /hls {
 # Serve HLS fragments
 types {
 application/vnd.apple.mpegurl m3u8;
 video/mp2t ts;
 }
 root /tmp;
 add_header Cache-Control no-cache;
 }

 location /dash {
 # Serve DASH fragments
 root /tmp;
 add_header Cache-Control no-cache;
 }
 }
}