
Recherche avancée
Autres articles (26)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users.
Sur d’autres sites (4709)
-
Why every audio part is louder in FFmpeg when I join them in one audio ?
14 mai 2024, par Volodymyr BilovusI trying to make dubbing for audio. I have original audio track and I want to put translated audio parts on top of the original.


translated audio 100% vol : —p1--- ---p2— -----p3--- —p4—


original audio 5% vol : -----------------------------------------


Here is my FFmpeg command with filter_complex


ffmpeg -i video_wpmXlZF4XiE.opus -i 989-audio.mp3 -i 989-audio.mp3 -i 989-audio.mp3 -i 989-audio.mp3 \
-filter_complex "\
[0:a]loudnorm=I=-14:TP=-2:LRA=7, volume=0.05[original]; \
[1:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=5000|5000, volume=1.0[sent1]; \
[2:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=10000|10000, volume=1.0[sent2]; \
[3:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=20000|20000, volume=1.0[sent3]; \
[4:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=30000|30000, volume=1.0[sent4]; \
[original][sent1][sent2][sent3][sent4]amix=inputs=5:duration=longest[out]" \
-map "[out]" output.mp3



Audios I put on top of the original audio track is the same
-i 989-audio.mp3
I made it by purpose to show the problem
And here is the audio levels on final generated track.


As you can see, first and second only slightly different but third
and fourth have totally different(higher) volume level (Notice, audio is the same).
Why it's happened ? And how can I workaround this odd behaviour ?


-
C# server problem with FFmpeg Visual Studio 2022
16 mai 2024, par seanofdeadHello everyone I've spent countless hours on my server I'm trying to create that will share video from one stream to another client computer. That is the goal anyway. I'm using Visual Studio 2022 most recent update. Currently this is my code


using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
using FFmpeg.AutoGen;
using NLog;

public class VideoStreamServer
{
 private const int Port = 5000;
 private TcpListener server;
 private FFmpegVideoEncoder encoder;
 private static readonly Logger logger = LogManager.GetCurrentClassLogger();

 public VideoStreamServer()
 {
 // Initialize FFmpeg network components
 Console.WriteLine("Initializing FFmpeg network components...");
 int result = ffmpeg.avformat_network_init();
 if (result != 0)
 {
 throw new ApplicationException($"Failed to initialize FFmpeg network components: {result}");
 }

 // Initialize encoder
 encoder = new FFmpegVideoEncoder(1920, 1080, AVCodecID.AV_CODEC_ID_H264); // Screen size & codec
 }

 public static void Main()
 {
 // Initialize NLog
 var logger = LogManager.GetCurrentClassLogger();
 logger.Info("Application started");

 var server = new VideoStreamServer();
 server.Start().Wait();
 }

 public async Task Start()
 {
 server = new TcpListener(IPAddress.Any, Port);
 server.Start();
 logger.Info($"Server started on port {Port}...");

 try
 {
 while (true)
 {
 TcpClient client = await server.AcceptTcpClientAsync();
 logger.Info("Client connected...");
 _ = HandleClientAsync(client);
 }
 }
 catch (Exception ex)
 {
 logger.Error(ex, "An error occurred");
 }
 }

 private async Task HandleClientAsync(TcpClient client)
 {
 using (client)
 using (NetworkStream netStream = client.GetStream())
 {
 try
 {
 await encoder.StreamEncodedVideoAsync(netStream);
 }
 catch (IOException ex)
 {
 logger.Error(ex, $"Network error: {ex.Message}");
 // Additional logging and recovery actions
 }
 catch (Exception ex)
 {
 logger.Error(ex, $"Unexpected error: {ex.Message}");
 // Log and handle other exceptions
 }
 finally
 {
 // Ensure all resources are cleaned up properly
 client.Close();
 logger.Info("Client connection closed properly.");
 }
 }
 }
}

public class FFmpegVideoEncoder
{
 private readonly int width;
 private readonly int height;
 private readonly AVCodecID codecId;
 private static readonly Logger logger = LogManager.GetCurrentClassLogger();

 public FFmpegVideoEncoder(int width, int height, AVCodecID codecId)
 {
 this.width = width;
 this.height = height;
 this.codecId = codecId;
 InitializeEncoder();
 }

 private void InitializeEncoder()
 {
 // Initialize FFmpeg encoder here
 logger.Debug("FFmpeg encoder initialized");
 }

 public async Task StreamEncodedVideoAsync(NetworkStream netStream)
 {
 // Initialize reusable buffers for efficiency
 byte[] buffer = new byte[4096];

 // Capture and encode video frames
 while (true)
 {
 try
 {
 // Simulate capture and encoding
 byte[] videoData = new byte[1024]; // This would come from the encoder

 // Simulate streaming
 for (int i = 0; i < videoData.Length; i += buffer.Length)
 {
 int chunkSize = Math.Min(buffer.Length, videoData.Length - i);
 Buffer.BlockCopy(videoData, i, buffer, 0, chunkSize);
 await netStream.WriteAsync(buffer, 0, chunkSize);
 }
 }
 catch (Exception ex)
 {
 logger.Error(ex, "Error streaming video data");
 throw; // Rethrow to handle in the calling function
 }

 await Task.Delay(1000 / 30); // For 30 FPS
 }
 }
}



When I build no issues but when i run it in debug mode I get this error


System.DllNotFoundException
 HResult=0x80131524
 Message=Unable to load DLL 'avformat.59 under C:\Users\phlfo\Downloads\cfolder\server\ConsoleApp\bin\Debug\': The specified module could not be found.
 Source=FFmpeg.AutoGen
 StackTrace:
 at FFmpeg.AutoGen.ffmpeg.LoadLibrary(String libraryName, Boolean throwException)
 at FFmpeg.AutoGen.ffmpeg.<>c.<.cctor>b__7_0(String libraryName)
 at FFmpeg.AutoGen.ffmpeg.<>c.<.cctor>b__7_242()
 at FFmpeg.AutoGen.ffmpeg.avformat_network_init()
 at VideoStreamServer..ctor() in C:\Users\phlfo\Downloads\cfolder\server\ConsoleApp\Program.cs:line 20
 at VideoStreamServer.Main() in C:\Users\phlfo\Downloads\cfolder\server\ConsoleApp\Program.cs:line 36



I have FFmpeg.AutoGen package installed through VS i originally started with 7.0 but then switched to 5.0 to see if an older version might work (it did not). I also have the files in the same directory as the .exe for testing purposes as seen in the screenshot. Can someone please help me figure out this error.



-
Could not find ffmpeg executable, tried "/srv/linux-x64/ffmpeg"
20 mai 2024, par AlanI am trying to run my docker image on AWS EC2 Instance. However, I am having a trouble with the image file. When I run a task in AWS ECS, it says :


Could not find ffmpeg executable, tried "/srv/linux-x64/ffmpeg", "/srv/app/node_modules/@ffmpeg-installer/linux-x64/ffmpeg" and "/srv/app/node_modules/@ffmpeg-installer/linux-x64/ffmpeg"



This is my Dockerfile :


FROM node:latest as server
WORKDIR /srv/app
COPY ./server/package*.json ./
RUN apt-get update && apt-get install -y 'ffmpeg'
RUN npm install
COPY ./server .
RUN npm run build

FROM node:latest as client
WORKDIR /srv/app
COPY ./client/package*.json ./
RUN npm install
COPY ./client .
RUN npm run build

FROM node:latest as production
WORKDIR /srv/app
RUN mkdir /public
COPY --from=server /srv/app/dist ./
COPY --from=client /srv/app/dist ./public
ENV NODE_ENV=production
EXPOSE 5000
CMD ["node", "app.js"]



This is my package.json :


},
 "keywords": [],
 "author": "",
 "license": "ISC",
 "dependencies": {
 "@ffmpeg-installer/ffmpeg": "^1.1.0",
 "@types/ffmpeg": "^1.0.7",
 "@types/fluent-ffmpeg": "^2.1.24"
 }



This is how I used ffmpeg in my code :


import ffmpegPath from '@ffmpeg-installer/ffmpeg';
import ffmpeg from 'fluent-ffmpeg';
ffmpeg.setFfmpegPath(ffmpegPath.path);



Please help me fix this error.