【问题标题】:extract date and LUFS from a file with script使用脚本从文件中提取日期和 LUFS
【发布时间】:2021-10-07 22:50:17
【问题描述】:

我正在使用

for i in *.mp4; do echo "$i:"; ffmpeg -i "$i" -map 0:a -af ebur128=framelog=verbose -f null - 2>&1 | awk '/I:/{print $2}'; done

提取LUFS然后使用

for i in *.mp4; do ffprobe -v quiet -select_streams v:0 -show_entries format=filename:stream_tags=creation_time -of default=noprint_wrappers=1:nokey=1 "$i"; done

提取 mp4 文件的创建日期。

我怎样才能将这两个命令作为一个序列或一个脚本文件,以便我只运行一次命令,并且我让这两个命令都运行。 我想得到输出;

File name
LUFS
Creation date

如果该命令还将所有输出导出到一个文本文件中,那就太好了。

请帮忙。 提前谢谢你!

【问题讨论】:

    标签: bash ffmpeg


    【解决方案1】:
    for i in *.mp4; do echo "$i"; ffmpeg -i "$i" -map 0:a -af ebur128=framelog=verbose -f null - 2>&1 | awk '/I:/{print $2}'; ffprobe -v quiet -select_streams v:0 -show_entries format_tags=creation_time -of default=nw=1:nk=1 "$i"; done >> lufs.log
    

    示例结果:

    audio_and_time.mp4
    -20.0
    2020-07-22T17:48:25.000000Z
    audio_no_time.mp4
    -24.0
    no_audio.mp4
    2020-07-22T17:48:25.000000Z
    two_audio_streams.mp4
    -13.6
    -26.6
    2012-08-05T10:18:05.000000Z
    no_audio_no_time.mp4
    

    【讨论】:

    • 非常感谢。这很完美。有没有办法用逗号分隔在一行中输出?即 File_Name、lufs、时间戳。提前谢谢你。
    猜你喜欢
    • 2021-10-04
    • 2015-01-08
    • 1970-01-01
    • 1970-01-01
    • 2018-07-21
    • 1970-01-01
    • 2023-03-06
    • 1970-01-01
    相关资源
    最近更新 更多