
Recherche avancée
Médias (91)
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#1 The Wires
11 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
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 (11)
-
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)
Sur d’autres sites (3241)
-
ffmpeg library pcm to ac3 encoding
16 juillet 2014, par Dave CampI’m new to the ffmpeg library and Im working on a custom directshow filter. I decided to use the ffmpeg library for the encoding of what I need to achieve. I’m a little confused with some of the parameters and the correct values with what ffmpeg is expecting.
I’m currently working on the ac3 part of the custom filter.
I’ve looked through the example of the encoding audio ( for MP2 encoding ) in the ffmpeg doc and I understand it, but I don’t understand how I should adapt it to my specific needs.The incoming samples are at 48K samples per second 16bit per sample and are stereo interleaved. The upstream filter is giving them to me at 25fps so I get an incoming ’audio sample packet’ of 1920 bytes for each audio frame. I want to encode that data into an ac3 data packet that I pass on to the next process that I’ll be doing myself.
But I’m unsure of the correct parameters for each component in the following code...
The code I have so far. There are several questions in the comments at key places.
AVCodec* g_pCodec = nullptr;
AVCodecContext* g_pContext = nullptr;
AVFrame* g_pFrame = nullptr;
AVPacket g_pPacket;
LPVOID g_pInSampleBuffer;
avcodec_register_all();
g_pCodec = avcodec_find_encoder(CODEC_ID_AC3);
// What am I'm describing here? the incoming sample params or the outgoing sample params?
// An educated guess is the outgoing sample params
g_pContext = avcodec_alloc_context3(g_pCodec);
g_pContext->bit_rate = 448000;
g_pContext->sample_rate = 48000;
g_pContext->channels = 2;
g_pContext->sample_fmt = AV_SAMPLE_FMT_FLTP;
g_pContext->channel_layout = AV_CH_LAYOUT_STEREO;
// And this is the incoming sample params?
g_pFrame = av_frame_alloc();
g_pFrame->nb_samples = 1920; ?? What figure is the codec expecting me to give it here? 1920 / bytes_per_sample?
g_pFrame->format = AV_SAMPLE_FMT_S16;
g_pFrame->channel_layout = AV_CH_LAYOUT_STEREO;
// I assume this going to give me the size of a buffer that I use to fill with my incoming samples? I get a dwSize of 15360 but my samples are only coming in at 1920, does this matter?
dwSize = av_samples_get_buffer_size(nullptr,2,1920,AV_SAMPLE_FMT_S16,0);
// do I need to use av_malloc and copy my samples into g_pInSampleBuffer or can I supply the address of my own buffer ( created outside of the libav framework ) ?
g_pInSampleBuffer = (LPVOID)av_malloc(dwSize)
avcodec_fill_audio_frame(g_pFrame,2,AV_SAMPLE_FMT_S16,(const uint8_t*)g_pInSampleBuffer,*dwSize,0);
// Encoding loop - samples are given to me through a directshow interface - DSInbuffer is the buffer containing the incoming samples
av_init_packet(&g_pPacket);
g_pPacket.data = nullptr;
g_pPacket.size = 0;
int gotpacket = 0;
int ok = avcodec_encode_audio2(g_pContext,&g_pPacket,g_pFrame,&gotpacket);
if((ok == 0) && gotpacket){
// I then copy from g_pPacket.data an amount of g_pPacket.size bytes into another directshow interface buffer that sends the encoded sample downstream.
av_free_packet(&g_pPacket);
}Currently it will crash at the avcodec_encode_audio2 call. If I change the format parameter to AV_SAMPLE_FMT_FLTP in the avcodec_fill_audio_frame call then it doesnt crash but it only encodes 1 frame of data and i get error -22 on the next frame. The pPacket.size parameter is 1792 ( 7 * 256 ) after the first avcode_encode_audio2 call.
As I’m new to ffmpeg I’m sure it will probably be something quite straight forward that I’ve missed or I’m misunderstanding, and I’m confused at where the parameters for the incoming samples are and the outgoing samples.
This is obviously and extract from the main function that I’ve created, and I’ve manually typed into the forum. If there are spelling mistakes that are by mistake here, then original code compiles and runs.
Dave.
-
Cutting and rejoining videos causes audio de-synchronization using ffmpeg [closed]
10 décembre 2023, par DonotaloThis is the original post. I'm not getting any answer there so I thought may be the programming community knows the answer.


Main Post


I'm trying to cut a video into pieces and rejoin them using
ffmpeg
on Windows 11 x64. Here's the details offfmpeg
:

ffmpeg version 2023-11-22-git-0008e1c5d5-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads
--disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp
--enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt
--enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2
--enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d
--enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx
--enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi
--enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg
--enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc
--enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo
--enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt
--enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame
--enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb
--enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite
--enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 58. 32.100 / 58. 32.100
 libavcodec 60. 34.100 / 60. 34.100
 libavformat 60. 17.100 / 60. 17.100
 libavdevice 60. 4.100 / 60. 4.100
 libavfilter 9. 13.100 / 9. 13.100
 libswscale 7. 6.100 / 7. 6.100
 libswresample 4. 13.100 / 4. 13.100
 libpostproc 57. 4.100 / 57. 4.100



I've a video file in MKV format. I've cut it into 3 pieces using the following command :


ffmpeg.exe -ss 0:0:0 -i input.mkv -t 0:54:15 -c:v hevc_amf -b:v 3M -c:s mov_text seg-01.mp4
ffmpeg.exe -ss 0:54:29 -i input.mkv -t 0:35:35 -c:v hevc_amf -b:v 3M -c:s mov_text seg-02.mp4
ffmpeg.exe -ss 1:30:12 -i input.mkv -t 0:4:10 -c:v hevc_amf -b:v 3M -c:s mov_text seg-03.mp4



The audio is copied in all 3 pieces like original. Now I'm joining them using the following command :


ffmpeg.exe -y -f concat -safe 0 -i .\join.txt -c:v hevc_amf -c:a copy -c:s copy -fflags +genpts out.mp4



where,
join.txt
is :

file seg-01.mp4
file seg-02.mp4
file seg-03.mp4



ffmpeg
throws the following warning :

[mp4 @ 000002a5cf9cc040] Non-monotonic DTS in output stream 0:1; previous: 156240896, current: 156240084; changing to 156240897.
This may result in incorrect timestamps in the output file.
[mp4 @ 000002a5cf9cc040] Non-monotonic DTS in output stream 0:1; previous: 258720980, current: 258720462; changing to 258720981.
This may result in incorrect timestamps in the output file.



I've observed that audio is de-synchronized after the places where I cut.


How to keep audio, video and subtitle synchronized after cutting and rejoining the video using
ffmpeg
?

-
arm : vp9itxfm : Do a simpler half/quarter idct16/idct32 when possible
22 novembre 2016, par Martin Storsjöarm : vp9itxfm : Do a simpler half/quarter idct16/idct32 when possible
This work is sponsored by, and copyright, Google.
This avoids loading and calculating coefficients that we know will
be zero, and avoids filling the temp buffer with zeros in places
where we know the second pass won’t read.This gives a pretty substantial speedup for the smaller subpartitions.
The code size increases from 12388 bytes to 19784 bytes.
The idct16/32_end macros are moved above the individual functions ; the
instructions themselves are unchanged, but since new functions are added
at the same place where the code is moved from, the diff looks rather
messy.Before : Cortex A7 A8 A9 A53
vp9_inv_dct_dct_16x16_sub1_add_neon : 273.0 189.5 212.0 235.8
vp9_inv_dct_dct_16x16_sub2_add_neon : 2102.1 1521.7 1736.2 1265.8
vp9_inv_dct_dct_16x16_sub4_add_neon : 2104.5 1533.0 1736.6 1265.5
vp9_inv_dct_dct_16x16_sub8_add_neon : 2484.8 1828.7 2014.4 1506.5
vp9_inv_dct_dct_16x16_sub12_add_neon : 2851.2 2117.8 2294.8 1753.2
vp9_inv_dct_dct_16x16_sub16_add_neon : 3239.4 2408.3 2543.5 1994.9
vp9_inv_dct_dct_32x32_sub1_add_neon : 758.3 456.7 864.5 553.9
vp9_inv_dct_dct_32x32_sub2_add_neon : 10776.7 7949.8 8567.7 6819.7
vp9_inv_dct_dct_32x32_sub4_add_neon : 10865.6 8131.5 8589.6 6816.3
vp9_inv_dct_dct_32x32_sub8_add_neon : 12053.9 9271.3 9387.7 7564.0
vp9_inv_dct_dct_32x32_sub12_add_neon : 13328.3 10463.2 10217.0 8321.3
vp9_inv_dct_dct_32x32_sub16_add_neon : 14176.4 11509.5 11018.7 9062.3
vp9_inv_dct_dct_32x32_sub20_add_neon : 15301.5 12999.9 11855.1 9828.2
vp9_inv_dct_dct_32x32_sub24_add_neon : 16482.7 14931.5 12650.1 10575.0
vp9_inv_dct_dct_32x32_sub28_add_neon : 17589.5 15811.9 13482.8 11333.4
vp9_inv_dct_dct_32x32_sub32_add_neon : 18696.2 17049.2 14355.6 12089.7After :
vp9_inv_dct_dct_16x16_sub1_add_neon : 273.0 189.5 211.7 235.8
vp9_inv_dct_dct_16x16_sub2_add_neon : 1203.5 998.2 1035.3 763.0
vp9_inv_dct_dct_16x16_sub4_add_neon : 1203.5 998.1 1035.5 760.8
vp9_inv_dct_dct_16x16_sub8_add_neon : 1926.1 1610.6 1722.1 1271.7
vp9_inv_dct_dct_16x16_sub12_add_neon : 2873.2 2129.7 2285.1 1757.3
vp9_inv_dct_dct_16x16_sub16_add_neon : 3221.4 2520.3 2557.6 2002.1
vp9_inv_dct_dct_32x32_sub1_add_neon : 753.0 457.5 866.6 554.6
vp9_inv_dct_dct_32x32_sub2_add_neon : 7554.6 5652.4 6048.4 4920.2
vp9_inv_dct_dct_32x32_sub4_add_neon : 7549.9 5685.0 6046.9 4925.7
vp9_inv_dct_dct_32x32_sub8_add_neon : 8336.9 6704.5 6604.0 5478.0
vp9_inv_dct_dct_32x32_sub12_add_neon : 10914.0 9777.2 9240.4 7416.9
vp9_inv_dct_dct_32x32_sub16_add_neon : 11859.2 11223.3 9966.3 8095.1
vp9_inv_dct_dct_32x32_sub20_add_neon : 15237.1 13029.4 11838.3 9829.4
vp9_inv_dct_dct_32x32_sub24_add_neon : 16293.2 14379.8 12644.9 10572.0
vp9_inv_dct_dct_32x32_sub28_add_neon : 17424.3 15734.7 13473.0 11326.9
vp9_inv_dct_dct_32x32_sub32_add_neon : 18531.3 17457.0 14298.6 12080.0Signed-off-by : Martin Storsjö <martin@martin.st>