Overclock.net banner

Encoding .mkv with FFMPEG

19078 Views 14 Replies 6 Participants Last post by  error10
So I have a video that is a Matroska file (.mkv) and I wanted to encode it to something (probably a .avi) using the lossless FFV1 and I've used FFMPEG before and so I thought I'd try it again.

So I opened up a terminal and ran

Code:

Code:
ffmpeg -i 17.mkv -vcodec ffv1 -an 17.avi
and I got the output of

Code:

Code:
FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-pp --enable-swscaler --enable-x11grab --prefix=/usr --enable-libgsm --enable-libtheora --enable-libvorbis --enable-pthreads --disable-strip --enable-libfaad --enable-libfaadbin --enable-liba52 --enable-liba52bin --enable-libdc1394 --disable-armv5te --disable-armv6 --disable-altivec --disable-vis --enable-shared --disable-static
  libavutil version: 49.6.0
  libavcodec version: 51.50.0
  libavformat version: 52.7.0
  libavdevice version: 52.0.0
  built on Oct  3 2008 22:40:31, gcc: 4.3.2
[matroska @ 0xb7fe1388]Ignoring seekhead entry for ID=0x1549a966
[matroska @ 0xb7fe1388]Ignoring seekhead entry for ID=0x1654ae6b
[matroska @ 0xb7fe1388]Ignoring seekhead entry for ID=0x114d9b74
[matroska @ 0xb7fe1388]Unknown entry 0x73a4 in info header
[matroska @ 0xb7fe1388]Unknown track header entry 0x55aa - ignoring
[matroska @ 0xb7fe1388]Unknown track header entry 0x23314f - ignoring
[matroska @ 0xb7fe1388]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7fe1388]Unknown track header entry 0xaa - ignoring
[matroska @ 0xb7fe1388]Unknown track header entry 0x55aa - ignoring
[matroska @ 0xb7fe1388]Unknown track header entry 0x23314f - ignoring
[matroska @ 0xb7fe1388]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7fe1388]Unknown track header entry 0xaa - ignoring
Input #0, matroska, from '17.mkv':
  Duration: 00:20:52.0, start: 0.000000, bitrate: N/A
    Stream #0.0: Audio: liba52, 48000 Hz, 5:1
    Stream #0.1(eng): Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 23.98 tb(r)
Output #0, avi, to '17.avi':
    Stream #0.0(eng): Video: ffv1, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 tb(c)
Stream mapping:
  Stream #0.1 -> #0.0
Press [q] to stop encoding
frame=30017 fps=  7 q=0.0 Lsize= 7322488kB time=1252.0 bitrate=47913.6kbits/s    
video:7321525kB audio:0kB global headers:0kB muxing overhead 0.013150%
Well, I'm kind of concerned about the audio being 0kbs but I decided I'd worry about that a little later. So I ran it in VLC and it not only doesn't work, but causes an error in VLC which cause it to shutdown.

I really have no clue what I'm doing, but the file was 6.28GBs and the original file was 358 MBs so I'm pretty sure I screwed something up.

Can anyone point out what I did wrong or where I can learn to do this correctly?

I was using this website as a guide.
See less See more
1 - 15 of 15 Posts
http://www.doom9.org

You should be using VirtualDUB for all your movie needs. Also, install all the extension plugins for it, which will let you do what you are trying to do.

Any reason you are converting it to lossless? That's a waste of space and time!

edit-Also, MKV is a container, not a codec or format, as is AVI. So you need to find out what the source video codec is, and the source audio codec, and rip both from the MKV into AVI and WAV containers. Then when you've got your video converted to the codec you want, and possibly audio as well, then just put them back together using VDUB as a final step. I personally split my A/V right off the bat, work on each individually, then when they're both done, put them back together into the same container (AVI).
  • Rep+
Reactions: 1
Quote:

Originally Posted by Kuntz View Post
http://www.doom9.org

You should be using VirtualDUB for all your movie needs. Also, install all the extension plugins for it, which will let you do what you are trying to do.

Any reason you are converting it to lossless? That's is a waste of space and time!
true dat.
See less See more
Looks like h264 video and a52 5.1ch audio. Why bother converting it? Just keep it as is and put it in a new container. Anyway, the problem with the audio is you specified to not HAVE any audio in the output file.

e.g. ffmpeg -i in.mkv -vcodec copy -acodec copy out.avi

And, VirtualDUB doesn't work very well on Linux.
  • Rep+
Reactions: 1
Also, any lossless format is going to be HUGE.
Thanks for the answers! I was just playing around with the lossless format. I want to make a Mythbuntu box for my tv recordings (when I get enough money anyway) so I was just really playing with it.

Also, the lossless file was like 6.28 GBs and the input file was 353 MBs so yeah. :]
The reason you aren't getting any audio is you didn't tell FFMPEG what to do with the audio.

Quote:

Originally Posted by Kuntz View Post
http://www.doom9.org

You should be using VirtualDUB for all your movie needs. Also, install all the extension plugins for it, which will let you do what you are trying to do.
No. VirtualDub is old and uses VFW. Wake up, this isn't 2003. If you're following the doom9 guides, that explains why you're doing this. They are EXTREMELY outdated. Go to the forums.

Quote:
Any reason you are converting it to lossless? That's a waste of space and time!
He probably wants to do something to it and has trouble doing it to the H.264 stream or whatever's in the MKV.

Quote:
edit-Also, MKV is a container, not a codec or format, as is AVI. So you need to find out what the source video codec is, and the source audio codec, and rip both from the MKV into AVI and WAV containers. Then when you've got your video converted to the codec you want, and possibly audio as well, then just put them back together using VDUB as a final step. I personally split my A/V right off the bat, work on each individually, then when they're both done, put them back together into the same container (AVI).
You don't have to do that. The entire idea behind FFMPEG is that it can take almost anything and encode it into almost anything. You can extract from MKV using a tool that comes with mkvtoolnix, mkvextract.

Your way is a very roundabout way. Avisynth is a lot more easy to work with... it has plugins that use ffmpeg to load video and audio, or specialized plugins for MPEG-1/2 and AVC (which gets around the fact their containers - .mpg, .vob, .mkv and .mp4 don't have frame indexes, unlike AVI), you can treat the video and audio as streams or clips instead of files, and so on...
See less See more
Quote:

Originally Posted by Coma View Post
No. VirtualDub is old and uses VFW. Wake up, this isn't 2003. If you're following the doom9 guides, that explains why you're doing this. They are EXTREMELY outdated. Go to the forums.
I do go to their forums, and I've also been encoding since 2002, so I'm pretty sure I know what I am doing.
See less See more
Well then you haven't been going to the right subforums. If you use Virtualdub, then you must only be doing XviD or god forbid x264vfw... so you're either outdated or doing it wrong.

Just because you've been doing it for a while doesn't mean you know what you're doing. Look at the messed up DVDs that supposed professionals produce...
The only codec I use is XviD, and just because you have your own methods doesn't mean mine are wrong or outdated. XviD is still the #1 codec to use, it's the #1 used codec in the scene, and so is VDub. But I guess we could all be doing it wrong..
The scene is full of idiots who like feeling like they have proper standards.

Just because a lot of people do something doesn't mean it's good...

XviD is old, so yes, it's outdated. If you're using x264vfw, then you're doing it wrong. Both of these are facts
See less See more
2
Quote:

Originally Posted by Coma View Post
XviD is old, so yes, it's outdated. If you're using x264vfw, then you're doing it wrong. Both of these are facts

XviD has a high compatibility rate, my encodes work on my DVD player, 360, and PS3. I believe XviD is still the fastest encoder around where speed:quality ratio was benchmarked. And I also like that VDUB and XviD can use all 4 of my cores at 100% to speed up encodes.
See less See more
0.0 *grabs some popcorn and sits down*

Seriously though if VDub works for him does it really matter if he's doing it wrong or not?
GodofGrunts: He can encode whichever way he likes, but just because he likes doing it like in 2003 (with formats that VirtualDub can't even handle) doesn't mean he should tell you to take his broken route as well.

Quote:

Originally Posted by Kuntz View Post
XviD has a high compatibility rate, my encodes work on my DVD player, 360, and PS3. I believe XviD is still the fastest encoder around where speed:quality ratio was benchmarked. And I also like that VDUB and XviD can use all 4 of my cores at 100% to speed up encodes.
XviD at max settings is faster than x264 at max settings, but x264 at settings which yield speed similar to XviD's max settings is better quality than XviD. (if only because of the deblocking filter)

Most quality:speed benchmarks are irrelevant because:
a) the people who did them have no clue how to work either encoder
b) they are outdated - x264 goes through about 100 revisions every month. In 2008, there were 3 new features added which had a major impact on quality. Over the course of a year, x264 becomes approximately 20% faster through revisions.

You have a 360 *and* a PS3, both of which can play full-featured H.264, and yet you still want compatibility with your DVD player? Honestly, I don't see why you even have a DVD player considering both can play DVDs. Since you have both, the only reason I can see you might want to use XviD is you encode for the scene.

Not only can x264 use all 4 of your cores at 100%, it can encode on farms of computers, all at max utilization - that just goes to show how scalable it is.
See less See more
x264 rocks all 8 threads of my Core i7. The only reason to continue using xvid is for backward compatibility with antique players.
1 - 15 of 15 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top