gpt4 book ai didi

audio - 从 Flac 到 Ogg 的 ffmpeg 转换会产生损坏的文件

转载 作者:行者123 更新时间:2023-12-04 23:20:40 25 4
gpt4 key购买 nike

我使用此命令将 flac 文件转码为 ogg

ffmpeg -i input.flac -c:a libvorbis -b:a 500k  output.ogg
是的,我使用 500k 来保持尽可能高的质量,一些文件还可以,但其中一些无法播放 - 不支持的格式或损坏的文件说 foobar - 我的 icecast 流媒体也无法读取它。所以文件有问题。
我相信这是由于比特率高,所以我尝试了
ffmpeg -i input.flac -c:a libvorbis -b:a 320k  output.ogg
发生了同样的事情,有些文件还可以,有些则无法播放。
所以我再次尝试使用此命令默认
ffmpeg -i input.flac -c:a libvorbis output.ogg
一样。有些文件没问题,有些文件已损坏且无法播放。
我不知道为什么。
flac 和 ogg 都属于同一个家族,在转码过程中它变成了损坏的文件是怎么回事?
光谱分析没有显示任何错误 - 这里是 ogg https://prnt.sc/115zdjl , 这里是原始的 flac https://prnt.sc/115zegw
我真的很感兴趣发生了什么以及如何使它工作?
谁能解释一下?
这是完整的日志
    C:\Users\lukas.kotatko>ffmpeg -i "\\192.168.0.128\lukas\online radio resources\Atma FM playlists\channel 1\flac lossless\Tuu\One Thousand Years\02 One Thousand Years.flac" -c:a libvorbis -b:a 500k "\\192.168.0.128\lukas\online radio resources\Atma FM playlists\channel 1\flac lossless\Tuu\One Thousand Years\02 One Thousand Years [500k test].ogg"
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.1 (GCC) 20200726
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, flac, from '\\192.168.0.128\lukas\online radio resources\Atma FM playlists\channel 1\flac lossless\Tuu\One Thousand Years\02 One Thousand Years.flac':
Metadata:
GENRE : Tribal / Ambient
ORGANIZATION : Waveform Records
ISRC : 01101-2
COMMENT : US reissue featuring the six original tracks plus two taken from the Invocation album.
MUSICBRAINZ_RELEASEGROUPID: 737d0518-3dc2-36b3-9419-282c0ade0e50
ORIGINALDATE : 1993
ORIGINALYEAR : 1993
RELEASETYPE : album
MUSICBRAINZ_ALBUMID: f6339129-f662-43a1-93df-2f20540f73cc
ALBUM : One Thousand Years
BARCODE : 789060110125
MUSICBRAINZ_ALBUMARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
album_artist : Tuu
ALBUMARTISTSORT : Tuu
ASIN : B00005B9TT
SCRIPT : Latn
RELEASESTATUS : official
LABEL : Waveform Records
CATALOGNUMBER : 01101-2
RELEASECOUNTRY : US
DATE : 2001-05-08
TOTALDISCS : 1
disc : 1
TOTALTRACKS : 8
MEDIA : CD
MUSICBRAINZ_TRACKID: aef9824d-e4a6-4ae6-aebe-50a83dd14f71
TITLE : One Thousand Years
MUSICBRAINZ_ARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
ARTIST : Tuu
ARTISTSORT : Tuu
ARTISTS : Tuu
MUSICBRAINZ_RELEASETRACKID: 621c9da6-a85d-3f8b-b485-5e6f74a60cd0
track : 2
TRACKTOTAL : 8
DISCTOTAL : 1
Duration: 00:08:03.67, start: 0.000000, bitrate: 792 kb/s
Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 600x600 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
Metadata:
comment : Cover (front)
Stream mapping:
Stream #0:1 -> #0:0 (mjpeg (native) -> theora (libtheora))
Stream #0:0 -> #0:1 (flac (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
[swscaler @ 0000015307581a00] deprecated pixel format used, make sure you did set range correctly
[ogg @ 00000153073f1680] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or -vsync 2
Output #0, ogg, to '\\192.168.0.128\lukas\online radio resources\Atma FM playlists\channel 1\flac lossless\Tuu\One Thousand Years\02 One Thousand Years [500k test].ogg':
Metadata:
GENRE : Tribal / Ambient
ORGANIZATION : Waveform Records
ISRC : 01101-2
COMMENT : US reissue featuring the six original tracks plus two taken from the Invocation album.
MUSICBRAINZ_RELEASEGROUPID: 737d0518-3dc2-36b3-9419-282c0ade0e50
ORIGINALDATE : 1993
ORIGINALYEAR : 1993
RELEASETYPE : album
MUSICBRAINZ_ALBUMID: f6339129-f662-43a1-93df-2f20540f73cc
ALBUM : One Thousand Years
BARCODE : 789060110125
MUSICBRAINZ_ALBUMARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
album_artist : Tuu
ALBUMARTISTSORT : Tuu
ASIN : B00005B9TT
SCRIPT : Latn
RELEASESTATUS : official
LABEL : Waveform Records
CATALOGNUMBER : 01101-2
RELEASECOUNTRY : US
DATE : 2001-05-08
TOTALDISCS : 1
disc : 1
TOTALTRACKS : 8
MEDIA : CD
MUSICBRAINZ_TRACKID: aef9824d-e4a6-4ae6-aebe-50a83dd14f71
TITLE : One Thousand Years
MUSICBRAINZ_ARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
ARTIST : Tuu
ARTISTSORT : Tuu
ARTISTS : Tuu
MUSICBRAINZ_RELEASETRACKID: 621c9da6-a85d-3f8b-b485-5e6f74a60cd0
track : 2
TRACKTOTAL : 8
DISCTOTAL : 1
encoder : Lavf58.45.100
Stream #0:0: Video: theora (libtheora), yuv420p(progressive), 600x600 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 90k fps, 90k tbn, 90k tbc (attached pic)
Metadata:
DESCRIPTION : Cover (front)
encoder : Lavc58.91.100 libtheora
GENRE : Tribal / Ambient
ORGANIZATION : Waveform Records
ISRC : 01101-2
MUSICBRAINZ_RELEASEGROUPID: 737d0518-3dc2-36b3-9419-282c0ade0e50
ORIGINALDATE : 1993
ORIGINALYEAR : 1993
RELEASETYPE : album
MUSICBRAINZ_ALBUMID: f6339129-f662-43a1-93df-2f20540f73cc
ALBUM : One Thousand Years
BARCODE : 789060110125
MUSICBRAINZ_ALBUMARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
ALBUMARTIST : Tuu
ALBUMARTISTSORT : Tuu
ASIN : B00005B9TT
SCRIPT : Latn
RELEASESTATUS : official
LABEL : Waveform Records
CATALOGNUMBER : 01101-2
RELEASECOUNTRY : US
DATE : 2001-05-08
TOTALDISCS : 1
DISCNUMBER : 1
TOTALTRACKS : 8
MEDIA : CD
MUSICBRAINZ_TRACKID: aef9824d-e4a6-4ae6-aebe-50a83dd14f71
TITLE : One Thousand Years
MUSICBRAINZ_ARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
ARTIST : Tuu
ARTISTSORT : Tuu
ARTISTS : Tuu
MUSICBRAINZ_RELEASETRACKID: 621c9da6-a85d-3f8b-b485-5e6f74a60cd0
TRACKNUMBER : 2
TRACKTOTAL : 8
DISCTOTAL : 1
Stream #0:1: Audio: vorbis (libvorbis), 44100 Hz, stereo, fltp (16 bit), 500 kb/s
Metadata:
encoder : Lavc58.91.100 libvorbis
GENRE : Tribal / Ambient
ORGANIZATION : Waveform Records
ISRC : 01101-2
DESCRIPTION : US reissue featuring the six original tracks plus two taken from the Invocation album.
MUSICBRAINZ_RELEASEGROUPID: 737d0518-3dc2-36b3-9419-282c0ade0e50
ORIGINALDATE : 1993
ORIGINALYEAR : 1993
RELEASETYPE : album
MUSICBRAINZ_ALBUMID: f6339129-f662-43a1-93df-2f20540f73cc
ALBUM : One Thousand Years
BARCODE : 789060110125
MUSICBRAINZ_ALBUMARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
ALBUMARTIST : Tuu
ALBUMARTISTSORT : Tuu
ASIN : B00005B9TT
SCRIPT : Latn
RELEASESTATUS : official
LABEL : Waveform Records
CATALOGNUMBER : 01101-2
RELEASECOUNTRY : US
DATE : 2001-05-08
TOTALDISCS : 1
DISCNUMBER : 1
TOTALTRACKS : 8
MEDIA : CD
MUSICBRAINZ_TRACKID: aef9824d-e4a6-4ae6-aebe-50a83dd14f71
TITLE : One Thousand Years
MUSICBRAINZ_ARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
ARTIST : Tuu
ARTISTSORT : Tuu
ARTISTS : Tuu
MUSICBRAINZ_RELEASETRACKID: 621c9da6-a85d-3f8b-b485-5e6f74a60cd0
TRACKNUMBER : 2
TRACKTOTAL : 8
DISCTOTAL : 1
frame= 1 fps=0.1 q=-0.0 Lsize= 25860kB time=00:08:03.66 bitrate= 438.0kbits/s speed=44.6x
video:8kB audio:25721kB subtitle:0kB other streams:0kB global headers:7kB muxing overhead: 0.511663%

最佳答案

我想要实现的是流式传输高分辨率无损 flac 文件。我似乎快到了。
这个命令ffmpeg -i input.flac output.ogg制作有损ogg文件。它会大幅缩小尺寸并生成比特率约为 128 k 的文件。
光谱分析显示细节https://prnt.sc/117904c - 相当可怕。所有高于 17 kHz 的声音都永远消失了 + 其他“听不见”的声音也永远消失了。即使使用 -b:a 选项 ffmpeg -i input.flac -b:a 320k output.ogg它仍然是有损文件,只是比特率更高。据我所知,最大 -b:a 是 500k.. 已经非常准确,但仍然是有损文件。
但是这个命令ffmpeg -i input.flac -c:a libvorbis -c:a copy -map 0:a output.ogg确实有效。它将 flac 包装到 ogg 容器中,以便更好地进行流式传输,保持所有无损质量。见 Why is FLAC Streaming over HTTP done with Ogg encapsulation instead of natively?
我似乎终于弄清楚如何将 flac 文件准备为无损高分辨率流。它所需要的只是用这个命令将它们包装到 ogg 容器中。

ffmpeg -i input.flac -c:a libvorbis -c:a copy -map 0:a output.ogg


光谱分析证明它实际上是无损文件,即使它具有 .ogg 扩展名:
这是包装 ogg flac 文件 https://prnt.sc/1178jp4这是原始的flac文件 https://prnt.sc/1178l8h .
现在我需要用多个文件测试它,看看 Icecast 服务器如何处理无损流

关于audio - 从 Flac 到 Ogg 的 ffmpeg 转换会产生损坏的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66975957/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com