Log in

View Full Version : MKV(h/x264+ac3) to TS/PS


dragonlyXXL
10th April 2007, 19:42
(Sorry for the crossposting. Moved from the Mpeg-2 thread.)

Been a long time silent reader and learnt a great deal but now I have a problem I can't seem to figure out. Hope this will be helpful for others as well.

Here's the deal:
I've got quite a few MKV files containing avc+ac3 streams (from 720 to 1080p, 2/5 channels) that I'm trying to stream to my brand new Sigma-8623/4 based streamer. Since the box doesn't recognize MKV I've been trying different methods to transmux to other formats while trying to keep the streams as-is (no transcoding, if possible...).

Demuxing was easy but than the muxing problems started... My best contender for the target format seemed to be MPEG-2 TS, and I've been getting very nice and playable results whenever I get XMuxer Pro to actually work w/o freezing etc.

I was wondering if there are any other suggestions besides XMuxer that are (in order of importance):
1) proven more stable
2) can handle a/v sync issues
3) flexible in terms of sources
4) can batch process
5) don't require getting a new mortgage
6) extra bonus - can process DTS as well

Hope it's not too much to ask. Doesn't have to be a single application.

Cheers and TIA.

b_squared
10th April 2007, 19:53
The PS3 now takes AVC High Profile + AC3 in a TS.

Short of writing my own TS muxer, I have no idea how to remux some of mkv's to play on the PS3. Anybody?

jcar
10th April 2007, 21:28
I've tried Xmuxer pro to do it, but the resulting files wouldn't play in the PS3 anyway :(
I've tried everything.

I know that nero vision recodes files to put them on this AVCHD discs. The discs will have a ".mts" file, those can be played on the PS3 and it supports a higher profile than the mp4...

I can make a couple of those mts files if you need "examples", though I don't know if that will help...
But I would KILL to know how to remux mp4 into mts (m2ts) files the ps3 would read.
Too bad nero RE/TRANS-CODES the things, I hate it. And only at 1080i/p.

If the MKV are encoded in H264 main profile (I guess that's what it's called) then you can demux them and remux them using mp4box (megui and yamb are front-ends to this command line tool). There's a high chance the audio comes in ac3 and mp4 won't support those , you would have to use AAC.

dragonlyXXL
10th April 2007, 23:50
Thanks for the suggestions but that's not it...

I already have pretty good solutions to transcode to mp4 (demux, transcode ac3->aac, mux to mp4) and to plain-ol' Mpeg2 TS (demux, transcode avc->m2v with ffmpeg or HC, mux).

Two reasons I'd rather use an alternative process that keeps the original tracks:

1. Shorter processing time - since the data is already in the right format, just not in the right container. I'm (almost) certain this should be a purely muxing solution.
2. Transcoding any of them will degrade them - something I'm trying to avoid.

I have no idea what's the deal on PS3 (maybe it can only playback specific flavours of MP4, like the apple tv thingy), but I am using XMuxer and whenever I get it to output anything at all, it does play very nicely on my box... problem is it's flaky as hell, hence the need for something more stable.

Any other suggestions?

ronnylov
3rd May 2007, 16:26
I have read somwhere that VLC player have a built in tool that can multiplex to .ts files and that it also supports .ts with mpeg4 content. The VLS server may also be able to do it via command line. Please report back if you find anything that works.

DarkZell666
3rd May 2007, 16:41
That tool you mention in VLC seems to be b0rked. I've personally tried transcoding from AVC+AAC in mkv to AVC+MP3 in TS using VLC's transcoding assistant, and the .ts file get's a b0rked picture (green and pink blocks everywhere).

I haven't tried with the latest 0.8.6b version though, it would be worth trying (and reporting the problem on their forum).

I also had a try with the same files using the ffmpeg cli, and even if the picture was much less b0rked, it was still b0rked no matter what. Same thing, there have been so many revisions since I last tried ... maybe now it works :)

What's wierd, is with that same assistant in VLC, if I reencode an xvid+mp3 avi to AVC+mp3 in TS, it works ! So dunno what goes wrong, but there's definately something around the mkv demuxing support ...

SealTooGreat
4th May 2007, 01:55
Demuxing was easy but than the muxing problems started... My best contender for the target format seemed to be MPEG-2 TS, and I've been getting very nice and playable results whenever I get XMuxer Pro to actually work w/o freezing etc.


You need Elecard AVC PlugIn in order to handle h264 video stream. Read this (http://www.elecard.com/products/compare_table.php?product_id=xmuxer-pro)

Feed XMuxer Pro with h264_in_MP4(I've used Yamb) and AC3. It works just fine for me!

I couldn't get it work using raw .h264.(demuxed with MKVextractGUI)

Gmplayer plays this .TS just fine, mpc+ffdshow+haali give only sound without the picture.:confused:

dragonlyXXL
4th May 2007, 02:34
I have read somwhere that VLC player have a built in tool that can multiplex to .ts files and that it also supports .ts with mpeg4 content. The VLS server may also be able to do it via command line. Please report back if you find anything that works.

As DarkZell666 already mentioned, the result is unwatchable. After posting my previous question I've done some research and found out that the ffmpeg piece of code that's being used by VLC for this purpose is broken as well, so no luck with ffmpeg either.


You need Elecard AVC PlugIn in order to handle h264 video stream. Read this

Feed XMuxer Pro with h264_in_MP4 and AC3. It works just fine for me!

I couldn't get it work using raw .h264.(demuxed with MKVextractGUI)

Raw h264 is what I tried. Can't recall if I tried h264 muxed in MP4 or not but I'll try it again and post back with the results.

Thanks for the tip. Kinda gave up on XMuxer after my previous attempt.

=============================================================================

Update:

Only tried one file but it actually works !!! playback on my streamer is looking good so far, and audio seems synced. Thanks for the tip SealTooGreat.
Now all I need is to wait until Elecard come up with a CLI and i'll be able to batch the whole process.

SealTooGreat
4th May 2007, 04:06
XMuxer Pro can multiplex h264/mp4 and AC3 into MP4. :D
I could play it only with gmplayer, mpc+haali give only sound, no picture. Same as for TS.
But this time I have a/v sync issue (same problem for .mpg PS):
A/V sync is OK in first half of the movie, but in second audio is way out of sync.

There's no a/v sync issue while multiplexing into TS.:) (tested with latest Celtic Druid gmplayer - april-2007 build)
I've tried only few files.

dragonlyXXL
4th May 2007, 04:13
XMuxer Pro can multiplex h264/mp4 and AC3 into MP4. :D

Are you sure it's not transcoding the audio into AAC?
I already have a batch CLI solution for mkv to mp4 that includes audio transcoding (using BeSweet + Neroaacenc).
Thought using TS to skip that part of the process.

SealTooGreat
4th May 2007, 04:39
Are you sure it's not transcoding the audio into AAC?

It's not MP4, but TS, regardless of MP4 container output setting. :(

ronnylov
4th May 2007, 07:58
Good to know that Xmuxer Pro works but is there any free solution?

Another thing that you can try is Avidemux preview 2.4.
It is supposed to have experimental support for h.264 elementary streams and according to the wiki the TS output format supports MPEG-4 AVC.

http://avidemux.org/

SealTooGreat
4th May 2007, 08:01
I've directly remuxed mkv to mp4 (only h264 video stream) using haali's gdsmux.exe(28-April-2007), and than tried to import into Elecard XMuxer Pro under "Demux" tab. It says: "File may be corrupted, or its format is unsupported". :rolleyes:

Also tried:
mkv->MKVextractGUI (1.6.4.1)->h264->Yamb2.0_27-april build(Kurtnoise13 MP4Box-0.4.3_2007-Apr-23)->mp4->XMuxer Pro("Demux" tab)->.avc
and getting .avc 252mb (video/mp4 is 674mb) :confused:

Something is wrong?!?!?!?!:confused:

Maybe this is offtopic....I don't know.

DarkZell666
4th May 2007, 08:40
Another thing that you can try is Avidemux preview 2.4.
It is supposed to have experimental support for h.264 elementary streams and according to the wiki the TS output format supports MPEG-4 AVC.
The latest avidemux svn version can even open an mkv file containing MPEG4-AVC/-ASP and remux to MP4 directly. Maybe it'll work better for you SealTooGreat :)

Check it out here (http://forum.doom9.org/showthread.php?p=998833#post998833).

SealTooGreat
4th May 2007, 11:41
^ I can't remux mkv(x264+ac3)->mp4(h264). Can't find options for no audio. Tried using faac for ac3 conversation, but it doesn't help as well. Avidemux reports "Assert Failed at file gui_savenew.cpp, line 159".
Also avidemux can't remux to TS, same report: "Assert Failed at file gui_savenew.cpp, line 159". :confused:

DarkZell666
5th May 2007, 11:10
^ I can't remux mkv(x264+ac3)->mp4(h264). Can't find options for no audio. Tried using faac for ac3 conversation, but it doesn't help as well. Avidemux reports "Assert Failed at file gui_savenew.cpp, line 159".
Also avidemux can't remux to TS, same report: "Assert Failed at file gui_savenew.cpp, line 159". :confused:

Hmm mind you, the mkv support is very new and experimental.
Also, that looks like a GUI error. It's probably worth reporting that.

DarkZell666
5th May 2007, 13:45
Here's what I gathered so far (I tried with the latest ffmpeg build from celticdruid):

- ffmpeg cli won't transmux h.264 to mpegts properly (source formats being mkv, mp4, or avi doesn't change anything). The output ts file doesn't have any picture (in mplayer that is).
- ffmpeg cli won't decode HE-AAC correctly if it isn't clearly signalled as "HE" (some encoders do this, it's a shame, and ffmpeg doesn't seem to work around this by itself). ffmpeg believe's it's mono and decodes at half the rate (48000hz is read at 24000hz).
- ffmpeg cli can reencode any video to h.264 properly in mpegts (this surprised me quite a lot ! probably something that was fixed in a later revision, it wasn't the case before).

VLC suffers from the same symptoms, except it also b0rks the picture even when reencoding to h.264 (so it's even worse).

Edit:I just reported the h.264-in-mkv+copy-video crash problem in avidemux forum, let's wait a bit :)