
Recherche avancée
Autres articles (85)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
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
Sur d’autres sites (11753)
-
ffmpeg yield different results when used in the application
5 mai 2020, par xoailThis is perplexing me. I am using ffmpeg to convert
m4a
towav
audio. When I use it with fluent-ffmpeg the output mime isaudio/wave
while when I do it using terminal I getaudio/wav
. For extactly same commands. The application I am trying to play these files is rejecting myaudio/wave
file.


Using node (results in audio/wave) :



const ffmpegPath = require('@ffmpeg-installer/ffmpeg')
const ffmpeg = require('fluent-ffmpeg');
ffmpeg()
.setFfmpegPath(ffmpegPath)
.input('source.m4a')
.outputOptions(['-ac 1','-ar 16000'])
.save('out.wav')




Using terminal (results in audio/wav) :



/same/path/to/static-ffmpeg-as-in-node-program/ffmpeg -i source.m4a -ac 1 -ar 16000 out.wav




I've both of their encoding as, PCM S16 LE (s16l), 16 bits/sample, mono and 16khz samplerate audio files. I've tried adding other flags and got same results on both scenarios :
-vn -acodec pcm_s16le -ar 16000 -ac 1 -f wav
. Just that one doesnt work. And I have no idea why.


I've also tried not using
fluent-ffmpeg
but usingspawn
and got sameaudio/wave
file.


Any insight ?


-
Strange results when converting rgb yuv using ffmpeg in python
20 avril 2020, par user3569998I have JPG images and I am trying to do the following :



- 

- resize the input and save the result into PNG
- convert PNG images to YUV (for instance yuv444p10le) in AVI container
- convert AVI back to PNG image.









I am using python 3 and ffmpeg Linux version installed on Colab



I printed the difference between resized_png and restored_png. I have values of 255 which doesn't make sense at all.



[[[ 0 255 1]
 [ 0 0 1]
 [ 0 255 1]
 ...
 [ 1 0 0]
 [ 1 0 0]
 [ 2 0 1]]

 [[ 0 255 1]
 [ 0 255 1]
 [ 1 0 0]
 ...
 [ 1 0 0]
 [ 1 0 0]
 [ 1 0 0]]

 [[ 0 0 1]
 [ 0 0 1]
 [ 0 0 1]
 ...
 [ 1 255 0]
 [ 1 255 1]
 [ 1 0 0]]

 ...

 [[255 0 0]
 [255 0 1]
 [255 0 1]
 ...
 [ 0 0 0]
 [ 0 0 1]
 [255 0 1]]

 [[255 0 1]
 [255 0 1]
 [255 0 1]
 ...
 [ 0 0 1]
 [ 0 0 1]
 [ 0 0 0]]

 [[255 0 1]
 [255 0 1]
 [255 0 1]
 ...
 [255 1 0]
 [255 0 0]
 [255 0 1]]]




input_image = '/content/drive/My Drive/Colab Notebooks/adv_dnn/datasets/im2.jpg'
output_resized = '/content/drive/My Drive/Colab Notebooks/adv_dnn/datasets/im2.png'
folder_path = '/content/drive/My Drive/Colab Notebooks/adv_dnn/datasets/'

#do resize
# code = subprocess.call('cd /usr/bin/ffmpeg', shell=True)
# print(code)
cmd_resize = ['ffmpeg', '-y', '-i', input_image,'-vf', 'scale=224:224', output_resized]
process = subprocess.Popen(cmd_resize, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = process.communicate()
print(out)
print(err)

fmt = ['yuv420p', 'yuv420p10le', 'yuv444p', 'yuv444p10le']
for f in fmt:
 cmd2YUV = ['ffmpeg', '-y', '-i', output_resized, '-c:v', 'libx264', '-preset', 'placebo',\
 '-qp', '0', '-x264-params', "keyint=15:no-deblock=1", '-pix_fmt', f, \
 '-sws_flags', 'spline+accurate_rnd+full_chroma_int', \
 '-vf', "colorspace=bt709:iall=bt601-6-625:fast=1", '-color_range', '1', '-colorspace', '1', 
 '-color_primaries', '1', '-color_trc', '1', folder_path+'im2_'+f+'.avi']
 process = subprocess.Popen(cmd2YUV, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 out, err = process.communicate()
 print(out)
 print(err)

 cmd2PNG = ['ffmpeg', '-y', '-i', folder_path+'im2_'+f+'.avi', '-compression_level', '10', '-pred', 'mixed', \
 '-pix_fmt', 'rgb24', '-sws_flags', '+accurate_rnd+full_chroma_int', \
 folder_path+'im2_'+f+'.png']
 process = subprocess.Popen(cmd2PNG, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 out, err = process.communicate()
 print(out)
 print(err)

im1=pilim.open('/content/drive/My Drive/Colab Notebooks/adv_dnn/datasets/im2.png')
im2=pilim.open('/content/drive/My Drive/Colab Notebooks/adv_dnn/datasets/im2_yuv444p10le.png')
im1_2d = np.asarray(im1)
im2_2d = np.asarray(im2)
print(im2_2d-im1_2d)



-
Removing one audio track from a movie results in audio desync when copying, but not when reencoding --- why ?
18 avril 2020, par chskI'm trying to remove a superfluous audio track from a movie file. Specifically, this movie on
archive.org
has the original audio as track 2, and what appears to be a slavic (Russian ?) voiceover in track 1. I'd like to get rid of the latter.


I found this question that suggested I should do the following :



ffmpeg -i Benjamín\ dúfa.avi -map 0 -map -0:a:0 -c copy Benjamín\ dúfa\ \(aðeins\ íslenskt\ tal\).avi



But this doesn't work : after removing the first audio track, audio and video are not in sync in the resulting file anymore (when played in VLC). Now, I was able to overcome this problem by also reencoding the remaining audio track along the way, using



ffmpeg -i Benjamín\ dúfa.avi -map 0 -map -0:a:0 -c:v copy Benjamín\ dúfa\ \(aðeins\ íslenskt\ tal\).avi



But while this works, I'd like to understand why copying the audio track instead does not. I suppose it's a somewhat philosophical question --- consider it a matter of intellectual curiosity, combined with an aversion to needless lossy re-encoding.



So if anyone can explain this to me, I'd very grateful. Thanks !



EDIT : as per Gyan's request, here's ffmpeg's output for the first command :



ffmpeg version 4.2 Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 9.1.1 (GCC) 20190807
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Input #0, avi, from 'Benjamín dúfa.avi':
 Metadata:
 encoder : VirtualDubModRus 1.5.10.2 (build 2542/release)
 IAS1 : Islenska
 Duration: 01:27:37.00, start: 0.000000, bitrate: 1313 kb/s
 Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x400 [SAR 1:1 DAR 9:5], 979 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
 Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 192 kb/s
 Stream #0:2: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s
Output #0, avi, to 'b.avi':
 Metadata:
 IAS1 : Islenska
 ISFT : Lavf58.29.100
 Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x400 [SAR 1:1 DAR 9:5], q=2-31, 979 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
 Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
[avi @ 0000000002bf00c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
frame=131425 fps=7616 q=-1.0 Lsize= 718952kB time=01:27:37.00 bitrate=1120.3kbits/s speed= 305x
video:628523kB audio:82141kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.166227%




And also for the second, for comparison :



ffmpeg version 4.2 Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 9.1.1 (GCC) 20190807
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Input #0, avi, from 'Benjamín dúfa.avi':
 Metadata:
 encoder : VirtualDubModRus 1.5.10.2 (build 2542/release)
 IAS1 : Islenska
 Duration: 01:27:37.00, start: 0.000000, bitrate: 1313 kb/s
 Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x400 [SAR 1:1 DAR 9:5], 979 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
 Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 192 kb/s
 Stream #0:2: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:2 -> #0:1 (mp3 (mp3float) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, avi, to 'b2.avi':
 Metadata:
 IAS1 : Islenska
 ISFT : Lavf58.29.100
 Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x400 [SAR 1:1 DAR 9:5], q=2-31, 979 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
 Stream #0:1: Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp
 Metadata:
 encoder : Lavc58.54.100 libmp3lame
[avi @ 00000000004b7440] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
frame=131425 fps=1090 q=-1.0 Lsize= 718952kB time=01:27:37.00 bitrate=1120.3kbits/s speed=43.6x
video:628523kB audio:82141kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.166233%