Как пакетно вставить одну сцену клипа в начале нескольких видео?

1160
FLYqtFLY

Ну, это было несколько дней на поиски подходящего автоматического или полуавтоматического способа массового объединения файлов таким образом. По сути, я хочу вставить один и тот же клип перед кучей других клипов.

В этом случае я пытался использовать файлы .flv, .mp4, .avi (всегда объединяющие одни и те же кодеки), и мне не удалось протестировать все программы, доступные как в Windows, так и в OSx. Поверьте мне, я перепробовал их все. Единственные, кто должен справиться с этой задачей - от Videocharge: Watermark Master и Videocharge Studio . Никто из них не мог правильно выполнить задачу. Может быть, каким-то образом я мог бы добиться этого с помощью сценариев в After Effects или Sony Vegas, я просто не нашел ни одного.

Теперь я пытаюсь найти какой-то способ достичь того же с помощью оболочки, сценариев Unix ... Мне все равно. Я просто не хочу монтировать Ubuntu только для этих задач. Я не программист, но я очень упрямый (что иногда приводит меня к вечным вечерам), поэтому я был бы признателен за помощь или совет от любого, кто увлечен и достаточно хорош в пакетной обработке видео или написании сценариев.

Прямо сейчас, единственные полезные пути, которые я нашел, заставляют меня использовать mencode или ffmpeg с помощью команд, но я не могу выполнить слияние в пакетном режиме. Меня не волнует способ сортировки видео. Но учитывая, что операция будет выполняться с сотнями или тысячами видео, было бы неуместно хранить их все в отдельных папках, каждая из которых сопровождалась бы «уникальным» вступительным клипом. Я предполагаю, что наиболее логичным способом было бы хранить «кучу» видео в папке, а также вступительный клип в той же папке, что и кодировщик или рендер.

Заранее спасибо за любую помощь или руководство,

0
сначала вы должны увеличить свои знания видео: контейнер, треки, кодеки. кодирование и мультиплексирование. посмотрите на [видео форум] (http://forum.doom9.org). Endoro 10 лет назад 0
См. Документацию FFmpeg в [concat demuxer] (http://ffmpeg.org/ffmpeg-formats.html#concat-1), а также в [Как объединить (объединить, объединить) мультимедийные файлы] (https: // ffmpeg. орг / ПРОФ / FFmpeg / вики / Как% 20to% 20concatenate% 20% 28join% 2C% 20merge% 29% 20media% 20files). LordNeckbeard 10 лет назад 0

2 ответа на вопрос

0
mk117

Well, I've appended videos, but never appended at the beginning. You can use avidemux to append the videos!

I'm not good at javascripting, so please excuse me for not scripting this for you. There's a tutorial for scripting for Avidemux. Avidemux is an open source and free video converter. You can add effects to your audio/video in avidemux and save it to multiple formats.

This script is an example tutorial on the page link given here: [ ::: link ::: ] and the script will simply scan the orgDir directory and unpack all AVI files. The resulting file is put in destDir directory (Using new directorySearch API).

Avidemux functions are as follows: displayError, displayInfo, fileReadSelect, fileWriteSelect, allFilesFrom, nextFile

and more functions: load, append, save, saveDVD, saveOGM, clearSegments, addSegment, goToTime, forceUnpack, setContainer

More Script Functions here: http://www.avidemux.org/admWiki/doku.php?id=using:scripting#avidemux_functions

the Turotial Script that converts the avi file is as follows:

//AD <- /* Simple script that scans the orgDir directory and unpack all AVI files The resulting file is put in destDir directory Using new directorySearch API */ var app = new Avidemux(); var ds = new DirectorySearch(); var orgDir; var destDir; var reg =new RegExp(".$"); /* This is for Unix For Windows change to sep="\\"; reg2=new RegExp("\\.*\\"); */ var sep="\\"; var reg2 =new RegExp("\/.*\/"); var extension; var target; // // // // select files from original & target directories // orgDir=fileReadSelect(); destDir=fileWriteSelect(); orgDir=pathOnly(orgDir); destDir=pathOnly(destDir); // // strip last \\ or // // orgDir=orgDir.replace(reg,""); destDir=destDir.replace(reg,""); print("orgDir : <"+orgDir+">"); print("destDir : <"+destDir+">"); // // Go // if(ds.Init(orgDir)) { while(ds.NextFile()) { // Only process file we want i.e. AVI if(!ds.isNotFile && !ds.isDirectory && !ds.isHidden && !ds.isArchive && !ds.isSingleDot && !ds.isDoubleDot) { extension=ds.GetExtension(); if(extension == "avi") { target=ds.GetFileName(); target=destDir+sep+target; print("***"+ds.GetFileName()+"-->"+target); processFile(orgDir+sep+ds.GetFileName(),target); } //print("File: "+ds.GetFileName()+" is "+ds.GetFileSize()+" bytes, extension "+extension); } } print("We just searched in directory \"" + ds.GetFileDirectory() + "\""); ds.Close(); } else displayError("Error initializing the directory search"); displayInfo("Finished !"); function processFile(filename, targetfile) { // Load the file app.forceUnpack(); app.load(filename); app.rebuildIndex(); app.audio.delay=0; app.audio.mixer("NONE"); app.audio.scanVBR(); app.setContainer("AVI_UNP"); app.save(targetfile); return 1; } 

Hope this helps...

sources:

Добро пожаловать в Супер пользователя! Хотя это может теоретически ответить на вопрос, [было бы предпочтительнее] (http://meta.stackexchange.com/q/8259) включить сюда основные части ответа и предоставить ссылку для справки. terdon 10 лет назад 0
Хорошо. простите за это ... я отредактирую свой ответ ... mk117 10 лет назад 0
0
FLYqtFLY

Cheers a lot for your suggestion @user2377276. I really appreciate the effort. In fact, your workaround is the one which is guiding me in the right direction. Well, I hope so, as I haven´t suceeded yet. So far, the closest I´ve got to accomplish the merge was through different variation of the following code, executed in the same directory as the multiple different videos. The unique file to append was placed in the root, and I created C:/TEMP for the output.

for %a in ("*.flv") do Mencoder -oac copy "c:\INTRO.flv" "%a" -o "c:\TEMP\%a"

All videos are in FLV1, but they do have slightly different resolution, so I´m getting crap, basically.

I don´t know if I should try with ffmpeg. Suggestions?

I´m pretty sure that this can be achieved without the need to reencode, as I have tested several programs and none of them are reencoding, they are just forcing the resolution in some cases. In fact, the program that seemed to behave the best was the AIR application Rich Flv, but it doesn´t work on batch.

Похожие вопросы