gpt4 book ai didi

linux - ffprobe 报告一些错误的元数据,但仅在输入管道输入时

转载 作者:行者123 更新时间:2023-12-04 23:07:36 24 4
gpt4 key购买 nike

我有一个视频文件,我正在使用 ffprobe从中提取元数据。如果我将文件保存到磁盘并运行 ffprobe一切正常。但是,如果我将输入通过管道传输到 ffprobe大多数元数据是正确的,但有些字段,例如 width , height , display_aspect_ratio不正确。 ffprobe当输入是流时报告这些错误(请参阅下面的完整输出):

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x563c3de3c000] stream 1, offset 0x2c: partial file[mov,mp4,m4a,3gp,3g2,mj2 @ 0x563c3de3c000] Could not find codec parameters for stream 0 (Video: mpeg4 (mp4v / 0x7634706D), none, 1567 kb/s): unspecified sizeConsider increasing the value for the 'analyzeduration' and 'probesize' options


我尝试了 analyzeduration 的各种设置和 probesize结果没有变化。我尝试将其他更大的 MP4 文件通过管道传输到 ffprobe 中,并且正确报告了高度和宽度,并且我没有收到“流 1,偏移量 0x2c:部分文件”输出警告。我认为这个特定文件可能存在一些问题,但如果是这种情况,为什么它只会在文件流式传输时引起问题?
任何想法是什么问题以及如何获得 ffprobe与文件输入一样使用管道?
带文件:
> ffprobe -show_streams camera-test.mp4 
ffprobe version 4.1.6-1~deb10u1 Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'camera-test.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf58.35.101
Duration: 00:00:05.74, start: 0.000000, bitrate: 1650 kb/s
Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 720x1280 [SAR 1:1 DAR 9:16], 1567 kb/s, 30 fps, 30 tbr, 15360 tbn, 30 tbc (default)
Metadata:
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 121 kb/s (default)
Metadata:
handler_name : SoundHandle
[STREAM]
index=0
codec_name=mpeg4
codec_long_name=MPEG-4 part 2
profile=Simple Profile
codec_type=video
codec_time_base=1/30
codec_tag_string=mp4v
codec_tag=0x7634706d
width=720
height=1280
coded_width=720
coded_height=1280
has_b_frames=0
sample_aspect_ratio=1:1
display_aspect_ratio=9:16
pix_fmt=yuv420p
level=1
...
带 pipe :
> ffprobe -show_streams "pipe:0"  <camera-test.mp4 
ffprobe version 4.1.6-1~deb10u1 Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x563c3de3c000] stream 1, offset 0x2c: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x563c3de3c000] Could not find codec parameters for stream 0 (Video: mpeg4 (mp4v / 0x7634706D), none, 1567 kb/s): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:0':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf58.35.101
Duration: 00:00:05.74, start: 0.000000, bitrate: N/A
Stream #0:0(eng): Video: mpeg4 (mp4v / 0x7634706D), none, 1567 kb/s, SAR 1:1 DAR 0:0, 30 fps, 30 tbr, 15360 tbn, 15360 tbc (default)
Metadata:
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 121 kb/s (default)
Metadata:
handler_name : SoundHandle
[STREAM]
index=0
codec_name=mpeg4
codec_long_name=MPEG-4 part 2
profile=unknown
codec_type=video
codec_time_base=1/30
codec_tag_string=mp4v
codec_tag=0x7634706d
width=0
height=0
coded_width=0
coded_height=0
has_b_frames=0
sample_aspect_ratio=1:1
display_aspect_ratio=0:0
pix_fmt=unknown
level=-99
...
两个输出之间的完全差异:
< profile=unknown
---
> profile=Simple Profile
10,13c10,13
< width=0
< height=0
< coded_width=0
< coded_height=0
---
> width=720
> height=1280
> coded_width=720
> coded_height=1280
16,18c16,18
< display_aspect_ratio=0:0
< pix_fmt=unknown
< level=-99
---
> display_aspect_ratio=9:16
> pix_fmt=yuv420p
> level=1
62c62
< profile=unknown
---
> profile=LC

最佳答案

Mp4 在 moov 框中编码此信息。 moov 框可以在文件的开头或结尾。对于 moov 开头的文件,管道将起作用。对于末尾的文件,您将需要探测文件的每个字节。
或者您可以使用 faststart 重新打包文件以强制 moov 到前面。

关于linux - ffprobe 报告一些错误的元数据,但仅在输入管道输入时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62946707/

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