我有一个使用recovery_mp4保存下来的mp4
但是音频被破坏了(但是没关系),文件的持续时间长达34小时(应该更接近8h 30m)。当我在mpv中打开视频时,我可以浏览并观看视频(所有8小时30分钟都在那里,可以正常播放),其余时间只是黑屏。
因此,为了提取视频,我使用以下内容通过ffmpeg对其进行了运行:
ffmpeg -i input.mp4 -an -c:v libx264 -crf 18 -preset slow -f mp4 output.mp4
但是5点30分之后,ffmpeg才停止播放。没有错误,这只是完成。因此,我使用此命令回去看看出了什么问题:
ffmpeg -loglevel verbose -ss 05:30:00 -t 00:03:00 -i input.mp4 -an -c copy output.mp4
哪个给了我以下日志,并告诉我“没有更多的输出流可写,结束。”
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'J:\Projects\Recovered\input.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Duration: 34:28:24.70, start: 0.000000, bitrate: 9807 kb/s
Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt470bg/bt709/bt709, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 38945 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 67 kb/s (default)
Metadata:
handler_name : SoundHandler
Output #0, mp4, to 'J:\Projects\Recovered\output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.22.100
Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt470bg/bt709/bt709, left), 1920x1080 (0x0) [SAR 1:1 DAR 16:9], q=2-31, 38945 kb/s, 60 fps, 60 tbr, 15360 tbn, 15360 tbc (default)
Metadata:
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
No more output streams to write to, finishing.e=00:02:58.31 bitrate=47090.3kbits/s speed=4.82x 125x
frame=10921 fps=292 q=-1.0 Lsize= 1035963kB time=00:02:59.98 bitrate=47152.2kbits/s speed=4.81x
video:1035907kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.005471%
Input file #0 (J:\Projects\Recovered\input.mp4):
Input stream #0:0 (video): 10922 packets read (1060899674 bytes);
Input stream #0:1 (audio): 0 packets read (0 bytes);
Total: 10922 packets (1060899674 bytes) demuxed
Output file #0 (J:\Projects\Recovered\output.mp4):
Output stream #0:0 (video): 10921 packets muxed (1060768411 bytes);
Total: 10921 packets (1060768411 bytes) muxed
[AVIOContext @ 000001d426143200] Statistics: 2 seeks, 4050 writeouts
[AVIOContext @ 000001d426143e80] Statistics: 1130774976 bytes read, 1 seeks
现在我很困惑,如果我在视频查看器中打开输入文件,它会全部播放8个小时,但是ffmpeg检测到的视频流比那里的要短。这是我通过检查流持续时间获得的日志:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'J:\Projects\Recovered\input.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Duration: 34:28:24.70, start: 0.000000, bitrate: 9807 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt470bg/bt709/bt709), 1920x1080 [SAR 1:1 DAR 16:9], 38945 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 67 kb/s (default)
Metadata:
handler_name : SoundHandler
stream|duration=20111.950000
stream|duration=20111.915000
因此,据此检测到持续时间约为5h30m。我不确定从现在开始应该采取什么下一步措施,还是不确定ffmpeg为什么告诉我我的信息流比实际短。任何帮助将不胜感激!