ffmpeg -loglevel debug -report -i recordUnity3D.mov -acodec libfaac -b:a 128k -vcodec libx264 -b:v 1200k -r 24 -flags +aic+mv4 -pix_fmt yuv420p -threads 0 -y output.mp4 | |
ffmpeg started on 2014-09-13 at 23:11:04 | |
Report written to "ffmpeg-20140913-231104.log" | |
ffmpeg version 2.3.2 Copyright (c) 2000-2014 the FFmpeg developers | |
built on Aug 14 2014 07:21:22 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) | |
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid | |
libavutil 52. 92.100 / 52. 92.100 | |
libavcodec 55. 69.100 / 55. 69.100 | |
libavformat 55. 48.100 / 55. 48.100 | |
libavdevice 55. 13.102 / 55. 13.102 | |
libavfilter 4. 11.100 / 4. 11.100 | |
libavresample 1. 3. 0 / 1. 3. 0 | |
libswscale 2. 6.100 / 2. 6.100 | |
libswresample 0. 19.100 / 0. 19.100 | |
libpostproc 52. 3.100 / 52. 3.100 | |
Splitting the commandline. | |
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. | |
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. | |
Reading option '-i' ... matched as input file with argument 'recordUnity3D.mov'. | |
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'libfaac'. | |
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '128k'. | |
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'. | |
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '1200k'. | |
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '24'. | |
Reading option '-flags' ... matched as AVOption 'flags' with argument '+aic+mv4'. | |
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'. | |
Reading option '-threads' ... matched as AVOption 'threads' with argument '0'. | |
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'. | |
Reading option 'output.mp4' ... matched as output file. | |
Finished splitting the commandline. | |
Parsing a group of options: global . | |
Applying option loglevel (set logging level) with argument debug. | |
Applying option report (generate a report) with argument 1. | |
Applying option y (overwrite output files) with argument 1. | |
Successfully parsed a group of options. | |
Parsing a group of options: input file recordUnity3D.mov. | |
Successfully parsed a group of options. | |
Opening an input file: recordUnity3D.mov. | |
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9243018800] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 | |
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9243018800] ISO: File Type Major Brand: qt | |
rfps: 29.916667 0.006601 | |
rfps: 29.916667 0.010607 | |
rfps: 30.000000 0.001906 | |
rfps: 30.083333 0.009568 | |
rfps: 59.916667 0.012483 | |
rfps: 60.000000 0.007623 | |
rfps: 60.000000 0.017827 | |
rfps: 29.970030 0.002172 | |
rfps: 29.970030 0.013362 | |
rfps: 59.940060 0.008686 | |
rfps: 59.940060 0.011075 | |
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9243018800] Before avformat_find_stream_info() pos: 3151401 bytes read:56656 seeks:1 | |
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9243018800] All info found | |
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9243018800] After avformat_find_stream_info() pos: 48962 bytes read:122192 seeks:2 frames:49 | |
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'recordUnity3D.mov': | |
Metadata: | |
major_brand : qt | |
minor_version : 0 | |
compatible_brands: qt | |
creation_time : 2014-09-12 08:16:31 | |
Duration: 00:00:29.08, start: 0.000998, bitrate: 867 kb/s | |
Stream #0:0(und), 1, 1/600: Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1136x640, 1/1200, 805 kb/s, SAR -1:1 DAR -71:40, 29.85 fps, 30 tbr, 600 tbn, 1200 tbc (default) | |
Metadata: | |
rotate : -0 | |
creation_time : 2014-09-12 08:16:31 | |
handler_name : Core Media Data Handler | |
encoder : H.264 | |
Side data: | |
displaymatrix: rotation of 0.00 degrees | |
Stream #0:1(und), 48, 1/44100: Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s (default) | |
Metadata: | |
creation_time : 2014-09-12 08:16:31 | |
handler_name : Core Media Data Handler | |
Successfully opened the file. | |
Parsing a group of options: output file output.mp4. | |
Applying option acodec (force audio codec ('copy' to copy stream)) with argument libfaac. | |
Applying option b:a (video bitrate (please use -b:v)) with argument 128k. | |
Applying option vcodec (force video codec ('copy' to copy stream)) with argument libx264. | |
Applying option b:v (video bitrate (please use -b:v)) with argument 1200k. | |
Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 24. | |
Applying option pix_fmt (set pixel format) with argument yuv420p. | |
Successfully parsed a group of options. | |
Opening an output file: output.mp4. | |
Successfully opened the file. | |
detected 8 logical cores | |
[graph 0 input from stream 0:0 @ 0x7f92427003a0] Setting 'video_size' to value '1136x640' | |
[graph 0 input from stream 0:0 @ 0x7f92427003a0] Setting 'pix_fmt' to value '0' | |
[graph 0 input from stream 0:0 @ 0x7f92427003a0] Setting 'time_base' to value '1/600' | |
[graph 0 input from stream 0:0 @ 0x7f92427003a0] Setting 'pixel_aspect' to value '-1/1' | |
[buffer @ 0x7f92427002a0] Value -1.000000 for parameter 'pixel_aspect' out of range [0 - 1.79769e+308] | |
Last message repeated 1 times | |
[graph 0 input from stream 0:0 @ 0x7f92427003a0] Setting 'sws_param' to value 'flags=2' | |
[graph 0 input from stream 0:0 @ 0x7f92427003a0] Setting 'frame_rate' to value '30/1' | |
[buffer @ 0x7f92427002a0] Value -1.000000 for parameter 'pixel_aspect' out of range [0 - 1.79769e+308] | |
Last message repeated 1 times | |
[buffer @ 0x7f92427002a0] Error setting option pixel_aspect to value -1/1. | |
[graph 0 input from stream 0:0 @ 0x7f92427003a0] Error applying options to the filter. | |
Error opening filters! | |
[AVIOContext @ 0x7f9242602120] Statistics: 0 seeks, 0 writeouts | |
[AVIOContext @ 0x7f9242501c20] Statistics: 122192 bytes read, 2 seeks |
ffprobe recordUnity3D(已转换).mov | |
ffprobe version 2.3.2 Copyright (c) 2007-2014 the FFmpeg developers | |
built on Aug 14 2014 07:21:22 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) | |
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid | |
libavutil 52. 92.100 / 52. 92.100 | |
libavcodec 55. 69.100 / 55. 69.100 | |
libavformat 55. 48.100 / 55. 48.100 | |
libavdevice 55. 13.102 / 55. 13.102 | |
libavfilter 4. 11.100 / 4. 11.100 | |
libavresample 1. 3. 0 / 1. 3. 0 | |
libswscale 2. 6.100 / 2. 6.100 | |
libswresample 0. 19.100 / 0. 19.100 | |
libpostproc 52. 3.100 / 52. 3.100 | |
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'recordUnity3D(已转换).mov': | |
Metadata: | |
major_brand : qt | |
minor_version : 0 | |
compatible_brands: qt | |
creation_time : 2014-09-12 09:24:23 | |
encoder : Mac OS X v? (AVF 651.12.1, CM 1273.54, x86_64) | |
encoder-eng : Mac OS X v? (AVF 651.12.1, CM 1273.54, x86_64) | |
Duration: 00:00:29.08, start: 0.000000, bitrate: 2484 kb/s | |
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 1136x640 [SAR 1:1 DAR 71:40], 2419 kb/s, 29.71 fps, 30 tbr, 600 tbn, 1200 tbc (default) | |
Metadata: | |
creation_time : 2014-09-12 09:24:23 | |
handler_name : Core Media Data Handler | |
encoder : H.264 | |
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s (default) | |
Metadata: | |
creation_time : 2014-09-12 09:24:23 | |
handler_name : Core Media Data Handler |
ffprobe recordUnity3D.mov | |
ffprobe version 2.3.2 Copyright (c) 2007-2014 the FFmpeg developers | |
built on Aug 14 2014 07:21:22 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) | |
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid | |
libavutil 52. 92.100 / 52. 92.100 | |
libavcodec 55. 69.100 / 55. 69.100 | |
libavformat 55. 48.100 / 55. 48.100 | |
libavdevice 55. 13.102 / 55. 13.102 | |
libavfilter 4. 11.100 / 4. 11.100 | |
libavresample 1. 3. 0 / 1. 3. 0 | |
libswscale 2. 6.100 / 2. 6.100 | |
libswresample 0. 19.100 / 0. 19.100 | |
libpostproc 52. 3.100 / 52. 3.100 | |
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'recordUnity3D.mov': | |
Metadata: | |
major_brand : qt | |
minor_version : 0 | |
compatible_brands: qt | |
creation_time : 2014-09-12 08:16:31 | |
Duration: 00:00:29.08, start: 0.000998, bitrate: 867 kb/s | |
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1136x640, 805 kb/s, SAR -1:1 DAR -71:40, 29.85 fps, 30 tbr, 600 tbn, 1200 tbc (default) | |
Metadata: | |
rotate : -0 | |
creation_time : 2014-09-12 08:16:31 | |
handler_name : Core Media Data Handler | |
encoder : H.264 | |
Side data: | |
displaymatrix: rotation of 0.00 degrees | |
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s (default) | |
Metadata: | |
creation_time : 2014-09-12 08:16:31 | |
handler_name : Core Media Data Handler |
![]() |
1
icylord 2014-09-14 11:07:24 +08:00
如果用 mplayerx 或者 movist 播放正常不
|
![]() |
2
DylanRing0 2014-09-14 12:25:01 +08:00
在Windows上用FFMS导入视频走x264转码OK
AVS如下: LoadPlugin("D:\Program Files (x86)\PressTools\MeGUI_2418_x86\tools\ffms\ffms2.dll") FFVideoSource("D:\recordUnity3D.mov", fpsnum=29853, fpsden=1000, threads=1) Turn180() FlipHorizontal() 输出视频(已用mmg合并音频): https://onedrive.live.com/redir?resid=D4FF896B9B126B5!478&authkey=!AFkla6JCqWJBBK8&ithint=file%2cmkv |
![]() |
3
DylanRing0 2014-09-14 12:28:03 +08:00
在非Windows平台做这种事,还是开个Wine跑AVS用Windows的那套方法吧
这里头坑太多,稍有不慎就被坑 |
![]() |
4
seki 2014-09-14 13:13:14 +08:00 via Android
谁写的负数的 sar 和 dar………
用封装工具比如 mkvtoolnix 换成正的再去转码吧…… |
![]() |
5
zeayes OP @DylanRing0 难道是差什么解码库?
|
![]() |
10
msg7086 2014-09-14 20:54:22 +08:00 via iPhone
有没有手动指定sar/par的功能?
|
![]() |
11
seki 2014-09-14 21:25:02 +08:00
@zeayes 哦,看到了,自己试了一下的确 ffmpeg 无力,但是发现用 x264 (win32 jeeb 编译版)是能顺利视频转码的
|
15
ctexlive 2014-09-15 01:18:06 +08:00
我觉得可以用mencoder解码,再用ffmpeg播放,或者干脆用mencoder编码。
|
16
ctexlive 2014-09-15 01:18:30 +08:00
我觉得可以用mencoder解码,再用ffmpeg编码,或者干脆用mencoder解编码。
|
17
ctexlive 2014-09-15 05:58:19 +08:00 ![]() ---------------方法
mencoder -flip -ofps 29.853 -ovc x264 -ffourcc H264 -x264encopts bitrate=800:threads=auto -oac faac -faacopts br=64 -channels 2 -o temp.avi recordUnity3D.mov ffmpeg -i temp.avi -acodec copy -vn temp.aac ffmpeg -i temp.avi -vcodec copy -an temp.h264 MP4Box temp.mp4 -add temp.h264 -fps 29.853 -add temp.aac ---------------- |
19
ctexlive 2014-09-15 14:42:33 +08:00
-flip 是让你的视频翻转回来.你的视频本身就是倒的
|
20
ctexlive 2014-09-15 14:51:47 +08:00
mencoder只能导出avi,这个avi只有mplayer才能支持.必须音视频轨道分离后再封装成其他格式(mp4,mkv).
选择ffmpeg分离是因为速度快且兼容性好. 不建议用mencoder和mplayer分离(有点兼容性问题). 封装mp4最好用mp4box或者MP4cteater,最标准,兼容性好. (用ffmpeg和mencoder也能封装mp4,不推荐) 注意为了保证音视频同步,一定要注意必须指定 帧率.(mencoder的 ofps 和 mp4box的 -fps). ps. 其实还有一个更方便的gui编码工具,https://handbrake.fr/ 专门制作mp4和mkv的视频. 编码速度相比mencoder稍微慢点点. |
![]() |
21
zeayes OP |
![]() |
24
zeayes OP ![]() @Akagi201
# libavutil/opt.c:188 if (o->min > num && strcmp(o->name, "pixel_aspect") == 0) { num = abs(num); } |
25
keery 2014-10-17 15:31:27 +08:00
按你的方法可以把视频转换,但是转换后视频是倒着的,需要倒转,请问应该如何实现呢?
|