gstreamer - 使 GStreamer 正确读取视频信息损坏的 FLV 文件
问题描述
我有一组要使用 GStreamer 播放的 FLV 文件。所有文件的标题/元数据都不正确,如下所示:
https://drive.google.com/file/d/1FcKbYd2-D7ZiIG5VpRxpbqshCixp8iaR/view?usp=sharing
VLC 和 ffplay 都可以使用他们的特殊魔法来播放这个文件。虽然,Mediainfo 显示文件的截断视频信息:
Video
Format : AVC
Format/Info : Advanced Video Codec
Codec ID : 7
Duration : 12 s 633 ms
Frame rate mode : Constant
Frame rate : 60.000 FPS
Bit depth : 8 bits
对于正确的文件,至少有格式配置文件和级别。
gst-discoverer-1.0
根本不想检测视频流:
Properties:
Duration: 0:00:00.116000000
Seekable: yes
Live: no
container: Flash
audio: MPEG-4 AAC
Stream ID: a72c1038e0bf52d7668cb945588d7bca2547bd58212aa7f08db439aeadfcbd95/audio
Language: <unknown>
Channels: 2 (front-left, front-right)
Sample rate: 48000
Depth: 32
Bitrate: 0
Max bitrate: 0
video: H.264
Stream ID: (NULL)
Width: 0
Height: 0
Depth: 0
Frame rate: 0/1
Pixel aspect ratio: 1/1
Interlaced: false
Bitrate: 0
Max bitrate: 0
gst-play-1.0
启动,但显示错误并且不显示预览:
gst-play-1.0.exe "C:\Users\me\Downloads\custom.flv"
Press 'k' to see a list of keyboard shortcuts.
Now playing C:\Users\me\Downloads\custom.flv
WARNING No decoder available for type 'video/x-h264, stream-format=(string)avc, codec_data=(buffer)000000016742c020da014016ec0440000003004000001e03c60ca80000000168ce3c80'.
WARNING debug information: ../gst/playback/gsturidecodebin.c(960): unknown_type_cb (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0
Redistribute latency...
0:00:12.6 / 0:00:12.6
Reached end of play list.
我正在寻找使 GStreamer 正确播放此类文件的任何方法(也许有一些插件允许这样做?)或修复视频标题。
解决方案
使用 FFMPEG 重新混合您的视频文件:
ffmpeg -i custom.flv -c:v copy -c:a copy fixed.flv
推荐阅读
- javascript - 调用 location.reload() 后如何运行附加的 JS 函数?
- angular - 在 Windows nginx 服务器上运行 Angular Springboot 应用程序 - nginx.conf 设置
- javascript - 给定不同的唯一键:值,是否可以使用“=”设置一个对象属性?
- pandas - 如何在pandas groupby之后将行旋转到列
- oracle - 当 Oracle Function 没有输入值时,Spring Boot SimpleJdbcCall 失败
- java - 如何替换特定位置的特殊字符
- mysql - 从一个表中提取记录,其中 1 个变量存在于第二个表中?非常大的桌子
- kotlin - 为什么在 Intellij IDEA 中代码中存在 ENQ/ESA unicode 字符会导致它显示错误的多字符文字错误?
- javascript - 如何在新选项卡中打开链接而不在新选项卡中看到 URL?
- android - 如何使用 Android 28 (Pie) 将 sqlite 数据库直接存储在 sdcard 上