
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (15)
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
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 -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
Sur d’autres sites (3854)
-
ffmpeg Command in Docker with Rust Tokio Closes Warp Server Connection (curl 52 Error)
3 juin 2024, par user762345I’m encountering an issue where executing an ffmpeg concatenation command through Rust’s Tokio process in a Docker container causes subsequent HTTP requests to fail. The error occurs exclusively after running the ffmpeg command and making immediate requests, resulting in a “curl 52 empty response from server” error with the connection being closed. Notably, this issue does not occur when running the same setup outside of Docker. Additionally, if no HTTP requests are made after the ffmpeg command, the curl 52 error does not occur.


Here is the verbose curl output of my minimum reproducible example (see below).


curl -v "http://localhost:3030"
* Trying 127.0.0.1:3030...
* Connected to localhost (127.0.0.1) port 3030 (#0)
> GET / HTTP/1.1
> Host: localhost:3030
> User-Agent: curl/8.1.2
> Accept: */*
> 
* Empty reply from server
* Closing connection 0
curl: (52) Empty reply from server



Here are Docker logs from my minimum reproducible example (see below). The wav files are concatenated successfully, then the container appears to rebuild.


[2024-06-03T05:26:58Z INFO minimal_docker_webserver_post_error] Starting server on 0.0.0.0:3030
[2024-06-03T05:26:58Z INFO warp::server] Server::run; addr=0.0.0.0:3030
[2024-06-03T05:26:58Z INFO warp::server] listening on http://0.0.0.0:3030
[2024-06-03T05:27:07Z INFO minimal_docker_webserver_post_error] WAV files concatenated successfully
[Running 'cargo run']
 Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.06s
 Running `target/debug/minimal_docker_webserver_post_error`
[2024-06-03T05:27:08Z INFO minimal_docker_webserver_post_error] Starting server on 0.0.0.0:3030
[2024-06-03T05:27:08Z INFO warp::server] Server::run; addr=0.0.0.0:3030
[2024-06-03T05:27:08Z INFO warp::server] listening on http://0.0.0.0:3030



What I have tried :
I tried using different web frameworks (Warp, Actix-web) and request crates (reqwest, ureq). I also tried running the setup outside of Docker, which worked as expected without any issues. Additionally, I tried running the setup in Docker without making any HTTP requests after the ffmpeg command, and the connection closed successfully without errors. I also tried posting to httpbin with a minimal request, but the issue persisted.


Minimum reproducible example :


main.rs


use warp::Filter;
use reqwest::Client;
use std::convert::Infallible;
use log::{info, error};
use env_logger;
use tokio::process::Command;

#[tokio::main]
async fn main() {
 std::env::set_var("RUST_LOG", "debug");
 env_logger::init();

 let route = warp::path::end()
 .and_then(handle_request);

 info!("Starting server on 0.0.0.0:3030");
 warp::serve(route)
 .run(([0, 0, 0, 0], 3030))
 .await;
}

async fn handle_request() -> Result<impl infallible="infallible"> {
 let client = Client::new();

 let output = Command::new("ffmpeg")
 .args(&[
 "y",
 "-i", "concat:/usr/src/minimal_docker_webserver_post_error/file1.wav|/usr/src/minimal_docker_webserver_post_error/file2.wav",
 "-c", "copy",
 "/usr/src/minimal_docker_webserver_post_error/combined.wav"
 ])
 .output()
 .await;

 match output {
 Ok(output) => {
 if output.status.success() {
 info!("WAV files concatenated successfully");
 } else {
 error!("Failed to concatenate WAV files: {:?}", output);
 return Ok(warp::reply::with_status("Failed to concatenate WAV files", warp::http::StatusCode::INTERNAL_SERVER_ERROR));
 }
 },
 Err(e) => {
 error!("Failed to execute ffmpeg: {:?}", e);
 return Ok(warp::reply::with_status("Failed to execute ffmpeg", warp::http::StatusCode::INTERNAL_SERVER_ERROR));
 }
 }

 // ISSUE: Connection closes with curl: (52) Empty reply from server
 match client.get("https://httpbin.org/get").send().await {
 Ok(response) => info!("GET request successful: {:?}", response),
 Err(e) => error!("GET request failed: {:?}", e),
 }

 match client.post("https://httpbin.org/post")
 .body("field1=value1&field2=value2")
 .send().await {
 Ok(response) => info!("POST request successful: {:?}", response),
 Err(e) => error!("POST request failed: {:?}", e),
 }

 Ok(warp::reply::with_status("Request handled", warp::http::StatusCode::OK))
}
</impl>


FFMPEG command to generate the two wav files for concatenation


ffmpeg -f lavfi -i "sine=frequency=1000:duration=5" file1.wav && ffmpeg -f lavfi -i "sine=frequency=500:duration=5" file2.wav



Dockerfile


# Use the official Rust image as the base image
FROM rust:latest

# Install cargo-watch
RUN cargo install cargo-watch

# Install ffmpeg
RUN apt-get update && apt-get install -y ffmpeg

# Set the working directory inside the container
WORKDIR /usr/src/minimal_docker_webserver_post_error

# Copy the Cargo.toml and Cargo.lock files
COPY Cargo.toml Cargo.lock ./

# Copy the source code
COPY src ./src

# Copy wav files
COPY file1.wav /usr/src/minimal_docker_webserver_post_error/file1.wav
COPY file2.wav /usr/src/minimal_docker_webserver_post_error/file2.wav

# Install dependencies
RUN cargo build --release

# Expose the port that the application will run on
EXPOSE 3030

# Set the entry point to use cargo-watch
CMD ["cargo", "watch", "-x", "run"]



Cargo.toml


[package]
name = "minimal_docker_webserver_post_error"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
warp = "0.3"
reqwest = { version = "0.12.4", features = ["json"] }
tokio = { version = "1", features = ["full"] }
log = "0.4"
env_logger = "0.11.3"



Making the request to the warp server


curl -v "http://localhost:3030"



-
avcodec/h2645_parse : Ignore NAL with nuh_layer_id == 63
18 novembre 2024, par Michael Niedermayeravcodec/h2645_parse : Ignore NAL with nuh_layer_id == 63
Comply with "For purposes other than determining the amount of data in the decoding units
of the bitstream, decoders shall ignore all data that follow the value 63 for nuh_layer_id in a NAL unit"
Rec. ITU-T H.265 v8 (08/2021) Page 67Fixes : index 63 out of bounds for type 'const int8_t[63]' (aka 'const signed char[63]')
Fixes : clusterfuzz-testcase-fuzzer_loadfile-5109286752026624
Reported-by : Kacper Michajlow <kasper93@gmail.com>
Found-by : ossfuzz
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
FFmpegInteropX in Unity Hololens 2
25 juin 2024, par CocoaMilkaI'm building a UDP video stream decoder for the Hololens 2 in Unity 2021. I've compiled FFmpegInteropX for ARM64 UWP, however I'm having issues setting it up within Unity. With the binaries included in
/Plugins/WSA
I get the following error :

ArgumentException: The Assembly WinRT.Runtime is referenced by FFmpegInteropX.DotNet ('Assets/Plugins/WSA/FFmpegInteropX.DotNet/Release/FFmpegInteropX.DotNet.dll'). But the dll is not allowed to be included or could not be found.


I've wrapped all of my WinRT dependent code with the appropriate preprocessor directive as shown here, and I've also set all my plugins to target WSAPlayer and UWP.


#if ENABLE_WINMD_SUPPORT
using FFmpegInteropX;
using WinRT;
using Windows.Foundation;
using Windows.Media.Core;
using Windows.Media.Playback;
using System.Threading.Tasks;
#endif



If I include
WinRT.Runtime.dll
in the plugins folder, the issue spreads asking for more dependencies then the new dependencies (such asMicrosoft.Windows.SDK.NET.dll
) starts conflicting with the MRTK packages due to it also depending on WinRT.

How can I use this library within Unity without constantly running into dependency hell ?