Ubuntu 14.04 does not have ffmpeg in standard repositories, but you could add ppa:mc3man/trusty-media repository and install ffmpeg package to get the needed software. For other codecs than mp3 and vorbis it converts audio to ogg. Notes: the output files are created in sub-directory output it creates in the beginning (if necessary). To convert many files: for vid in *.mp4 do ffmpeg -i "$vid" -vn -acodec libvorbis "$".ogg To convert one file: ffmpeg -i videofile.mp4 -vn -acodec libvorbis audiofile.ogg So why not leave the audio format detection up to ffmpeg? In addition to concatenating and converting our original video files, we also need to extract the audio files. Nick works in Indonesia researching Kula, an endangered non-Austronesian language spoken in the eastern highlands of Alor. But what if the audio in the mp4 file is not one of those? you'd have to transcode anyway. Today on the ELAR blog, we are sharing another post from ELDP grantee, Nick Williams on extracting. The example code is: videoclip VideoFileClip(mp4file) audioclip dio audioclip.writeaudiofile(mp3file) audioclip.close() videoclip. You say you want to "extract audio from them (mp3 or ogg)". In this example, we use mp4 file to create a VideoFileClip object, then get the audo object of this mp4 file, finally save the audo of this mp4 into a mp3 file.
0 Comments
Leave a Reply. |