Как преобразовать mkv файл (с несколькими аудиотрек) к ogv формату presrving весь аудиотрек?
Действительно ли возможно создать ogg файл (аудио) с несколькими, отслеживают?
В Linux у Вас есть универсальная программа преобразования медиа, названная avconv
(альтернативно ffmpeg
). В канонической форме этим управляют расширения, таким образом avconv -i input.mkv output.ogm
сделает надлежащее преобразование.
Однако для сохранения всех потоков необходимо использовать -map
опция. Позвольте мне просто процитировать руководство:
-map [-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]] | [linklabel] (output)
Designate one or more input streams as a source for the output file. Each input stream is identified by the input file index input_file_id and
the input stream index input_stream_id within the input file. Both indices start at 0. If specified, sync_file_id:stream_specifier sets which
input stream is used as a presentation sync reference.
The first "-map" option on the command line specifies the source for output stream 0, the second "-map" option specifies the source for output
stream 1, etc.
A "-" character before the stream identifier creates a "negative" mapping. It disables matching streams from already created mappings.
An alternative [linklabel] form will map outputs from complex filter graphs (see the -filter_complex option) to the output file. linklabel
must correspond to a defined output link label in the graph.
For example, to map ALL streams from the first input file to output
avconv -i INPUT -map 0 output
For example, if you have two audio streams in the first input file, these streams are identified by "0:0" and "0:1". You can use "-map" to
select which streams to place in an output file. For example:
avconv -i INPUT -map 0:1 out.wav
will map the input stream in INPUT identified by "0:1" to the (single) output stream in out.wav.
For example, to select the stream with index 2 from input file a.mov (specified by the identifier "0:2"), and stream with index 6 from input
b.mov (specified by the identifier "1:6"), and copy them to the output file out.mov:
avconv -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
To select all video and the third audio stream from an input file:
avconv -i INPUT -map 0:v -map 0:a:2 OUTPUT
To map all the streams except the second audio, use negative mappings
avconv -i INPUT -map 0 -map -0:a:1 OUTPUT
Note that using this option disables the default mappings for this output file.
, Таким образом, Вам будет нужно это:
avconv -i nput.mkv -map 0:v -map 0:a output.ogm
И да, можно сохранить несколько дорожек, и даже видео и текста, в файле OGG, потому что это - универсальный контейнер медиа.
Вы можете использовать dmMediaConverter и в способе Новообращенного и поместить ogg или ogv расширение в файле продукции как audio.ogg. Кроме того, снятие флажка «Позволяют» на видео потоке, это - аудио только. Вы можете скопировать потоки , если их приняты этим контейнером . h264/h265/vp8/vp9 не принят ogg.
Затем если Вы действительно хотите Вас, мог бы повторно закодировать его к ogg. Но могло бы быть самым полезным сохранить исходное аудиокодирование.
Первое использование ffmpeg для идентификации кодирования аудиопотока.
$ ffmpeg -i $f
Stream #0:0(und): Video: h264 (Main), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc
Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, s16 (default)
Затем использование ffmpeg для извлечения аудиопотока (в исходном кодировании к .mka формату).
ffmpeg -i song.mkv -acodec: copy -vn song.mka
я нашел это полезным:
http://www.hecticgeek.com/2012/12/extract-audio-using-ffmpeg-ubuntu/
И это - действительно хороший совет:
Примечание: Каждый раз, когда Вы вызываете сомнение (don’t, знают, какое расширение использовать), затем можно просто использовать †. расширение mka’ (вЂoutput.mka†). Поскольку вЂMKA’ формат контейнера может сохранить огромное количество аудиокодеков. Если Вы выбираете это однако, то некоторые игроки не смогли играть аудиотрек. Поэтому знайте об этом.
А полезный сценарий для преобразования любого mmv и mp4 к mka аудио (хранение исходного аудиокодирования): convert_vtoa.sh
#!/bin/bash
for f in *.mkv *.mp4; do
# ffmpeg -i $f
bn=${f%%-[A-Za-z0-9]*}
echo -n bn=$bn
if [[ ! -e "$bn.mka" ]] ; then
echo ffmpeg -i "$f" -acodec: copy -vn "$bn.mka"
ffmpeg -i "$f" -acodec: copy -vn "$bn.mka"
else
echo " ##### already done. #####"
fi
done