
Recherche avancée
Autres articles (38)
-
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 -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (4782)
-
FFMPEG C++ API audio/video sync, video is longer [closed]
11 mai 2023, par Gábor GomborI create a video from frames in C++ with a given FPS and supply it to FFMPEG API. I record from an Unreal engine viewport and feed FFMPEG with the images. In this interval I have also an audio track in FLAC which I want sync with the video. When the music ends, I close the video and merge them, but the final video has sync problems, the video is a little bit longer than the audio, so I will have an increasing delay. For example I record 0:55 secs, the audio is ok=same length, but the video from frames will be 0:56 secs.


I think the following code is problematic :


bool MyVideoExporter::writeFrame(OutputStream* oStream, AVFrame* frame, int& framePTS)
{
 auto* packet = oStream->pkt->pkt;
 auto* codecContext = oStream->enc->codecContext;

 frame->pts = framePTS;
 frame->pkt_dts = frame->pts;

 auto ret = avcodec_send_frame(codecContext, frame);
 if (ret >= 0) {
 auto retVal = 0;
 while (retVal >= 0) {
 retVal = avcodec_receive_packet(codecContext, packet);
 if (retVal == AVERROR(EAGAIN) || retVal == AVERROR_EOF) break;
 else if (retVal < 0) {
 return false;
 }

 // rescale to audio, usually 1/44100
 av_packet_rescale_ts(packet, m_audiotimestamp, oStream->st->time_base);
 // rescale to FPS, usually 1/30 or 1/60
 av_packet_rescale_ts(packet, codecContext->time_base, oStream->st->time_base);

 packet->stream_index = oStream->st->index;

 retVal = av_interleaved_write_frame(m_avFormatContext.avFormatContext, packet);
 if (retVal < 0) {
 return false;
 }

 framePTS++;
 }

 return retVal == AVERROR_EOF;
 }

 return false;
}




Any idea what is wrong ?


I tried change the order of av_packet_rescale_ts lines or move the frame increase code to another places, but getting far worse results.


-
RMPT Stream Startup Dalay on FFMPEG and Gstreamer compared to OBS
24 mars 2023, par ArrudaI'm trying to use ffmpeg to stream a video into my RTMP server.
The problem I'm having right now is that FFMPEG seems to take a long time to start streaming the output (from what I see in my Oven Media Engine server).


At the same time, when I use OBS Studio my stream starts almost immediately.
I also tried using Gstreamer, and got the same amount of delay when using FFMPEG.


After a long process, I finally saw that if I added an empty audio track, then FFMPEG would start as quickly as OBS.


This is my final FFMPEG command (using the empty audio track) :


ffmpeg -f v4l2 -i /dev/video0 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -profile:v main -pix_fmt yuv420p -preset ultrafast -tune zerolatency -vcodec libx264 -r 10 -g 10 -keyint_min 10 -sc_threshold 0 -b:v 2000k -maxrate 2000k -bufsize 2000k -s 768x432 -acodec aac -f flv rtmp://localhost:1935/app/mystream



I'm streaming my webcam at 768x432, at 10FPS.


Now, is this a bad solution in the case where there is no need for an audio in the output video ?


There is no problem, nor noticible delay in the videstream if I remove the audio, the only downside is the startup time that is about 30-40 seconds.


Is this delay when not using a audio track a FFMPEG issue ? or is this related to how the Oven Media Engine ingest the RTMP stream ?


-
Need to install ffmpeg (non static) for my discord bot (node.js) hosted on Heroku
23 mars 2023, par febkosq8I host my Discord Bot on Heroku.


I was using the static ffmpeg buildpack by jonathanong until now.


Due to some issues with Discord-Player package that I use to play music, I will have to use non static version of ffmpeg (See Issue #1639 for more info).


I tried using the aptFile buildpack to install ffmpeg directly.
The build process takes place without any issues. See build log (Pastebin Logs).


But after deploy, I am not able to access ffmpeg.


I keep getting

ffmpeg: error while loading shared libraries: libusb-1.0.so.0: cannot open shared object file: No such file or directory
when i try to runffmpeg
throheroku run
command. The bot is also not able to pickup ffmpeg.



I am using heroku stack-20 because it was a workaround to the github issue mentioned earlier. The issue exists in stack-22 also.


Need help to figure out a solution for this problem or a way to install non static versions of ffmpeg