Log in

View Full Version : Recompression directly to MKV/MP4


Stormborec
14th February 2015, 14:58
Does exist another way to recompress to MKV/MP4 without creating the .h264 file and then mux it? I can do it directly only in Avidemux, but Avidemux doesn't read specific audio, what I don't want recompress

setarip_old
14th February 2015, 19:05
Hi!

Have you looked into using either BD-RB or MultiAVCHD?

Stormborec
14th February 2015, 20:06
Hi,

I've now try them, but it isn't the solution.

Avidemux is quite OK, except the aac not support ...

detmek
15th February 2015, 14:26
Handbrake or VidCoder.

SeeMoreDigital
15th February 2015, 15:04
Out of interest... Why to you want to go from .mkv to .mp4?

Stormborec
15th February 2015, 16:24
I want it due to my television color shifts, but it's a long storry ... I have to do some colorshift. I before did it: Avisynth video >>> Virtualdub xvid + audio directly without recompression >>> avi. But I found, that the video is darkened by using xvid and although I use the best setting in xvid, it's far to losssless.
So I'm looking for something what can do it in AVC, but MEgui, Handbrake, Staxrip, ... - they make first h.264 file and then they mux it to MKV. But I do big files due to maintin quality and then I move it to flashdisk. If the aplication could do it directly to MKV, then I would avoided the muxing step and I could create the MKV file directly to flashdisk, which saves much of time.
I use "ultrafast" setting in the x264 in Avidemux, because I don't care much about the file size.
The only fail in Avidemux is the not support of some audiofiles (AAC), so I have to recompress the audio too. (I use avisynth proxy in Avidemux)

Groucho2004
15th February 2015, 16:48
Out of interest... Why to you want to go from .mkv to .mp4?
All I can see from the OP is that he wants to remux something to mkv/mp4, where the "/" could mean "or", not sure.

@Stormborec
I think FFMpeg is what you're looking for, for example:
ffmpeg -i "movie.mkv" -vcodec copy -acodec copy "movie.mp4"
This method works for many conversions.

Stormborec
15th February 2015, 19:31
What I do:

I have input video, and I need change colors, etc. and save it to output video.
Audio is OK, but if there is no other way - OK, I'll recompress it too.
So: 1) I have an Avisynth script: directshowsource("inputvideo"), etc. ...
2) I read the script in Avidemux Avisynth proxy
3) I do compression in Avidemux - directly to MKV - to flashdisk

video is compressed by x264 ultrafast presset
audio is compressed by AC3 Aften (? or rather MP2 ?), the others are slow

flashdisk is used to play in my TV

Stormborec
15th February 2015, 20:24
There is also possibility :
MkvToolnix - extract audio

Avisynth - (audio=false) >> Virtualdub x264vfw + audio without recompression >>> AVI

It's faster, but the AVI + AVC ...
I'm afraid of the video-audio desync ...

the source video sould be constant frame rate, at least according to MediaInfo

SeeMoreDigital
15th February 2015, 20:28
I'm still confused...

Stormborec. Do you want to re-mux the existing video stream from one container (ie: .mkv) to another container (ie: .mp4). Or do you want to 're-encode' the video stream?

Sufficed to say... Re-muxing the existing video stream from one container to another container does not "shift colour". You can only change the colours by re-encoding the video!

Stormborec
16th February 2015, 08:58
Yes, I have to reencode.
I actually have only two relevant possibilities. Avidemux >> to MKV or MP4, and Virtualdub >> to avi.

I found, that using "Virtualdub to avi solution" - there is one frame shift in comparison with the "Avidemux solution". Does exist any program, where I can see the video and also the visualisation of the audio, to see, if there is or is not a 40 ms shift audio vs. video? (1s/25FPS)

Poutnik
16th February 2015, 14:05
What about MeGUI/Avisynth ?

you can do AVS based reencoding of video to H264 raw format,
and then use MKV or MP4 muxer to mux the new raw video stream
and audio from original video.

http://avisynth.nl/index.php/Main_Page

Avisynth Usage on Doom9 forum (http://forum.doom9.org/forumdisplay.php?f=33)

Stormborec
16th February 2015, 16:16
So I solved it.
Saving AVC to avi makes shifts during seeking, so it's not ideal.
So the only solution is using avidemux proxy, then the output directly to MKV works well.
MeGUI is too complicated - especially the intermediate step with .h264 file slows down the processing

Poutnik
17th February 2015, 11:29
...........
MeGUI is too complicated - especially the intermediate step with .h264 file slows down the processing

I have always considered time spent on muxing negligible, compared to H264 encoding.

filler56789
19th February 2015, 17:15
komisar's build of the x264 VfW codec allows you to output to other containers than AVI
(just write -o path-to\output.ext in the "extra options" textbox)

Also, the recent versions of VirtualDub offer the so-called external-encoder feature
(which I have never tried, to be honest,
because I'm still using VirtualDub 1.9.11).

Poutnik
27th February 2015, 15:00
Interesting... what if I return back to try recent VDub ?
As I was a long term fan of VDub, later abandoning it in favour of using MeGUI and occational Avidemux, using MP4(or MKV)/AVC/AAC encoding.