
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (57)
-
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)
Sur d’autres sites (8232)
-
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.


-
FFMPEG How to insert short video and audio in longer video in specific time, size and position
24 novembre 2020, par Milos DimitrijevicFFMPEG How to insert short video (4sec) in longer video in specific time (from 15th to 19th second) and specific size. Long video is 1920x1080px and inserted video should be 1720x820px, positioned in the middle ?


file info..
Duration : 00:00:22.07, start : 0.000000, bitrate : 3982 kb/s
Stream #0:0(und) : Video : h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 3900 kb/s, 29 fps, 29 tbr, 14848 tbn, 58 tbc (default)
Metadata :
handler_name : VideoHandler
Stream #0:1(und) : Audio : aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata :
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'short.mp4' :
Metadata :
major_brand : mp42
minor_version : 19529854
compatible_brands : mp42isom
creation_time : 2020-10-25T11:01:10.000000Z
Duration : 00:00:03.02, start : 0.000000, bitrate : 14405 kb/s
Stream #1:0(eng) : Audio : aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 319 kb/s (default)
Metadata :
creation_time : 2020-10-25T11:01:10.000000Z
handler_name : Sound Media Handler
Stream #1:1(eng) : Video : h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 14078 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)
Metadata :
creation_time : 2020-10-25T11:01:10.000000Z
handler_name : Video Media Handler
encoder : AVC Coding


-
ffmpeg removing silence makes mp3 longer ?
13 août 2017, par pocketg99I’ve been using the following command to attempt to remove silent segments from an mp3 file
ffmpeg -i "podcasts/audio1.mp3" -af silenceremove=1:0:-50dB "/tmp/pod-sil.mp3"
For some reason the resulting mp3 is twice as log as the input mp3. It is not half as fast. There does not appear to be any duplicated audio. There is some silence, but not an hour’s worth. For a given portion of the input file, you can find the same thing in the output file by going to twice the timestamp of the input file.
The files are long so I have not yet listened to them all the way through. I really have no idea where the extra length is coming from, the files seem normal.
Here is the full output from ffmpeg
ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[mp3 @ 0x21880e0] Skipping 0 bytes of junk at 0.
[mp3 @ 0x21880e0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'podcasts/audio1.mp3':
Duration: 01:00:00.20, start: 0.000000, bitrate: 320 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
File '/tmp/pod-sil.mp3' already exists. Overwrite ? [y/N] y
Output #0, mp3, to '/tmp/pod-sil.mp3':
Metadata:
TSSE : Lavf56.40.101
Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, fltp
Metadata:
encoder : Lavc56.60.100 libmp3lame
Stream mapping:
Stream #0:0 -> #0:0 (mp3 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[libmp3lame @ 0x21999e0] Trying to remove 1152 samples, but the queue is empty
size= 56253kB time=01:00:00.16 bitrate= 128.0kbits/s
video:0kB audio:56253kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000439%