Author Topic: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script  (Read 1766 times)

jonwren

  • Jr. Member
  • **
  • Posts: 59
Hi
I hope someone can help me....
I need a script to copy a Folder of MKV Videos to MP4 Videos, with the same Video and Audio Copy, So its basically just changing all the Videos inside the folder from MKV to MP4, with unchanged Video Format and Audio Format quality.
Does anyone have a script for me to use please, or teach me how to do this?

Many Thanks

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1953
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #1 on: March 24, 2018, 05:06:32 PM »
If you are not afraid of doing own research and thinking logically filling in missing bits of the solution, http://avidemux.org/smif/index.php?topic=17187.0 could give you pretty much everything needed to find your own.

Please be aware that the parameters of the Mp4 muxer have been extended since 2.7.0 release to allow to force display aspect ratio, mp4 container is generally much more restrictive than MKV WRT codecs so that conversion may easily fail.

In any case you are much better off using the latest Avidemux nightly instead of the outdated 2.7.0 release. Alternatively, use just ffmpeg directly (Avidemux adds no benefits in your use case).

jonwren

  • Jr. Member
  • **
  • Posts: 59
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #2 on: March 25, 2018, 04:58:18 AM »
Thanks
Will give it a try  ;)

jonwren

  • Jr. Member
  • **
  • Posts: 59
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #3 on: March 25, 2018, 06:02:02 AM »
If you are not afraid of doing own research and thinking logically filling in missing bits of the solution, http://avidemux.org/smif/index.php?topic=17187.0 could give you pretty much everything needed to find your own.

Please be aware that the parameters of the Mp4 muxer have been extended since 2.7.0 release to allow to force display aspect ratio, mp4 container is generally much more restrictive than MKV WRT codecs so that conversion may easily fail.

In any case you are much better off using the latest Avidemux nightly instead of the outdated 2.7.0 release. Alternatively, use just ffmpeg directly (Avidemux adds no benefits in your use case).


Thanks got it all working BUT I get an error message, Which is below...
I have to select ok for every file loaded for it to do the conversion, The conversion works great, apart from having to select ok for every file loaded.

TinyPy: Exception
Exception : (tp_load) cant get filesize
BackTrack: File:py2bc.py,line50

Here are my Bat file Settings

set avidemux="C:\Program Files\Avidemux 2.7 - 64 bits\avidemux.exe"
for %%f in (*.mkv) do %avidemux% --load "%%f" --run pui.py --save "%%~nf.mp4" --quit

Here are my Py file Settings

adm = Avidemux()
adm.setContainer("MP4", "muxerType=0", "useAlternateMp3Tag=True", "forceAspectRatio=False", "aspectRatio=1")

Any idea what is wrong

Thanks


eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1953
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #4 on: March 25, 2018, 11:07:44 AM »
Basically it means that ADM_fopen fails, I'll try to look into it later today.

jonwren

  • Jr. Member
  • **
  • Posts: 59
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #5 on: March 25, 2018, 11:13:59 AM »
Thanks buddy

jonwren

  • Jr. Member
  • **
  • Posts: 59
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #6 on: March 25, 2018, 11:18:00 AM »
Basically it means that ADM_fopen fails, I'll try to look into it later today.

Would this be because of the current software version?

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1953
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #7 on: March 25, 2018, 11:50:34 AM »
I don't think so. Why do you use the GUI version instead of the CLI one?

(The release is really not an option because you lose the last few frames of the video if it contains B-frames)
« Last Edit: March 25, 2018, 11:53:21 AM by eumagga0x2a »

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1953
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #8 on: March 25, 2018, 12:09:09 PM »
Could you please create a directory with just a single MKV video in it, run your batch and post admlog.txt resulting from this run if you get the same error?

jonwren

  • Jr. Member
  • **
  • Posts: 59
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #9 on: March 25, 2018, 12:15:09 PM »
Could you please create a directory with just a single MKV video in it, run your batch and post admlog.txt resulting from this run if you get the same error?

Where do I post admlog.txt?


eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1953
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #10 on: March 25, 2018, 12:43:25 PM »
If possible, compress it and attach it to your reply. If it doesn't work due to antispam measures, please send it by a personal message.

jonwren

  • Jr. Member
  • **
  • Posts: 59
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #11 on: March 25, 2018, 12:57:37 PM »
If possible, compress it and attach it to your reply. If it doesn't work due to antispam measures, please send it by a personal message.

The script is now running since I chance to CLI, BUT now with the input video MKV file size 1.30GB, when it converts to MP4 the finished file size is 32.6KB

I don't know how or where to get the admlog.txt

Thanks for helping me

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1953
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #12 on: March 25, 2018, 01:16:28 PM »
You find it in %localappdata%\avidemux\

jonwren

  • Jr. Member
  • **
  • Posts: 59
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #13 on: March 25, 2018, 01:19:22 PM »
You find it in %localappdata%\avidemux\

Thanks

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1953
Re: Newbie : How to Copy Video & Audio folder from MKV to MP4 Script
« Reply #14 on: March 25, 2018, 02:13:41 PM »
I'm sorry, could you please attach a ZIP compressed version? I don't have unrar on my smartphone.