大家帮我看一下 ffmpeg 转码为什么会失败?

2016-10-17 20:39:58 +08:00
 gushengren

这是命令行显示的内容: D:\Program Files>ffmpeg -i f:\ts\video.ts -acodec copy -vcodec copy f:\ts\xxx.mp 4 FFmpeg version SVN-r21753, Copyright (c) 2000-2010 Fabrice Bellard, et al. built on Feb 11 2010 06:02:41 with gcc 4.4.2 configuration: --enable-memalign-hack --cross-prefix=i686-mingw32- --cc=ccache -i686-mingw32-gcc --target-os=mingw32 --enable-avisynth --enable-gpl --enable-ve rsion3 --enable-bzlib --enable-libgsm --enable-libfaad --enable-pthreads --enabl e-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --enable-li bopenjpeg --enable-libxvid --enable-libschroedinger --enable-libx264 --enable-li bopencore_amrwb --enable-libopencore_amrnb libavutil 50. 9. 0 / 50. 9. 0 libavcodec 52.53. 0 / 52.53. 0 libavformat 52.52. 0 / 52.52. 0 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0.10. 0 / 0.10. 0 [mpegts @ 015ebd40]max_analyze_duration reached [NULL @ 014f25b0]start time is not set in av_estimate_timings_from_pts

Seems stream 1 codec frame rate differs from container frame rate: 59.94 (2997/5

  1. -> 29.97 (30000/1001) Input #0, mpegts, from 'f:\ts\video.ts': Duration: 01:53:43.12, start: 0.000000, bitrate: 2090 kb/s Program 1 Stream #0.0[0x102]: Data: 0x0015 Stream #0.1[0x100]: Video: h264, yuv420p, 720x404 [PAR 1:1 DAR 180:101], 29. 97 fps, 29.97 tbr, 90k tbn, 59.94 tbc Stream #0.2[0x101]: Audio: aac, 44100 Hz, 2 channels, s16, 127 kb/s Output #0, mp4, to 'f:\ts\xxx.mp4': Stream #0.0: Video: libx264, yuv420p, 720x404 [PAR 1:1 DAR 180:101], q=2-31, 2997 tbn, 29.97 tbc Stream #0.1: Audio: aac, 44100 Hz, 2 channels, 127 kb/s Stream mapping: Stream #0.1 -> #0.0 Stream #0.2 -> #0.1 Press [q] to stop encoding [mp4 @ 033b0050]st:0 error, non monotone timestamps 2400 >= 2400 av_interleaved_write_frame(): Error while opening file
3158 次点击
所在节点    问与答
14 条回复
264768502
2016-10-17 20:52:59 +08:00
试试先把 ts 丢进 mkvtoolnix 转成 mkv
然后再用 ffmpeg 转 mp4 呢
gushengren
2016-10-17 20:55:39 +08:00
@264768502 兄弟谢谢你的回答,但是你的回答不是我要问的问题
pmpio
2016-10-17 21:00:45 +08:00
我感觉 mencoder 对各种不规范视频文件的兼容性要比 ffmpeg 好得多。
Esec
2016-10-17 21:08:18 +08:00
> built on Feb 11 2010 06:02:41 with gcc 4.4.2
😅 → https://ffmpeg.org/download.html#build-windows
gushengren
2016-10-17 21:12:48 +08:00
> built on Feb 11 2010 06:02:41 with gcc 4.4.2 你这一串是什么意思
gushengren
2016-10-17 21:13:07 +08:00
DoraJDJ
2016-10-17 21:18:44 +08:00
@gushengren 版本太旧。
gushengren
2016-10-17 21:22:57 +08:00
@DoraJDJ https://ffmpeg.org/download.html#build-windows 这里下的压缩包里面没有 ffmpeg.exe ,我不会用
nlzy
2016-10-17 21:28:06 +08:00
@gushengren 选 static ,解压出来就有 ffmpeg.exe 啊
264768502
2016-10-17 21:37:43 +08:00
大多数情况下是你的 ts 流有问题
gushengren
2016-10-17 23:36:02 +08:00
@264768502 TS 文件可以正常播放啊,应该可以转码才对啊
1stlulu
2016-10-18 01:18:57 +08:00
楼主确定你把音频编码和视频编码都拷贝之后得到的 mp4 能播放吗?
msg7086
2016-10-18 06:39:17 +08:00
@gushengren 可以播放 != 可以转码。
(当然你这也不是在转码而是在重新封装。)

@1stlulu h264+aac ,目测是可以的。
wwqgtxx
2016-10-18 07:26:31 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/313411

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX