Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell FFMPEG从“批量复制元数据”;文件夹1文件1.mp3“;至;文件夹2文件1.mp3“;在不同的文件夹中_Shell_Ffmpeg_Metadata_File Transfer_Transfer - Fatal编程技术网

Shell FFMPEG从“批量复制元数据”;文件夹1文件1.mp3“;至;文件夹2文件1.mp3“;在不同的文件夹中

Shell FFMPEG从“批量复制元数据”;文件夹1文件1.mp3“;至;文件夹2文件1.mp3“;在不同的文件夹中,shell,ffmpeg,metadata,file-transfer,transfer,Shell,Ffmpeg,Metadata,File Transfer,Transfer,我有两个同名的单独文件夹中的单独文件,我想将元数据从“folder1”中的文件传输到“folder2”。 然后我想添加一大堆符合相同格式的文件,并批量传输所有元数据信息 从我尝试过的堆栈交换线程: "The following script will loop through the the files in one directory, find corresponding files in a second directory and then combine these two files

我有两个同名的单独文件夹中的单独文件,我想将元数据从“folder1”中的文件传输到“folder2”。 然后我想添加一大堆符合相同格式的文件,并批量传输所有元数据信息

从我尝试过的堆栈交换线程:

"The following script will loop through the the files in one directory, find corresponding files in a second directory and then combine these two files into a third output directory

dir1=FIRST DIRECTORY
dir2=SECOND DIRECTORY
output=OUTPUT DIRECTORY
for file in $(ls $dir1); do
  ffmpeg -i "$dir1/$file" -i "$dir2/$file" -map 1 -c copy \
   # copies all global metadata from in0.mkv to out.mkv  
   -map_metadata 0 \
   # copies video stream metadata from in0.mkv to out.mkv
   -map_metadata:s:v 0:s:v \
   # copies audio stream metadata from in0.mkv to out.mkv
   -map_metadata:s:a 0:s:a \
   "$outdir/$file"
done"
但就我的一生而言,我无法让它正常工作,这有点过分了。他继续说:

If you want to make something reuseable you could put this in a script with the following header (remove the assignment for dir1, dir2 and output in the script above). And then call it as script.sh dir1 dir2 outdir

#!/bin/bash
set -x errexit # exit immediately on error
dir1="$1"
dir2="$2"
output="$3"
我完全迷路了。有没有人能帮我把这件事做好,并让我轻松一点,因为我对代码/FFMPEG还没有太多经验


多谢各位

请解释你的问题与“我无法让它正常工作”的关系。真正的问题是什么?有什么错误吗?脚本或ffmpeg命令有问题吗?ffmpeg命令是否执行过?你的操作系统是什么?(这之前是用批处理文件标记的,所以我想确认您没有尝试在Windows cmd中运行bash脚本。)谢谢,但我发现了一种使用Foobar2000更简单的方法。不再需要帮助。