
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (35)
-
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) (...)
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
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 (...)
Sur d’autres sites (10959)
-
FFmpeg psycho-visual options - psy-rdoq
7 avril 2020, par SLVRI'm new to encoding and I like to do my encodings in x265 10bit. Currently, I'm facing a little issue with ffmpeg. I noticed when I'm using libx265 encoder output file looks a little bit blurred or small detail loss. Code I used to do my encodes is



ffmpeg -i input.mp4 -c:v libx265 -preset medium -crf 22 -pix_fmt yuv420p10le -c:a copy -y output-x26510bit.mkv




I've found out psycho-visual options might help in this case. I modified my code in to



ffmpeg -i input.mp4 -c:v libx265 -preset medium -crf 22 -pix_fmt yuv420p10le -psy-rd 2 -psy-rdoq 4 --rdoq-level 1 -c:a copy -y output-x26510bit.mkv




When I issue the above command, I get an error code



C:\Users\abc\Desktop\1>ffmpeg -i input.mp4 -c:v libx265 -preset medium -crf 22 -pix_fmt yuv420p10le -psy-rd 2 -psy-rdoq
 4 -rdoq-level 1 -c:a copy -y output-x26510bit.mkv
ffmpeg version git-2020-04-03-52523b6 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9.3.1 (GCC) 20200328
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enabl
e-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enabl
e-libsrt --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-l
ibvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --en
able-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
 libavutil 56. 42.102 / 56. 42.102
 libavcodec 58. 77.101 / 58. 77.101
 libavformat 58. 42.100 / 58. 42.100
 libavdevice 58. 9.103 / 58. 9.103
 libavfilter 7. 77.101 / 7. 77.101
 libswscale 5. 6.101 / 5. 6.101
 libswresample 3. 6.100 / 3. 6.100
 libpostproc 55. 6.100 / 55. 6.100
Unrecognized option 'psy-rdoq'.
Error splitting the argument list: Option not found




How do I solve this issue


-
On Heroku I got FFMPEG::Error (Failed encoding.Errors : encoded file is invalid. Full output : )
8 octobre 2020, par Ruslan ValeevThe code is :


tempfile = Tempfile.open('content')
tempfile.write(content)
movie = FFMPEG::Movie.new(tempfile.path)
screenshot_temp_file = Tempfile.open('screenshot')
movie.screenshot(screenshot_temp_file.path)



everything works fine locally, but when I try this on Heroku I got error at last row :


irb(main):013:0> movie.screenshot(screenshot_temp_file.path)
I, [2020-10-07T15:48:27.132114 #7] INFO -- : Running transcoding...
["/app/vendor/ffmpeg/ffmpeg", "-y", "-i", "/tmp/content20201007-7-1g1955b", "-vframes", "1", "-f", "image2", "/tmp/screenshot20201007-7-1mmts7s"]

E, [2020-10-07T15:48:27.190572 #7] ERROR -- : Failed encoding...
["/app/vendor/ffmpeg/ffmpeg", "-y", "-i", "/tmp/content20201007-7-1g1955b", "-vframes", "1", "-f", "image2", "/tmp/screenshot20201007-7-1mmts7s"]


Errors: encoded file is invalid. 

Traceback (most recent call last):
 7: from /app/bin/irb:30:in `<main>'
 6: from /app/bin/irb:30:in `load'
 5: from /app/vendor/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `<top>'
 4: from (irb):13
 3: from /app/vendor/bundle/ruby/2.6.0/gems/streamio-ffmpeg-3.0.2/lib/ffmpeg/movie.rb:204:in `screenshot'
 2: from /app/vendor/bundle/ruby/2.6.0/gems/streamio-ffmpeg-3.0.2/lib/ffmpeg/transcoder.rb:45:in `run'
 1: from /app/vendor/bundle/ruby/2.6.0/gems/streamio-ffmpeg-3.0.2/lib/ffmpeg/transcoder.rb:112:in `validate_output_file'
FFMPEG::Error (Failed encoding.Errors: encoded file is invalid. Full output: )
</top></main>


I've try to pass some options, like
:seek_time
andvalidate: false
but nothing changed. What am I doing wrong ? Thank you so much !

EDIT :
After
Full output: )
there is nothing.
I've install FFMPEG buildpack on Heroku, and can see it in ui :



-
Why AudioSegment doesn't read 'mp3' ?
22 octobre 2020, par freshITmeatI tried to read file that I give with absolute path.
When I run my code first that I see is this message :


D:\prog\datascience\anaconda\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
 warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)



I tried this :


PATH_TO_FFMPEG = 'D:\\prog\\ffmpeg-win-2.2.2\\ffmpeg.exe'
pydub.AudioSegment.converter = r'D:\\prog\\ffmpeg-win-2.2.2\\ffmpeg.exe'



And I separately installed
ffmpeg
withpip
. But it didn't help.
When I try this :

raw_sound = pydub.AudioSegment.from_mp3(file=track_path)



where
track_path
is correct absolute path generated automatically.
So I got this this error :

Traceback (most recent call last):
 File "D:\prog\PyCharm Community Edition 2020.2.2\plugins\python-ce\helpers\pydev\pydevd.py", line 1448, in _exec
 pydev_imports.execfile(file, globals, locals) # execute the script
 File "D:\prog\PyCharm Community Edition 2020.2.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
 exec(compile(contents+"\n", file, 'exec'), glob, loc)
 File "D:/testtask2/test_task/testtask/get_mffc.py", line 165, in <module>
 slice_all_in_a_dir('May 27 2020 LNC/Hydrophone 1/raw_records')
 File "D:/testtask2/test_task/testtask/get_mffc.py", line 70, in slice_all_in_a_dir
 slice_samples(track_path= [file],
 File "D:/testtask2/test_task/testtask/get_mffc.py", line 48, in slice_samples
 raw_sound = pydub.AudioSegment.from_mp3(file=track_path)
 File "D:\prog\datascience\anaconda\lib\site-packages\pydub\audio_segment.py", line 738, in from_mp3
 return cls.from_file(file, 'mp3', parameters=parameters)
 File "D:\prog\datascience\anaconda\lib\site-packages\pydub\audio_segment.py", line 680, in from_file
 stdin_data = file.read()
AttributeError: 'list' object has no attribute 'read'
python-BaseException
</module>


Full code when I use it :


def slice_samples(track_path: list, save_path: str,
 sample_folder_name: str, interval: float, given_format, name: str = "part", export_format = 'wav'):
 """
 This metod slice given track to parts.
 :param track_path: str, a path to the track you want to slice
 :param save_path: str, a path to folder, where you want save sliced tracks
 :param sample_folder_name: str, you don't need to create a folder for sliced tracks,
 you can just write the name of the folder in this argument where you want to save tracks
 :param interval: float, measure in seconds, the length of sliced tracks
 :param name: str, name of sliced tacks
 :param given_format: str, I strongly recommend use .wav format initially, when you record sounds
 :return: folder with sliced tracks
 """

 # it cuts a file in mp3 or wav formats (wav recommended)

 interval_secs = interval * 10 ** 3
 raw_sound = None
 if given_format == "WAV":
 raw_sound = pydub.AudioSegment.from_wav(file=track_path)
 elif given_format == "MP3":
 raw_sound = pydub.AudioSegment.from_mp3(file=track_path)
 else:
 raise Exception("It's temporarily unsupported given_format: " + given_format)
 start = 0
 end = interval_secs
 i = 0
 while end < len(raw_sound):
 save_to = save_path + sample_folder_name + "/" + name + str(i)
 part = raw_sound[start:end]
 part.export(save_to, format=export_format)
 i += 1
 start += interval_secs
 end += interval_secs
 return save_path + sample_folder_name

def slice_all_in_a_dir(tracks_folder: str):
 files = os.listdir(tracks_folder)
 for file in files:
 folder_name = file.split('.')
 f_name = folder_name[0]
 file = tracks_folder+'/'+file
 file = os.path.abspath(file)
 slice_samples(track_path= [file],
 save_path= PATH_FOR_SLICED,
 sample_folder_name= f_name,
 interval=5,
 given_format=folder_name[1])

if __name__ == "__main__":
 slice_all_in_a_dir('May 27 2020 LNC/Hydrophone 1/raw_records')