Aiuto:Mpeg2dv.sh
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Deutsch
English
Esperanto
Hausa
Lëtzebuergesch
Nederlands
Tiếng Việt
dansk
español
français
italiano
polski
português do Brasil
sicilianu
suomi
svenska
русский
українська
العربية
فارسی
नेपाली
हिन्दी
বাংলা
中文
日本語
Se il software di editing video non importa direttamente i file mpeg dalla fotocamera digitale, potrebbe essere necessario convertirli in dv per importare ad esempio in iMovie.
Istruzioni
-
Salva il codice sul desktop; assicurati che l'estensione sia davvero .sh e non .sh.txt.
-
Place the script in a proper place like /usr/local/bin/mpeg2dv.sh on Mac OS X or for example ~/bin/mpeg2dv.sh on Linux that is in your $PATH environment variable and make the script executable if needed.
-
Apri il terminale (Terminal.app su Mac OS X; si trova nella cartella utility delle applicazioni) e digita:
mpeg2dv.sh anMpgFile.mpg anotherMpgFile.mpg
Il risultato dovrebbe essere il file .dv nella sottocartella in questione.
Script
#!/bin/sh
# This script converts mpeg files from a digital camera
# into the DV format using the ffmpeg tool.
#
# Eric Kow
# Public domain - do whatever you want with this
FFMPEG_FLAGS="-ac 2 -ar 48000 -hq -s 720x480"
TYPE_1=
TYPE_2='-map 0:1 -map 0:0'
TYPE_3='-map 0:2 -map 0:1'
try_ffmpeg() {
IN_FILE=${1}
OUT_FILE=${2}
while [ "$#" -gt "2" ]
do
TYPE=${3}
ffmpeg -i "${IN_FILE}" ${TYPE} ${FFMPEG_FLAGS} "${OUT_FILE}" || :
if [ -s ${OUT_FILE} ]; then
return 0
else
rm ${OUT_FILE}
fi
shift
done
}
# for each file...
while [ "$#" -gt "0" ]
do
# what file are we working on now?
in_file=$1
in_file_uscore=`echo ${in_file} | sed -e 's/ /_/g'`
out_file_stem=`basename ${in_file_uscore} .mpg`
out_file=${out_file_stem}.dv
shift
try_ffmpeg "${in_file}" "${out_file}"\
"${TYPE_1}" "${TYPE_2}" "${TYPE_3}"
done
Retrieved from "https://commons.wikimedia.org/w/index.php?title=Help:Mpeg2dv.sh/it&oldid=828095341"
Category:
●Commons help/it
Navigation menu
●English
●Not logged in
●Talk
●Contributions
●Create account
●Log in
●Help page
●Discussion
●View
●Translate
●History
Search
●Main page
●Welcome
●Community portal
●Village pump
●Help center
●Upload file
●Recent changes
●Latest files
●Random file
●Contact us
●What links here
●Related changes
●Special pages
●Permanent link
●Page information
●Get shortened URL
●Download QR code
●Create a book
●Download as PDF
●Printable version
Add links
●This page was last edited on 5 December 2023, at 03:44.
●Files are available under licenses specified on their description page. All structured data from the file namespace is available under the Creative Commons CC0 License; all unstructured text is available under the Creative Commons Attribution-ShareAlike License;
additional terms may apply.
By using this site, you agree to the Terms of Use and the Privacy Policy.
●Privacy policy
●About Wikimedia Commons
●Disclaimers
●Code of Conduct
●Developers
●Statistics
●Cookie statement
●Mobile view