阅读:10062回复:17
分解mkv的问题
我安装了mkvtoolnix,再用MKVextractGUI分解mkv,
但分解出来的音轨和影片都变成.ext, 请问怎样才能把两者合并成AVI ? 另外,不知为何每次用MKVextractGUI分解mkv, 它总是表示"mkvextract cannot extract this kind of file"。 thx! ![]() |
|
|
1楼#
发布于:2010-03-30 14:14
通过ffmpeg转换过的mp4等一些特殊编码格式是需要播放器调用ffmpeg内置的解码器来解码播放的
我一直在怀疑是否aac格式的音频解码器与您系统中其他相同格式的解码器冲突导致出现错误 试试卸载系统中其他已安装的集成解码包,单独剩余一个ffmpeg 或者先试试ffmpeg的内置播放器,终端命令行下ffplay filename.mkv看看终端输出,如果正常的话,那么将其他的解码包卸载了,再进行或转码或切割 至于你的另外问题,直接输出newfilename.mkv即可,avi与mkv都是一种封装容器(mkv封装的形式与格式相对较多),播放的时候均通过调用其音视频编码的解码器来解码播放的,所以别太在意后缀格式,只要编码一样,尺寸一样,码率一样,那么输出的avi与mkv其实也是一样的,当然体积也是一样的 |
|
2楼#
发布于:2010-03-30 14:14
刚才用了新的命令行,试了几遍,还是有点问题。
Big.mkv--->Big.avi 成功,音频是mp3 Daniel.mkv--->Daniel_2.avi 还是失败,音频是AAC 试了一个音频是AAC的mp4,可以成功分割成mp4,但转不了avi。(会黑画面) 另外,请问如果只是想分割.mkv,而不转换为.avi,应下怎样的命令行? ![]() (退而求其次,用mkv算了~~~~:twisted:) ----------------------------------------------------------- C:\Documents and Settings\Administrator>cd c:\f\bin C:\F\bin>ffmpeg -ss 00:01:10 -t 00:00:30 -i C:\Download\Daniel.mkv -vcodec copy -acodec copy C:\Download\Daniel_2.avi FFmpeg version SVN-r22716, Copyright (c) 2000-2010 the FFmpeg developers built on Mar 29 2010 06:05:44 with gcc 4.4.2 configuration: --enable-memalign-hack --cross-prefix=i686-mingw32- --cc=ccache -i686-mingw32-gcc --arch=i686 --target-os=mingw32 --enable-runtime-cpudetect --e nable-avisynth --enable-gpl --enable-version3 --enable-bzlib --enable-libgsm --e nable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheora --enable-l ibspeex --enable-libmp3lame --enable-libopenjpeg --enable-libxvid --enable-libsc hroedinger --enable-libx264 --enable-libopencore_amrwb --enable-libopencore_amrn b libavutil 50.13. 0 / 50.13. 0 libavcodec 52.61. 0 / 52.61. 0 libavformat 52.58. 0 / 52.58. 0 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0.10. 0 / 0.10. 0 [matroska @ 003dc280]Estimating duration from bitrate, this may be inaccurate Seems stream 0 codec frame rate differs from container frame rate: 47.95 (48000/ 1001) -> 24.00 (24/1) Input #0, matroska, from 'C:\Download\Daniel.mkv': Metadata: title : Wolverine Duration: 00:03:50.73, start: 0.000000, bitrate: N/A Stream #0.0: Video: h264, yuv420p, 640x480, PAR 1:1 DAR 4:3, 24.39 fps, 24 t br, 1k tbn, 47.95 tbc Metadata: title : Daniel_Powter_-_Bad_Day Stream #0.1: Audio: aac, 48000 Hz, stereo, s16 Output #0, avi, to 'C:\Download\Daniel_2.avi': Metadata: ISFT : Lavf52.58.0 Stream #0.0: Video: libx264, yuv420p, 640x480 [PAR 1:1 DAR 4:3], q=2-31, 23. 98 tbn, 23.98 tbc Metadata: title : Daniel_Powter_-_Bad_Day Stream #0.1: Audio: aac, 48000 Hz, stereo Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 Press [q] to stop encoding [avi @ 01f90050]st:0 error, pts < dts av_interleaved_write_frame(): Error number -1 occurred C:\F\bin> |
|
|
3楼#
发布于:2010-03-30 14:14
ffmpeg -ss 00:01:10 -t 00:00:30 -i C:\Download\Big.mkv -vcodec copy -acodec copy C:\Download\Big_2.avi
你命令行错掉了 uc.mp4是我的文件( ̄▽ ̄)" |
|
4楼#
发布于:2010-03-30 14:14
还是不行,按"y"就会把原档案清空变为0KB,按"n"就没有反应。
![]() 今次的音频是mp3,而取用ACC的那个影片也是相同结果。 C:\F\bin>ffmpeg C:\Download\Big.mkv -ss 00:01:10 -t 00:00:30 -i uc.mp4 -vcodec c opy -acodec copy et.mp4 FFmpeg version SVN-r22716, Copyright (c) 2000-2010 the FFmpeg developers built on Mar 29 2010 06:05:44 with gcc 4.4.2 configuration: --enable-memalign-hack --cross-prefix=i686-mingw32- --cc=ccache -i686-mingw32-gcc --arch=i686 --target-os=mingw32 --enable-runtime-cpudetect --e nable-avisynth --enable-gpl --enable-version3 --enable-bzlib --enable-libgsm --e nable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheora --enable-l ibspeex --enable-libmp3lame --enable-libopenjpeg --enable-libxvid --enable-libsc hroedinger --enable-libx264 --enable-libopencore_amrwb --enable-libopencore_amrn b libavutil 50.13. 0 / 50.13. 0 libavcodec 52.61. 0 / 52.61. 0 libavformat 52.58. 0 / 52.58. 0 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0.10. 0 / 0.10. 0 File 'C:\Download\Big.mkv' already exists. Overwrite ? [y/N] n Not overwriting - exiting C:\F\bin> ---------------------------------------------------- File 'C:\Download\Big.mkv' already exists. Overwrite ? [y/N] y uc.mp4: Error number -2 occurred ------------------------------------------------- 档案规格, General Complete name : C:\Download\Big.mkv Format : Matroska File size : 17.5 MiB Duration : 2mn 42s Overall bit rate : 903 Kbps Encoded date : UTC 2010-03-31 13:45:03 Writing application : mkvmerge v3.3.0 ('Language') 编译于 Mar 24 2010 14:59:24 Writing library : libebml v0.8.0 + libmatroska v0.9.0 Video ID : 1 Format : MPEG-4 Visual Format profile : Advanced Simple@L5 Format settings, BVOP : Yes Format settings, QPel : No Format settings, GMC : No warppoints Format settings, Matrix : Default (H.263) Codec ID : XVID Codec ID/Hint : XviD Duration : 2mn 42s Width : 640 pixels Height : 352 pixels Display aspect ratio : 16:9 Frame rate : 25.000 fps Resolution : 8 bits Colorimetry : 4:2:0 Scan type : Progressive Writing library : XviD 1.1.2 (UTC 2006-11-01) Audio ID : 2 Format : MPEG Audio Format version : Version 1 Format profile : Layer 3 Format_Settings_Mode : Joint stereo Format_Settings_ModeExtension : MS Stereo Codec ID : A_MPEG/L3 Codec ID/Hint : MP3 Duration : 2mn 42s Bit rate mode : Variable Channel(s) : 2 channels Sampling rate : 44.1 KHz |
|
|
5楼#
发布于:2010-03-30 14:14
aac音频,显然mencoder没有认出来,不知道mencoder的win编译版编译时的库依赖参数是什么
楼主试试上面坛友的命令 |
|
6楼#
发布于:2010-03-30 14:14
http://ffmpeg.arrozcru.org/autobuilds/
ffmpeg的win编译版本,解码器编译进exe的版本 ffmpeg -ss 00:10:10 -t 00:00:30 -i uc.mp4 -vcodec copy -acodec copy et.mp4 -ss 是开始时间 -t 注意不是结束时间,是截取的整个时间长度 |
|
7楼#
发布于:2010-03-30 14:14
havanna:你能告诉我你视频音频的编码是什么吗?回到原帖 mediainfo 结果: General Complete name : C:\Download\Daniel.mkv Format : Matroska File size : 59.6 MiB Duration : 3mn 50s Overall bit rate : 2 166 Kbps Movie name : Wolverine Encoded date : UTC 2008-11-08 01:51:18 Writing application : mkvmerge v2.3.0 ('Freak U') built on Sep 21 2008 16:34:10 Writing library : libebml v0.7.7 + libmatroska v0.8.1 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4.1 Format settings, CABAC : Yes Format settings, ReFrames : 8 frames Muxing mode : Container profile=Unknown@4.1 Codec ID : V_MPEG4/ISO/AVC Duration : 3mn 50s Nominal bit rate : 2 000 Kbps Width : 640 pixels Height : 480 pixels Display aspect ratio : 4:3 Frame rate : 23.976 fps Resolution : 8 bits Colorimetry : 4:2:0 Scan type : Progressive Bits/(Pixel*Frame) : 0.272 Title : Daniel_Powter_-_Bad_Day Writing library : x264 core 65 r999 cc51047 Encoding settings : cabac=1 / ref=8 / deblock=1:-2:-1 / analyse=0x3:0x113 / me=umh / subme=7 / psy_rd=1.0:1.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-4 / threads=3 / nr=0 / decimate=1 / mbaff=0 / bframes=6 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=2000 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=25000 / vbv_bufsize=14000 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00 Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format version : Version 4 Format profile : LC Format settings, SBR : No Codec ID : A_AAC Duration : 3mn 50s Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz |
|
|
8楼#
发布于:2010-03-30 14:14
你能告诉我你视频音频的编码是什么吗?
|
|
9楼#
发布于:2010-03-30 14:14
-oac pcm...
问题应该出在解码器上 安装下ffmpeg插件试下 我刚才试过,没问题 $ mencoder Cars.2006.汽车总动员.双语字幕.HR-HDTV.AC3.1024X576.x264-人人影视制作.mkv -ovc copy -oac copy -ss 0:00 -endpos 1:00 -o 2.avi MEncoder SVN-r30886-4.4.3 (C) 2000-2010 MPlayer Team 150 audio & 335 video codecs success: format: 0 data: 0x0 - 0x6cb8d916 [mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0 [mkv] Track ID 2: audio (A_AC3), -aid 0, -alang und [mkv] Will play video track 1. Matroska file format detected. VIDEO: [avc1] 1024x576 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s) [V] filefmt:31 fourcc:0x31637661 size:1024x576 fps:23.976 ftime:=0.0417 ========================================================================== Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000) Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3) ========================================================================== videocodec: framecopy (1024x576 24bpp fourcc=31637661) audiocodec: framecopy (format=2000 chans=2 rate=48000 bits=16 B/s=48000 sample-1) Writing header... ODML: Aspect information not (yet?) available or unspecified, not writing vprp header. Writing header... ODML: Aspect information not (yet?) available or unspecified, not writing vprp header. Writing index...39f ( 0%) 0.00fps Trem: 0min 1737mb A-V:0.073 [684:384] Writing header... ODML: Aspect information not (yet?) available or unspecified, not writing vprp header. Video stream: 684.774 kbit/s (85596 B/s) size: 5137373 bytes 60.018 secs 1439 frames Audio stream: 384.000 kbit/s (48000 B/s) size: 2880000 bytes 60.000 secs |
|
10楼#
发布于:2010-03-30 14:14
C:\M>
C:\M>mencoder C:\Download\Daniel.mkv -ovc copy -oac copy -o newfilename.avi -ss 0:00 -endpos 1:00 MEncoder Sherpya-SVN-r30945-4.2.5 (C) 2000-2010 MPlayer Team 150 audio & 343 video codecs success: format: 0 data: 0x0 - 0x3b95d2e [mkv] Track ID 1: video (V_MPEG4/ISO/AVC) "Daniel_Powter_-_Bad_Day", -vid 0 [mkv] Track ID 2: audio (A_AAC), -aid 0, -alang und [mkv] Will play video track 1. Matroska file format detected. VIDEO: [avc1] 640x480 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s) [V] filefmt:31 fourcc:0x31637661 size:640x480 fps:23.976 ftime:=0.0417 videocodec: framecopy (640x480 24bpp fourcc=31637661) Audio format 0x4134504d is incompatible with '-oac copy', please try '-oac pcm' instead or use '-fafmttag' to override it. Exiting... C:\M> 砍不了.....问题好像出在'-oac copy', 我改用'-oac pcm'後,虽然能分割,但是得出来的档案只有杂音,没有画面。 而改用'-fafmttag'即分割不了影片。 抽取mkv方面,也同样栽在"'-oac copy'上。 ![]() |
|
|
11楼#
发布于:2010-03-30 14:14
切割也很简单,加上时间码参数
-ss start -endpos end 如果尽想切换其中的片断而不做音视频转码的话,那么无须分离音视频,直接切割即可 mencoder filename -ovc copy -oac copy -o newfilename.avi -ss 0:00 -endpos 3:00 |
|
12楼#
发布于:2010-03-30 14:14
|
|
13楼#
发布于:2010-03-30 14:14
mencoder的命令
你下一个mplayer会带的 mkvmerge有切割功能,mkvtoolnix有附带的 |
|
14楼#
发布于:2010-03-30 14:14
看不懂程式码
![]() 其实我有一个 MKV档,体积蛮大(1GB以上), 但我只想要某几段的片段,所以想在不损品质下把它分离後组成AVI, 再用VirtualDub分割需要的片段。 |
|
|
上一页
下一页