emzt
帖子: 10
注册时间: 2012-01-12 0:00

封装MP4

压好的H264源文件×××.264和×××.aac,用ffmpeg合并,命令

代码: 全选

ffmpeg -i xxx.264 -i xxx.aac -vcodec copy -acodec copy xxx.mp4
,结果影音不同步,ffmpeg默认是25FPS,我的源始视频是29.97FPS,现在原始文件和压好的xxx.264都删除了,只有合并的MP4文件了。怎么改MP4文件的FPS到29.97?用mkvtoolnix能转换成MKV,FPS能改成29.97,再用

代码: 全选

cd /d "%~dp0"
ffmpeg -i "%~1" -vcodec copy -acodec copy "%~dpn1.mp4"
就是不能转成MP4了
头像
-o-o-304-o-o-
超级版主
帖子: 640
注册时间: 2010-10-10 20:00
来自: US
联系: 网站

Re: 封装MP4

http://ffmpeg.org/ffmpeg.html#Video-Options

-r[:stream_specifier] fps (input/output,per-stream)’

Set frame rate (Hz value, fraction or abbreviation), (default = 25). For output streams implies -vsync cfr
► 显示剧情透露 En Taro 06!Taro Pie NC Fanclub project始动!聊天用Q群开放中
► 显示剧情透露 胸中有万言,退敌无一策,是谓书生误国"
► 显示剧情透露 前辈们的信念
► 显示剧情透露 妇联招新广告,走过路过可以看看撒
► 显示剧情透露 香芋派,后期菊苣们的一致选择
► 显示剧情透露 众菊苣喜评香芋派
► 显示剧情透露 聊天用工具
头像
dgwxx
管理猿
帖子: 771
注册时间: 2010-09-19 20:42
联系: 网站

Re: 封装MP4

或者找个mp4box重新mux一下就好了:
MP4Box.exe -add "x:\aaa.mp4:fps=29.970" -new "x:\aaa-new.mp4"
日常推 @dgwxx: 基本没什么技术的话题,欢迎没事看看消遣。
► 显示剧情透露 平庸的rip
► 显示剧情透露 “不知道”的五大理由
emzt
帖子: 10
注册时间: 2012-01-12 0:00

Re: 封装MP4

E:\x264\mkv-mp4>ffmpeg -i e:\033.h264 e:\0.h264 -r 29.97
ffmpeg version N-31792-g51fb933, Copyright (c) 2000-2011 the FFmpeg developers
built on Aug 11 2011 23:13:25 with gcc 4.5.2
configuration:
libavutil 51. 11. 1 / 51. 11. 1
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 2. 0 / 53. 2. 0
libswscale 2. 0. 0 / 2. 0. 0
[h264 @ 003886a0] max_analyze_duration 5000000 reached at 5000000
[h264 @ 003886a0] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1)
-> 25.00 (50/2)
Input #0, h264, from 'e:\033.h264':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: h264 (High), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fp
s, 25 tbr, 1200k tbn, 50 tbc
Output #0, h264, to 'e:\0.h264':
Stream #0.0: Video: [0][0][0][0] / 0x0000, yuv420p, 1280x720, q=0-0, 90k tbn
, 25 tbc
Stream mapping:
Stream #0.0 -> #0.0
Encoder (codec id 28) not found for output stream #0.0
怎么改不了,ffmpeg用的是06_taro修改的
头像
06_taro
核心会员
核心会员
帖子: 998
注册时间: 2010-09-22 18:32
来自: United Kingdom
联系: 网站

Re: 封装MP4

timelineeditor.exe --timecode "timecodes.txt" --media-timebase 1001 --media-timescale 30000 "input.mp4" "output.mp4"

[syntax filename="timecodes.txt"]# timecode format v1
Assume 29.970030
0,50000,29.970030
[/syntax]
つまんねー事聞くなよ!

I, personally, for me, believe (obviously sometimes) that my OS choice is right. That's me. I'm not telling you that you should believe it. Learn the facts, and the origins behind the facts, and make up your own damn mind. That's why you have one. (source)

Follow me: @06_taro

304——
为纪念伟大的宇宙史上最强压制304先生,联合国教科文组织决定,将每年的第304天,即平年的10月31日或者闰年的10月30日,定为世界304日。
emzt
帖子: 10
注册时间: 2012-01-12 0:00

Re: 封装MP4

把影音不同步的MP4直接转就好了,谢谢06_taro 的软件和方法,FFMPEG转时这命令

代码: 全选

ffmpeg -i 视频流.avi -i 音频流.mp3 -vcodec copy -acodec copy 合并.mp4 
怎么加options能换用29.97FPS不用默认的?
上次由 emzt 在 2012-03-24 22:34,总共编辑 1 次。
头像
msg7086
帖子: 600
注册时间: 2011-02-19 0:49

Re: 封装MP4

看清楚,mp4
Delogo LGD Collections 各种台标下载 | Home Of VapourSynth Evolution

<回答が無い理由>
1. 誰も知らない
2. 質問文が意味不明
3. 知ってるが、お前の態度が気に入らない
4. 良いボケが思いつかない
emzt
帖子: 10
注册时间: 2012-01-12 0:00

Re: 封装MP4

我刚才转换成功了,回复改慢了。

回到 “封装容器 / Container muxer and demuxer”