
Recherche avancée
Autres articles (53)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (7725)
-
FFMPEG merging audio and video to get resulting video
26 septembre 2016, par KingI need to merge audio and video using ffmpeg so that, it should result in a video with the same duration as of audio.
I have tried 2 commands for that requirement in my linux terminal. Both the commands work for a few of the input videos ; but for some other input_videos, they produce output same as the input video, the audio doesn’t get merged.
The commands, I have tried are -
ffmpeg -i wonders.mp4 -i Carefull.mp3 -c copy testvid.mp4
and
ffmpeg -i wonders.mp4 -i Carefull.mp3 -strict -2 testvid.mp4
and
ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac -strict
experimental output.mp4and these are my input videos -
- samplevid.mp4
duration - 28 seconds
size - 1.1 MB
status - working
And
- wonders.mp4
duration - 97 seconds
size - 96 MB
status - not working
I have observed that the large size (more than 2MB) of the input video is probably the issue.
But, still I want the fix.
-
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.


-
Re-encode a video keeping the GOP structure of the original video [closed]
5 avril, par Baltar27Is there a way to re-encode a video with ffmpeg keeping the GOP structure of the original file ? That is, if a frame is IDR, I, B or P in the input file, keep the same type in the output file, even if the GOP is variable and/or adaptive (it changes dynamically GOP type Open/Closed, the I period N or the P period M). Encoding in this way allows to maintain the maximum quality as the Open/Closed, I/B/P and GOP length decisions has been taken already by the original encoder.