Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Mkv > Remux To Mp4, Remux to AVI perfect with x264VFW but...
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
bavo.bostoen
Posted: Dec 1 2013, 05:35 PM


Newbie


Group: Members
Posts: 4
Member No.: 14047
Joined: 8-February 05



... but I need an MP4 container:
- i have a perfectly compressed MKV source file (AVC for video, AAC for audio)
- but my Xbox cannot read it
- I remuxed it to AVI with Vdub & x264VFW, not touching the video nor audio stream using direct stream copy, which works very fast and plays in VLC player
- but Windows Media Player and the Xbox still cannot play it

Question:
- can I remux to MP4 using external encoder sets, not reencoding (that works but is slow) but remuxing?

Probably not since the video settings in Vdub apparently need to be uncompressed for both audio & video, but I still would like to know.

Thanks for any useful info.

Best,
Bavo
 
     Top
dloneranger
Posted: Dec 1 2013, 06:01 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



It's pretty much down to finding the tool you want to use, usually they have the name of the format in the title
Mp4Box does what you want, and so do many others
But I'd probably just go with ffmpeg as it does many formats
It's a command line program, so not as simple as 'push the red button' programs
(I'd give you one of those, but don't know any off the top of my head - maybe someone else can suggest one)

Anyhow, I'd get ffmpeg from http://ffmpeg.zeranoe.com/builds/
You'd want the one titled something like 'Download FFmpeg git-f068aed 32-bit Static'
Unzip that to a folder somewhere, lets call it c:\ffmpeg
Then make a new text document in the c:\ffmpeg\bin folder
Edit that document and copy this in
CODE

@echo off

rem change this to where ffmpeg.exe actually is
set ffmpeg="c:\ffmpeg\bin\ffmpeg.exe"

:loop
if "%~1".=="". goto theend
set "src=%~1"
set "destdir=%~dp1"
set "destfnameext=%~n1.mp4"
set "dest=%destdir%%destfnameext%"
echo mp4ing "%~n1"

if /i "%src%"=="%dest%" echo error its the same file & pause & goto nxt
%ffmpeg% -i "%src%" -vcodec copy -acodec copy "%dest%"

:nxt
echo.
shift
goto loop

:theend
echo All done
pause

save it, and then rename the file to ConvertToMp4.bat
(or just download it here https://dl.dropboxusercontent.com/u/1702491...onvertToMp4.bat )

Now you can just drag your file(s) to that ConvertToMp4 (or a shortcut to it) and they'll be mp4'd

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
bavo.bostoen
Posted: Dec 1 2013, 07:55 PM


Newbie


Group: Members
Posts: 4
Member No.: 14047
Joined: 8-February 05



Wow this works great, and really fast too: many thanks!

Is there a way to learn how to work with this encoder, command line options etc.
And do you need to know vbscript to use this? (I'm no coder by all means)

Thanks again,
Bavo
 
     Top
dloneranger
Posted: Dec 1 2013, 08:42 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



Oh, there's documentation
I think it comes by the Kilo http://ffmpeg.org/documentation.html :-)

The basics are pretty simple though, it's all command line parameters
-i "%src%" -vcodec copy -acodec copy "%dest%"

-i "%src%" :means the input file
vcodec copy :copy the video stream
-acodec copy "%dest%" :copy the audio stream
"%dest%" the destination file

It will mux to the format of the file extension by default
In the .bat file I make the destination file by "%~dpn1.mp4"
That means
%1 if the first parameter given to the .bat file - that's the filename of the video
You can spit that %1 up into bits by using extra command characters

~ :remove the quotes if there are any
d :the drive letter
p: the path
n: the name
x: the file extension
so "%~dpn1.mp4" gives you the original file with the extension changed to .mp4 and quoted

You can read in the docs for all the stuff in there, but here's one extra example that makes an mkv, with pcm audio and a copied video stream - the magic there is -acodec pcm_s16le which means signed 16 bit audio in intel format (little-endian)
%ffmpeg% -i "%src%" -vcodec copy -acodec pcm_s16le "%~dpn1.mkv"


--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
-vdub-
Posted: Dec 2 2013, 05:20 AM


Advanced Member


Group: Members
Posts: 613
Member No.: 27087
Joined: 24-February 10



A tool that I use often for mkv to mp4 muxing will also rewrite the video PTS that is often needed for remuxing mkv to mp4 or other. Another option used is -absf aac_adtstoasc for when aac audio has the adts flag set unnecessarily
 
    Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
4 replies since Dec 1 2013, 05:35 PM Track this topic | Email this topic | Print this topic

<< Back to Codec Discussion