VidsOpt v0.2.4 - Fast MP4 Muxer/Converter

e.mote

Senior Member
Feb 16, 2011
2,165
892
0
The max width setting takes effect when the input file is larger than the specified value; smaller width sizes are left alone, ie it doesn't rescale UP, only DOWN.

RMVB video is a streaming codec optimized for size (it's based on H.264), and converting to H.264 will generally result in a larger file size, especially at the VERYFAST speed setting.

For the tightest compression, set speed to VERYSLOW, which will generally take ten times longer to encode. Encoding time aside, the VERYSLOW setting can affect playback smoothness, as the encoder uses higher compression settings. For mobile devices, it's best to leave it at the default VERYFAST.

A better way to both get smaller size and lessen playback requirement is to lower the Video quality setting. The natural inclination is to set this at the highest possible (ie at 19), but the "best" setting for mobile devices should be at 21-23, depending on content and output resolution. This is how RMVB video gets its small size.

For SD, low-action content (eg "talking heads" in TV shows), suggest trying 23 or even 24. You won't notice any visual difference unless you check frame-by-frame.
 
Last edited:
  • Like
Reactions: marctronixx

e.mote

Senior Member
Feb 16, 2011
2,165
892
0
0.1.3
. Add VFR support.
. Add extraction for SSA sub, sub w/o language ID tag.
. Add extraction for attachments (MKV only).

. Some animes, digicams, and hybrid contents use variable framerate (VFR). The script encodes in constant framerate (CFR) by default. If audio is out-of-sync, enable VFR encoding in Advanced Options. VFR encoding is automatically enabled for RMVBs.

. Fansub MKVs may have embedded fonts or cover art. To extract these, enable Extract All Attachments in Advanced Options. Note: MP4 can't make use of these.
 

T.A Blet

Senior Member
Jun 11, 2011
87
3
0
@techpal

Make sure AVISynth is installed to "AVISynth 2.5" folder, and that you have the 0.1.1 updated script.

The "can't find audio stream" error is typically because either FFDshow wasn't installed (or the AC3/DTS/AAC support wasn't enabled), or AVISynth can't be accessed.
First of all, thanks for posting this e.mote.

Unfortunately, I cannot get this to work although I have done everything discussed in this thread.
I am getting this "can't find audio stream" error

AviSynth is installed in C://Program Files(x86)/AVISynth 2.5

ffdshow Audio decoder configuration list as follows:

AAC libavcodec
AC3 libavcodec
DTS libavcodec

Is this correct?

When I play TEST.AVS in Media Player Classic it says something like this: Not able to render.
Nothings happens.

Played in BSPlayer, the screen freezes.

Any ideas what I could be doing wrong?

TIA
 

e.mote

Senior Member
Feb 16, 2011
2,165
892
0
There are two parts, AVISynth and FFDShow.

If FFDShow is correctly installed, you should be able to play any format/codec with a DirectShow player like WMP or MPC.

To test AVISynth, put the word version into a text file and save it as TEST.AVS. Then play it with MPC or WMP. If it plays (shows the version), AVISynth is working.

On my system, FFDShow's Audio Config shows AC3=liba52, DTS=libdts, AAC=libfaad2. libavcodec should still work, however.

Windows boxes' multimedia configs are a mixed lot, as people tend to install various codec packs that can interfere with each other. Video cards and AV programs can also install their own codecs. If you have codec packs installed, uninstall them. If running Windows 7, use the filter selector below to select the desired filter.

http://www.codecguide.com/windows7_preferred_filter_tweaker.htm

Last, try on a different PC.

I'll be switching from the DirectShow filter to other AVISynth plugins to allow 5.1 audio in a future rev. That'll be less system-dependent, although AVISynth is still required to work.
 

ebbrey

New member
Jun 14, 2011
4
2
0
can't find audio stream

Hello!

Regarding: "can't find audio stream"

It took a while for me to get this working, i had the same issue as the other poster here with "can't find audio stream".

I tried your tests, avisynth was working, directshow was telling me "not supported".

I read your install guide once more, and under ffdshow it says "including Haali Media Splitter" in the package" so i thought this came with FFDshow.. i downloaded/installed it sepratly from haali.su/mkv/ and your script started working instantly!

Maybe this can help someone else, i dunno.

Thank you for a great script!
 
  • Like
Reactions: T.A Blet and e.mote

e.mote

Senior Member
Feb 16, 2011
2,165
892
0
Thanks for the tip. Haali was part of the FFDShow package when I installed it, but it's possible it's unbundled for current versions. Yeah, it's needed for parsing MKV, unless the user already had another means to do that. I'll make it clearer in the install instructions.
 

T.A Blet

Senior Member
Jun 11, 2011
87
3
0
:D Thankk you so much. Got it working.

Hello!

Regarding: "can't find audio stream"

It took a while for me to get this working, i had the same issue as the other poster here with "can't find audio stream".

I tried your tests, avisynth was working, directshow was telling me "not supported".

I read your install guide once more, and under ffdshow it says "including Haali Media Splitter" in the package" so i thought this came with FFDshow.. i downloaded/installed it sepratly from haali.su/mkv/ and your script started working instantly!

Maybe this can help someone else, i dunno.

Thank you for a great script!
 

ericc191

Senior Member
Jan 28, 2007
2,032
116
63
West Fork
Maybe I'm doing this wrong, but when trying to convert episodes of bleach here is what I did..

I first tried converting the .mkv and the subtitles didn't show up on the outputted .mp4.

I took the .ass file and opened it with VobSub and saved the file as .srt.

I placed both the .srt and the newly created .mp4 into a new folder and dropped it into 2MP4.

Press start and still no dice.

What did I do wrong?
 

e.mote

Senior Member
Feb 16, 2011
2,165
892
0
The script only extracts the subs, in the assumption that some media player can display external subs w/o incurring software mode. How or whether a sub is displayed is out of its hands. That's up to the media player. The default player probably doesn't support subs.

Per its description, Vplayer can recognize external subs in various formats. Moboplayer supports external SRT/ASS in UTF-8 format. You can look up others.

You can probably use ASS format unless it makes use of embedded fonts, in which case you'd have to convert to SRT. The script can also extract font attachments, but any sub conversion needed is up to you.
 
  • Like
Reactions: marctronixx

ericc191

Senior Member
Jan 28, 2007
2,032
116
63
West Fork
The script only extracts the subs, in the assumption that some media player can display external subs w/o incurring software mode. How or whether a sub is displayed is out of its hands. That's up to the media player. The default player probably doesn't support subs.

Per its description, Vplayer can recognize external subs in various formats. Moboplayer supports external SRT/ASS in UTF-8 format. You can look up others.

You can probably use ASS format unless it makes use of embedded fonts, in which case you'd have to convert to SRT. The script can also extract font attachments, but any sub conversion needed is up to you.
Ah, thanks for clearing that up. It's working now!
 

rcrh

Senior Member
Jun 21, 2011
87
5
0
e.mote, thanks for putting this script together. It works great. I had done something similar when I was trying to move videos to my iPod. I like that this tests the video and reencodes as needed.

Now, if only we could get something that would play AC3 files so that we didn't need to go through this hassle. I realize it's not much work but I don't like having to have two copies of my files and I don't want to loose the AC3 (or DTS) track for the files I watch on my HTPC setup.

Anyway, until that time comes...

Thanks!
 

rcrh

Senior Member
Jun 21, 2011
87
5
0
Oops. I sang the praises of the script too soon.
I'm having a bear of a time getting it to work. Everything seems to run smoothly and the script completes without any errors. But, the resulting mp4 file doesn't play properly. The audio is crazy slow. Like so slow it sounds like the adults in a Charlie Brown cartoon. I've tried playback on my gt10.1, MPC, & VLC. All sound the same.

Any suggestions?
 

e.mote

Senior Member
Feb 16, 2011
2,165
892
0
Edit script and set vDebug=on. Aside from enumerating the variables, it also acts as a breakpoint between the operations. Right after the AAC encoding, look in your temp dir and check the resultant AAC/M4A audio track. If it plays correctly, it's a muxing problem (unlikely). If it doesn't, then it's a DirectShow issue. I assume you've installed FFDShow and Haali Splitter.

If on Win7, use this to select the desired filter for audio,
http://www.codecguide.com/windows7_preferred_filter_tweaker.htm

The script relies on DS filter to provide the first part of the audio conversion. It's versatile, but can be problematic since Windows boxes can have varied configurations.

For more info, provide specs dump and sample clip.
 

rcrh

Senior Member
Jun 21, 2011
87
5
0
Edit script and set vDebug=on. Aside from enumerating the variables, it also acts as a breakpoint between the operations. Right after the AAC encoding, look in your temp dir and check the resultant AAC/M4A audio track. If it plays correctly, it's a muxing problem (unlikely). If it doesn't, then it's a DirectShow issue. I assume you've installed FFDShow and Haali Splitter.

If on Win7, use this to select the desired filter for audio,
http://www.codecguide.com/windows7_preferred_filter_tweaker.htm

The script relies on DS filter to provide the first part of the audio conversion. It's versatile, but can be problematic since Windows boxes can have varied configurations.

For more info, provide specs dump and sample clip.
First, thanks for the quick responses. I ran the tweak tool and changed anything that could be pointed to DS to be pointed to DS. Then I reran the script and got the same result.

It will take me a bit of time to build a sample file to send you as I have to go back to my original mpg, OTA capture and trim it down, encode it into x264 and then run it through the script. I'll try to get it done over night.

I addition to the sample file and the mediainfo dump is there anything else I can provide like a log file from the script?

Thanks again. Your help is really appreciated.
 

e.mote

Senior Member
Feb 16, 2011
2,165
892
0
First, try the suggestion in my last post.

Sorry I mean sample clip of the input file, not the output. If clip is in MKV format (or can be remuxed to MKV), open a console, change directory to the MKVToolnix folder, and run the below command:

mkvmerge --split timecodes:00:05:00.000,00:07:00.000 "path\infile.mkv" -o "path\outfile.mkv"

This will cut a 2min-long sample clip from the 5min to 7min mark. Test this sample clip to see if it exhibits same symptom.

I'll add in a couple of different methods for audio conversion for a future rev, since the DS route seems to be a sore point.
 

rcrh

Senior Member
Jun 21, 2011
87
5
0
First, try the suggestion in my last post.

Sorry I mean sample clip of the input file, not the output. If clip is in MKV format (or can be remuxed to MKV), open a console, change directory to the MKVToolnix folder, and run the below command:

mkvmerge --split timecodes:00:05:00.000,00:07:00.000 "path\infile.mkv" -o "path\outfile.mkv"

This will cut a 2min-long sample clip from the 5min to 7min mark. Test this sample clip to see if it exhibits same symptom.

I'll add in a couple of different methods for audio conversion for a future rev, since the DS route seems to be a sore point.
1) I tried the suggestions in the previous reply. The audio file in the temp didn't play either so I ran the tweak and made the changes that I noted. No change in the output.
2) oops, I meant to include both the soure & output file. See attached.