
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (48)
-
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 -
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 -
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 (8410)
-
High pitched audio or no audio at all when converting AVI video to MP4 with FFmpeg [closed]
15 août 2023, par Karen SI'm pretty new to FFmpeg and I'm having trouble converting a video from AVI format to MP4. I'm trying to convert pcm_s16le to aac. No matter what audio stream I use, the resulting audio in the MP4 file is either very high pitched and choppy (stream 1) or the audio stream is silent (stream 2).


The AVI video has two audio streams :


Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream #0:2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s



In VLC Media Player the video plays fine and it uses the second audio stream.


When I run
ffmpeg -i input.avi -vcodec libx264 -crf 27 output.mp4
in my terminal, the output audio in the MP4 file is very high pitched and choppy in VLC.
This is the codec information for the audio stream in VLC after the conversion :

Codec: MPEG AAC Audio (mp4a)
Type: Audio
Channels: Stereo
Sample rate: 48000 Hz
Bits per sample: 32



When I specify the audio stream and codec the resulting video is silent.


ffmpeg -i input.avi -map 0:v:0 -vcodec libx264 -crf 29 -map 0:a:1 -acodec aac output.mp4



This is the terminal output from FFmpeg :


FILEPATH -i "input.avi" -map 0:v:0 -vcodec libx264 -crf 29 -map 0:a:1 -acodec aac "output.mp4"
ffmpeg version 2023-06-11-git-09621fd7d9-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 --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-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --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. 13.100 / 58. 13.100
 libavcodec 60. 17.100 / 60. 17.100
 libavformat 60. 6.100 / 60. 6.100
 libavdevice 60. 2.100 / 60. 2.100
 libavfilter 9. 8.101 / 9. 8.101
 libswscale 7. 3.100 / 7. 3.100
 libswresample 4. 11.100 / 4. 11.100
 libpostproc 57. 2.100 / 57. 2.100
[avi @ 000002533665a400] Switching to NI mode, due to poor interleaving
Input #0, avi, from 'input.avi':
 Duration: 00:10:40.64, start: 0.000000, bitrate: 28852 kb/s
 Stream #0:0: Video: dvvideo, yuv411p, 720x480 [SAR 32:27 DAR 16:9], 25000 kb/s, SAR 8:9 DAR 4:3, 60k fps, 29.97 tbr, 60k tbn
 Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
 Stream #0:2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
File 'output.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
 Stream #0:0 -> #0:0 (dvvideo (native) -> h264 (libx264))
 Stream #0:2 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 00000253366702c0] using SAR=8/9
[libx264 @ 00000253366702c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000253366702c0] profile High 4:2:2, level 3.0, 4:2:2, 8-bit
[libx264 @ 00000253366702c0] 264 - core 164 r3107 a8b68eb - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=29.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
 Metadata:
 encoder : Lavf60.6.100
 Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv422p(tv, bottom coded first (swapped)), 720x480 [SAR 8:9 DAR 4:3], q=2-31, 29.97 fps, 30k tbn
 Metadata:
 encoder : Lavc60.17.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
 Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, stereo, fltp, 128 kb/s
 Metadata:
 encoder : Lavc60.17.100 aac
[dvvideo @ 000002533879d780] Concealing bitstream errors.41 bitrate= 901.6kbits/s speed=2.01x
 Last message repeated 76 times
[dvvideo @ 000002533878f640] Concealing bitstream errors.43 bitrate= 925.1kbits/s speed=1.97x
 Last message repeated 19 times
[out#0/mp4 @ 00000253366770c0] video:72743kB audio:119kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.649282%
frame=19200 fps= 58 q=-1.0 Lsize= 73335kB time=00:10:40.61 bitrate= 937.8kbits/s speed=1.92x
[libx264 @ 00000253366702c0] frame I:99 Avg QP:28.84 size: 35252
[libx264 @ 00000253366702c0] frame P:4922 Avg QP:31.82 size: 9208
[libx264 @ 00000253366702c0] frame B:14179 Avg QP:36.03 size: 1811
[libx264 @ 00000253366702c0] consecutive B-frames: 1.2% 0.8% 1.1% 97.0%
[libx264 @ 00000253366702c0] mb I I16..4: 13.7% 74.6% 11.7%
[libx264 @ 00000253366702c0] mb P I16..4: 1.7% 6.7% 1.1% P16..4: 38.6% 13.2% 9.3% 0.0% 0.0% skip:29.3%
[libx264 @ 00000253366702c0] mb B I16..4: 0.2% 0.5% 0.0% B16..8: 37.3% 2.8% 0.7% direct: 2.1% skip:56.3% L0:42.5% L1:52.2% BI: 5.3%
[libx264 @ 00000253366702c0] 8x8 transform intra:69.6% inter:71.7%
[libx264 @ 00000253366702c0] coded y,uvDC,uvAC intra: 65.4% 59.0% 8.7% inter: 12.9% 7.0% 0.1%
[libx264 @ 00000253366702c0] i16 v,h,dc,p: 12% 64% 7% 16%
[libx264 @ 00000253366702c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 26% 26% 5% 6% 5% 8% 5% 8%
[libx264 @ 00000253366702c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 48% 15% 4% 5% 4% 7% 3% 5%
[libx264 @ 00000253366702c0] i8c dc,h,v,p: 61% 19% 16% 4%
[libx264 @ 00000253366702c0] Weighted P-Frames: Y:3.5% UV:1.3%
[libx264 @ 00000253366702c0] ref P L0: 55.4% 15.5% 20.6% 8.2% 0.3%
[libx264 @ 00000253366702c0] ref B L0: 89.3% 8.2% 2.5%
[libx264 @ 00000253366702c0] ref B L1: 95.5% 4.5%
[libx264 @ 00000253366702c0] kb/s:930.17
[aac @ 00000253382c31c0] Qavg: 65536.000



Could someone point me in the right direction please ? I've tried doing the conversion with Handbrake as well and the audio is still choppy.


-
FFMPEG on AWS Lambda Only outputs half a second of video when converting video from mobile safari
18 août 2023, par user1825257I am running FFMPEG on AWS Lambda using nodejs and fluent-ffmpeg. I am able to convert videos recorded on most devices / browsers, but when I attempt to convert videos recorded on Mobile Safari, the length of the output video is 1/2 a second regardless of the input length.


My Typescript code is :


import * as ffmpeg from 'fluent-ffmpeg';
 public static StandardizeVideoFormat(
 inputSignedUrl: string,
 filename: string,
 ): Promise<string> {
 const localFilePath = `/tmp/${Date.now()}_${filename}.mp4`;
 
 return new Promise((resolve, reject) => {
 ffmpeg(inputSignedUrl)
 .outputOptions([
 '-crf',
 '18',
 '-vcodec',
 'libx264',
 '-codec:a',
 'aac',
 '-preset',
 'medium',
 ])
 .output(localFilePath)
 .on('start', function (commandLine) {
 console.log('Spawned Ffmpeg with command: ' + commandLine);
 })
 .on('error', function (err) {
 reject(err);
 })
 .on('progress', function (progress) {
 console.log('progress', progress);
 })
 .on('end', function () {
 resolve(localFilePath);
 })
 .run();
 });
 }
</string>


Using FFprobe, The metadata of the input file is :


{
 streams: [
 {
 index: 0,
 codec_name: 'h264',
 codec_long_name: 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10',
 profile: 'Baseline',
 codec_type: 'video',
 codec_tag_string: 'avc1',
 codec_tag: '0x31637661',
 width: 1920,
 height: 1080,
 coded_width: 1920,
 coded_height: 1080,
 closed_captions: 0,
 film_grain: 0,
 has_b_frames: 0,
 sample_aspect_ratio: 'N/A',
 display_aspect_ratio: 'N/A',
 pix_fmt: 'yuvj420p',
 level: 40,
 color_range: 'pc',
 color_space: 'unknown',
 color_transfer: 'unknown',
 color_primaries: 'unknown',
 chroma_location: 'left',
 field_order: 'progressive',
 refs: 1,
 is_avc: 'true',
 nal_length_size: 4,
 id: '0x1',
 r_frame_rate: '30000/1001',
 avg_frame_rate: '60000/1991',
 time_base: '1/600',
 start_pts: 26,
 start_time: 0.043333,
 duration_ts: 4008,
 duration: 6.68,
 bit_rate: 10175170,
 max_bit_rate: 'N/A',
 bits_per_raw_sample: 8,
 nb_frames: 'N/A',
 nb_read_frames: 'N/A',
 nb_read_packets: 'N/A',
 extradata_size: 31,
 side_data_type: 'Display Matrix',
 displaymatrix: '',
 rotation: '-90',
 tags: [Object],
 disposition: [Object]
 },
 {
 index: 1,
 codec_name: 'aac',
 codec_long_name: 'AAC (Advanced Audio Coding)',
 profile: 'LC',
 codec_type: 'audio',
 codec_tag_string: 'mp4a',
 codec_tag: '0x6134706d',
 sample_fmt: 'fltp',
 sample_rate: 48000,
 channels: 1,
 channel_layout: 'mono',
 bits_per_sample: 0,
 initial_padding: 0,
 id: '0x2',
 r_frame_rate: '0/0',
 avg_frame_rate: '0/0',
 time_base: '1/48000',
 start_pts: 0,
 start_time: 0,
 duration_ts: 319488,
 duration: 6.656,
 bit_rate: 181302,
 max_bit_rate: 'N/A',
 bits_per_raw_sample: 'N/A',
 nb_frames: 'N/A',
 nb_read_frames: 'N/A',
 nb_read_packets: 'N/A',
 extradata_size: 2,
 tags: [Object],
 disposition: [Object]
 }
 ],
 format: {
 filename: 'input.mp4',
 nb_streams: 2,
 nb_programs: 0,
 format_name: 'mov,mp4,m4a,3gp,3g2,mj2',
 format_long_name: 'QuickTime / MOV',
 start_time: 0,
 duration: 6.723333,
 size: 8651792,
 bit_rate: 10294646,
 probe_score: 100,
 tags: {
 major_brand: 'iso5',
 minor_version: '1',
 compatible_brands: 'isomiso5hlsf',
 creation_time: '2023-08-05T19:03:15.000000Z'
 }
 },
 chapters: []
}



Any ideas on why the output of my command on this file always results in a 0.5 second long output ?


-
How to resolve Electron ffmpeg error opening input file ?
26 août 2023, par 3V1LXDI have an Electron app with
ffmpeg.exe
inside the project'sbin
folder. When i try to use ffmpeg to make a new video I get an error reading the input file.

FFmpeg error: [in#0 @ 000002667f2ab9c0] Error opening input: No such file or directory

Error opening input file C:/Users/xxxx/Videos/Powder/2023.08.19%2017.30.37_Apex_Legends/Powder_2023.08.19%2021.00.48.mp4



const ffmpeg = spawn(ffmpegPath, [
 '-i', videoFile,
 '-filter_complex', filterComplex,
 '-map', '[out]',
 '-c:v', 'libx264',
 '-crf', '18',
 '-preset', 'veryfast',
 '-y',
 path.join(outputDir, outputName)
]);

ffmpeg.stdout.on('data', (data) => {
 console.log(`FFmpeg output: ${data}`);
});

ffmpeg.stderr.on('data', (data) => {
 console.error(`FFmpeg error: ${data}`);
});

ffmpeg.on('close', (code) => {
 console.log(`FFmpeg process exited with code ${code}`);
 event.reply('ffmpeg-export-done'); // Notify the renderer process
});



How can i resolve this path issue ?