Guia de conversão de formatos de video

APLinhares

OpenSource
Com ajuda de uma assistente, aqui fica um guia de conversão de formatos de video :D
Comandos sao válidos para Debian, Ubuntu e derivados.

How To Convert Any Video File Format Under Linux

This video tutorial will explain how to losslessly convert any video file format, including quicktime .mov, flash .flv files, open source .ogv, .mp4, .wmv, .asf and more. I show you how to install ffmpeg, check the formats and codecs available to you, convert a file to a new format (windows media and .asf in this example) without any loss in quality during the decoding and encoding process, and create and run a script file that will enable you to run a batch conversion on any number of files at the same time.
Anyone who has tried to convert multimedia files in Windows knows how challenging it can be. There are a ton of different programs out there to do it, but most of them either leave a watermark in your video, lower the resolution of your video, or both, unless you pay hundreds of dollars. ffmpeg can do this for you quickly, conveniently, and completely free - and can even be used in Windows! This video was created for Ubuntu, but will work for most Linux distributions, and the code you learn here to convert a file can be applied to the Windows version as well, though Windows’ scripting language is different so you will need to adjust the batch conversion script.


<video na página>


Single File Conversion
Código:
sudo apt-get install ffmpeg
 ffmpeg -formats  (lists all available formats based on the currently installed codecs, to be used with -vcodec, -acodec, and -f)
 ffmpeg -i inputfilename.ext -vcodec wmv2 -sameq -acodec wmav2 -f asf outfile.asf
 ffmpeg - start ffmpeg
(-i inputfilename.ext - tells ffmpeg the file name and extension from which to convert)
(-vcodec wmv2 - use video codec wmv2)
(-sameq - use same video quality as source file)
(-acodec wmav2 - use audio codec wmav2)
(-f asf - choose output format, sometimes known as a container, in this case asf)
Bonus Batch Conversion
Código:
sudo touch convert.sh [I](here we use touch to create a blank file, not always necessary to do that rather than through a text editor but it is safer with permissions and such)[/I]
 gksu gedit convert.sh [I](this is only available for gnome desktops, i.e. ubuntu and the like, so you can tell people to use whatever text editor they like)[/I]
 sudo chmod 0777 convert.sh [I](like last time, chmod changes file or directory permissions, in this case giving access to everyone to read, write, execute the script)[/I]
 ./convert.sh [I] (runs the script convert.sh on files in the /Videos directory)[/I]
 ls [I](ls -l lists all files and directories plus permissions)[/I]

script:
Código:
for f in *.MOV; do ffmpeg -i “$f” -vcodec wmv2 -sameq -acodec wmav2  “${f%.MOV}.asf”; done
Fonte
 
Back
Topo