搜索 社区服务 统计排行 帮助
  • 5581阅读
  • 5回复

[求助]ffmpeg合并电影用时长的问题

楼层直达
级别: 新手上路
注册时间:
2006-01-15
在线时间:
4小时
发帖:
16
  1. CD /D "%~dp0"
  2. ffmpeg -i "%~dpn1_v.mp4" -vcodec copy -i "%~dpn1_a.m4a" -acodec copy "%~dpn1_enc.mp4"
  3. pause


上面是我用来合并视频音频用的命令,平常合并20分钟左右的片子一般几分钟可以完成,今天用来合并一个3小时电影的时候发现速度极慢,早上10点半开始,到现在只合到5516秒。
求解

补充:求科普这合并原理,开头1000秒的时候几乎是合并1K耗时1秒,现在基本耗时1秒能压好时长1秒,为什么会越来越快呢?
[ 此帖被zeous在2012-04-25 15:40重新编辑 ]

Form Newwise
级别: 新手上路
注册时间:
2006-01-15
在线时间:
4小时
发帖:
16
只看该作者 5楼 发表于: 2012-04-26
使用Mkvtoolmix,选了视频音频,直接点混流后,19秒就成功合并完MKV了,然后尝试用旧ffmpeg转换为MP4的时候,出现错误提示,后见;使用upzyl推荐的mod版本则成功转换了,耗时也在半分钟内。
该版ffmpeg合并视频音频也耗时很短,另有趣的是,MKV转MP4的体积要比合并MP4的体积稍大

引用
D:\zeous\direct264>ffmpeg -i "123.mkv" -vcodec copy -acodec copy "123_enc.mp4"
FFmpeg, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  built on Jan 15 2009 00:33:58, gcc: 4.2.4 [Sherpya]
Input #0, matroska, from '123.mkv':
  Duration: 03:09:33.42, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: h264, yuv420p, 480x272, 23.81 tb(r)
    Stream #0.1: Audio: aac, 48000 Hz, stereo, s16
Output #0, mp4, to '123_enc.mp4':
    Stream #0.0: Video: libx264, yuv420p, 480x272 [PAR 1:1 DAR 30:17], q=2-31, 23.81 tb(c)
    Stream #0.1: Audio: libfaac, 48000 Hz, stereo, s16
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
[NULL @ 0x17cda80]error, non monotone timestamps 432 >= 432
av_interleaved_write_frame(): Error while opening file

Form Newwise
级别: 新手上路
注册时间:
2006-01-15
在线时间:
4小时
发帖:
16
只看该作者 4楼 发表于: 2012-04-26
受教,马上搜这些工具的资料学习下

Form Newwise
级别: 风云使者
注册时间:
2004-01-20
在线时间:
633小时
发帖:
549
只看该作者 3楼 发表于: 2012-04-26
mp4除了ffmpeg(lavf)封装方式外,还有mp4box(GPAC)和l-smash两种,都可以试试

另外有时先用mkvtoolnix封一遍mkv再用ffmpeg/libav转封mp4也能消除一些莫名其妙的问题

此外用于封装的话,ffmpeg还存在mod版本:http://sourceforge.net/projects/direct264/files/Related%20Programs/ffmpeg%20%28demuxer_muxer%20only%29/ffmpeg_git_31792.7z/download

求资源,欢迎PM告知:
Xbox360 Clannad OP原版(WMV格式)
PS3 圣恩传说F / Tales of Graces F OP原版(BIK格式)


CLANNAD游戏OP/ED + TOMOYO after OP 无二次Credits内嵌字幕清晰版
BiliBili站点     AcFun站点

--- Direct264 自编译版 ---

碧之轨迹Nightmare VS风之剑圣 第1战(均无水印):6cn(六间房)   56(我乐)
BGM: Inevitable Struggle (Super Arrange Ver.)

Rockman 9 Rock Medley
级别: 新手上路
注册时间:
2006-01-15
在线时间:
4小时
发帖:
16
只看该作者 2楼 发表于: 2012-04-26
我是合并成PSP可以播放的MP4,所以没有用mkvtoolmix
然后昨天花了6小时合并这个时长3小时的电影,放PSP看了下一切正常,下面是合并前视频音频的信息:
引用
视频
Format                                   : MPEG-4
Format profile                           : JVT
Codec ID                                 : avc1
File size                                : 397 MiB
Duration                                 : 3h 9mn
Overall bit rate                         : 293 Kbps
Encoded date                             : UTC 2012-04-23 08:15:53
Tagged date                              : UTC 2012-04-23 08:15:53

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 3h 9mn
Bit rate                                 : 290 Kbps
Maximum bit rate                         : 1 611 Kbps
Width                                    : 480 pixels
Height                                   : 272 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 23.737 fps
Minimum frame rate                       : 8.000 fps
Maximum frame rate                       : 47.619 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.094
Stream size                              : 393 MiB (99%)
Writing library                          : x264 core 119 r2106

引用
音频
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42
File size                                : 66.1 MiB
Duration                                 : 3h 9mn
Overall bit rate mode                    : Variable
Overall bit rate                         : 48.7 Kbps
Encoded date                             : UTC 2012-04-24 08:07:54
Tagged date                              : UTC 2012-04-24 08:12:51

Audio
ID                                       : 1
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 3h 9mn
Bit rate mode                            : Variable
Bit rate                                 : 48.0 Kbps
Maximum bit rate                         : 75.0 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 63.9 MiB (97%)
Writing library                          : Nero AAC codec 1.5.4.0
Encoding settings                        : -q 0.20 -lc
Encoded date                             : UTC 2012-04-24 08:07:54
Tagged date                              : UTC 2012-04-24 08:12:51

Form Newwise
级别: 风云使者
注册时间:
2004-01-20
在线时间:
633小时
发帖:
549
只看该作者 1楼 发表于: 2012-04-26
大概是源文件的文件头有些特殊的关系?

试过其他方式没?比如mkvtoolnix

求资源,欢迎PM告知:
Xbox360 Clannad OP原版(WMV格式)
PS3 圣恩传说F / Tales of Graces F OP原版(BIK格式)


CLANNAD游戏OP/ED + TOMOYO after OP 无二次Credits内嵌字幕清晰版
BiliBili站点     AcFun站点

--- Direct264 自编译版 ---

碧之轨迹Nightmare VS风之剑圣 第1战(均无水印):6cn(六间房)   56(我乐)
BGM: Inevitable Struggle (Super Arrange Ver.)

Rockman 9 Rock Medley
快速回复

限150 字节
上一个 下一个