Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VirtualDub, VDubMod & AviDemux
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th November 2018, 12:28   #21  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Oh, wow, never saw that option before!!! OK, then that confirms what I'm trying to say!!

On the original source (test.MOV + test.mp3) the audio display says "track is compressed" (meaning, it's a true mp3 source file).

However, after the passthrough external encoding, VD2 does show a graph for the audio, which says that audio in the mkv/mp4 was EXPANDED....

As written before, this reminds me older issues with virtualdub, like this:

https://sourceforge.net/p/vdfiltermod/tickets/105/

where direct stream/audio of a source mp3 produced a WAV/PCM audio stream!!

So, decided to try the other two audio input drivers (Caching input driver, and ffmpeg), both failed on the final mux (mkv):

---------------------------
VirtualDub Error
---------------------------
CLI: The audio encoding process failed with error code 1 (00000001). Check the log for possible error messages.
---------------------------
OK
---------------------------

in the log it says:

Code:
AudioEnc: pipe:: Invalid data found when processing input
As soon as the audio stream is opened using the [b]"MPEG audio input driver (internal)"[b] these failures stop - this is probably by design, but wanted to rule out the input drivers;

However, the resulting mkv has a PCM stream inside it as confirmed by various methods...including VD2 showing a nice audio graph for it


Wait, you are saying that you got an MKV with a compressed mp3 inside it using external encoder? any chance u can PM or otherwise send your External encoder XML file?

I'm using absolutely latest version from all these components, maybe you are not?

Thanks...
Stormy.
stormy1777 is offline   Reply With Quote
Old 20th November 2018, 12:31   #22  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
If you're not editing, it'd probably be easier to mux the audio yourself than to get VD2 to do it, if Direct Stream Copy isn't working for you.

Tell VD2 to only output the video stream and not to do any muxing. A 264 stream will do, but it's more fun with x264 writing directly to MKV, because then you can open and preview the output video with MPC-HC, and probably other players, while it's still being encoded. I think you just need to specify mkv as the output extension for the encoder. Something like %(outputname).mkv

When it's finished, open the output with MKVToolNixGUI, add the MP3 audio and mux.
For the MKV you have with PCM audio, disable the PCM stream after opening it with MKVToolNixGUI, add the MP3 audio and mux.

By the way, if you want to create an MP4 yourself, MeGUI has an MP4 muxer under the Tools menu. It uses MP4Box to do the work and creates the appropriate command line so you don't have to worry about it, but if you want to see the command line MeGUI used, it'll be in the log file.

Last edited by hello_hello; 20th November 2018 at 12:49.
hello_hello is offline   Reply With Quote
Old 20th November 2018, 12:45   #23  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Thanks Hello^2,

You'll love this part:

I do basic edit from start/end, then "sync" the audio Ctrl-I, "audio skew correction", once all is right, press F7 to SAVE, and that DID the right job, only "issue" is it uses a slightly "older" x264 codec, and produces an AVI vs. mp4/mkv containers.. both of these issues may not be a factor compared to the alternatives

It may not sound like it, but this is NOT my day job, it is just a hobby, and need to process a few of these file/combos a day, batch is not possible, b/c the "human eye" must "see" what is going on, match video/audio, etc. also, working with multiple files/tools can easily MIX up the audio/video.. so, best for my own sake to keep it in ONE tool

Tried the VD2 jobs, but that too has an issue b/c it closes the whole thing, so must remember to save each thing as a separate project before submitting the job..

Anyways, one day I'm sure we'll figure it, until then, I'm on F7/x264-internal to VD2 and, living happily with a slightly "older" codec with AVI containers and mp3 inside them

Thanks for the help, MeGUI was over the top for me, I'm an old dog, so will stick to VD2 for now

Stormy.
stormy1777 is offline   Reply With Quote
Old 20th November 2018, 14:46   #24  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
I'd consider remuxing the AVIs as MP4 or MKV. I'm not sure how common hardware player support for AVC in an AVI would be.

Did you sort out your problem with dark scenes not encoding well?
hello_hello is offline   Reply With Quote
Old 20th November 2018, 16:09   #25  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Re-muxing?? nooooo..... i get one pass (hopefully with one tool) at these, and the next day, more come, every once in a while I stop/pause and re-org things (like these past few days), for now it'll be AVI/AVC, until which time we can figure how to do external encoding without re-encoding audio, which was the original goal of this thread

Regarding dark scene, it happens with extremely bright scenes too, not fast moving at all, the visual is "grading" of the dark/bright areas.. i'm no video expert, but maybe u just need to give it more "bits" which results in higher file sizes, because the source colors are not "constant" they are "shades" of bright/dark (like clouds).. I did switch to Slower profile and Film, and lowered CRF to 14, so, lets see how that plays out in the coming weeks If I get time i may post that other thread...

Thanks Hello_hello, noticed u'r almost 4000 posts!! that's impressive!! keep up!

If anyone can mux mp3 into mkv or mp4 without re-encoding using VD2 external encoder, speak up i.e. post your xml config or give some clues

Stormy.
stormy1777 is offline   Reply With Quote
Old 20th November 2018, 17:16   #26  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
You'll have to venture into Avisynth territory to use it, but I add GradFun3() to the end of every script. It dithers to help prevent banding when encoding in 8 bit, especially after applying a noise removal filter, and it'd probably help with the problem you described, but I'm guessing without being able to see a sample of the source. I've no idea if there's a similar VirtualDub plugin.

Very occasionally I have to encode a section of a source with a lower CRF value, but mostly GradFun3() is enough. When I need to though, I generally split out the problem section from the rest of the encoded video with MKVToolNixGUI, encode just that section again at a lower CRF value (have I mentioned the AVS cutter? ), then append the parts with MKVToolNixGUI. I always add -stitchable to the x264 command line so splitting and appending encodes won't be a problem, should I need to do it. Of course, that sort of thing can be quite time consuming.

Last edited by hello_hello; 20th November 2018 at 17:21.
hello_hello is offline   Reply With Quote
Old 20th November 2018, 17:37   #27  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
You are scary.. why reveal the existence of such ruthless tools?.. it is very tempting now... that GradFun3 (wonder what ever happened to 1 and two has many parameters, how do you use it? or is there some "sane" default or does one need another tool or another PhD in something ? Avisynth is somewhat doable, just for the video opening, rest i think can be done in the GUI..

Also, i never know whats the best/correct way to open the MOV/Quicktime video file itself, there are DirectShow and other means, but maybe we should move to the other thread, and keep this one for the External encoding effort

I may be getting a newer camera body (current one is almost 8 years old!!), so the format might change again more fun stuff...
stormy1777 is offline   Reply With Quote
Old 21st November 2018, 00:30   #28  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
Quote:
Originally Posted by stormy1777 View Post
You are scary.. why reveal the existence of such ruthless tools?.. it is very tempting now... that GradFun3 (wonder what ever happened to 1 and two has many parameters, how do you use it? or is there some "sane" default or does one need another tool or another PhD in something ? Avisynth is somewhat doable, just for the video opening, rest i think can be done in the GUI..

Also, i never know whats the best/correct way to open the MOV/Quicktime video file itself, there are DirectShow and other means, but maybe we should move to the other thread, and keep this one for the External encoding effort
Avisynth plugins and functions mostly have default values for their options, so GradFun3() in a script uses the default values, which is what I use 99% of time. As an example, GradFun3(thr=0.35) is the same as GradFun3(), as the threshold default is 0.35.

When you open a file with MeGUI's File Indexer, it defaults to what's generally the best indexer for the source, so it's just a matter of adding the indexing job to the queue and running it. For MOV files I assume it indexes with Lsmash. When the indexing has finished it'll create the appropriate script for opening the video and then open it with the Script Creator.
When you first use MeGUI it'll probably do a lot of updating and/or installing of the components it uses. You can get that out of the way by opening the updater under the Options menu. Check the "show all packages" option and if any tools are shown as disabled, right click on each one to enable them. When that's done, click the Update button.

DirectShow is generally a last resort method as it's not frame accurate and the decoding is beyond MeGUI's control. It's disabled by default. When it's enabled, you have to open a source directly with the Script Creator for MeGUI to offer it as a choice.
hello_hello is offline   Reply With Quote
Old 21st November 2018, 11:53   #29  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Here settings that work for me, using only ffmpeg.exe (not mkvmege.exe, x264.exe - haven't tried)
vdproject does not have anything special but including it just in case. Replace music.mp3 with something that you have and you are ready to export.

https://gist.github.com/shekh/55c790...3f3a498fdcbb7c
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 21st November 2018, 17:52   #30  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
shekh,

I'm in traveling mode, but will surely look into it shortly!! Thanks so much, I've already pulled the bits but will need time to put it together...

hello^2,
Hope you're OK with the ^2 shortcut it was funtime "right-clicking" all these modules in MeGUI, I guess they couldn't think of a single button or select all or shift or something like that, anyways, that whole interface looks a bit daunting and scary.. maybe one day it'll grow on me

Stormy.
stormy1777 is offline   Reply With Quote
Old 22nd November 2018, 01:11   #31  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Surprisingly I found no problem doing the same task with vd2 itself.
x264: use plugin codec (x264 8-bit)
muxing to mp4 or mkv: use plugin format in regular "Save As" dialog

In this experiment the MPEG audio decoder was operating in VBR mode, I suspect the procedure will not work otherwise (FFMpeg muxers want complete audio packets whereas CBR mode assumes the receiving end can eat arbitrary bytes).
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 23rd November 2018, 13:47   #32  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Quote:
Originally Posted by shekh View Post
Surprisingly I found no problem doing the same task with vd2 itself.
x264: use plugin codec (x264 8-bit)
muxing to mp4 or mkv: use plugin format in regular "Save As" dialog
Very interesting!! amazed to see VD2 has this capability; HOWEVER, tested, and we're back to square one at the start of this thread

Why? Because the Audio stream appears to be fully expanded and muxed, even though 'direct copy stream' is selected, which is why i was asking if mp3 can "live" still compressed in mp4 container, I suspect it can, but VD2 does not do it (yet) ?

This is my lack of knowledge on all these formats/containers, saved as .MOV and .MP4, both came to same size, and inside "File Information" both show as "QuickTime / MOV" for the "Container Format", strange, I would expect MOV to be Apple/Quicktime/MOV, and MP4 to be mp4/MPEG, but i guess these are somewhat related, or especially like that to confuse me

In any event, also saved as MKV, and again, the audio appears to be in PCM and 10 times larger in size!!

Verifying that by "File->Save Audio", on bottom it has "Compression" field, and that shows as "No compression (PCM)", as opposed to "copy stream" when it is compressed mp3. Also, the View->Display Audio shows the graph, which means the audio is fully expanded....

I'll try the external path you posted earlier, but clearly if this can be done within the VD2 framework, that would be a huge time saver!!

Stormy.
stormy1777 is offline   Reply With Quote
Old 23rd November 2018, 15:22   #33  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
It seems we make circles around the same thing: "1. copy-compatible source (e.g. internal avi, mpeg audio)"
Note the line in the project I shared above:
Code:
VirtualDub.audio.SetSource("music.mp3", "MPEG audio input driver (internal)", "DAAAAE1QM08AAAAA");
Quicktime and mp4 are closely related, afaik "QuickTime / MOV" is the name of format parser in ffmpeg rather than accurate identification of format itself, and since tha same parser can read a group of similar formats you see this name.
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 23rd November 2018, 15:52   #34  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Tried your script but it refers to some test driver?

Code:
VirtualDub.Open("","Test video input driver (internal)",0,"AQA=");
VirtualDub.audio.SetSource("music.mp3", "MPEG audio input driver (internal)", "DAAAAE1QM08AAAAA");
gives an error about input driver...

I've changed it to:

Code:
VirtualDub.Open("$(PROJECT)\\test.MOV","",0);
VirtualDub.audio.SetSource("$(PROJECT)\\test.mp3", "MPEG audio input driver (internal)", "DAAAAE1QM08AAAAA");
and it then opens video file OK, however, again, saving F7 , audio set to direct-copy-stream, appears to expand the audio.


I have not yet tested the External encoding route, also tried within VD2 directly, so:

* open video file: test.mov using: caching input driver
* open Audio from file, input driver: MPEG audio input driver (internal)

ctrl-p set x264 8bit video compression, CRF=16.

audio set "Direct copy stream", and then F7 to save in various containers, the audio in this case in the resulting saved file appears uncompressed PCM. Choosing an AVI container produces "expected results" with a compressed mp3 file..

It may turn out to be a "representation issue", where by the audio is mp3 even in the MOV/MP4/MKV case, but somehow there is a PCM "header" which tells it how to filter the audio... since file sizes seem to be similar.. but no easy way to know how much audio is taking other than exporting it, then u end up with a huge file, compared to the AVI container case.

Stormy.
stormy1777 is offline   Reply With Quote
Old 23rd November 2018, 16:06   #35  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
I'll try few more tries, if you/someone can confirm that after muxing an mp3 (direct copy stream), the resulting MOV/MKV/MP4 containers now hold a file which, when opened in VD2 shows as compressed audio, i.e. View->Display audio does not show a graph, and the File-Save Audio shows "(Stream copy)" and not PCM. If you can confirm that this works on your end, then I'll try other PCs or re-start from scratch (new Virtual Dub directory).. maybe all these plugins are causing it to get confused
stormy1777 is offline   Reply With Quote
Old 23rd November 2018, 16:47   #36  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Oh, so sorry, I had a typo, your vdproject does work, it opens a test 3d box, but really i don't see how that is changing anything, still F7/save, results in container (mp4/mov/mkv) with an apparent expanded mp3 (PCM) audio, vs. the original file which is mp3, that does not happen when in AVI container, but again, maybe it is just the way things are, although extremely confusing for us (normal people)
stormy1777 is offline   Reply With Quote
Old 23rd November 2018, 16:59   #37  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
So, with everything setup and only changing output container, you get compressed mp3 in AVI but uncompressed pcm in mp4?
This is hard to understand.
Unfortunately VD does have code to uncompress mp3 and some obscure logic to trigger this. It is definitely connected to audio mode (direct/full) but maybe something else (not yet identified).
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 23rd November 2018, 17:14   #38  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
I'm going by what I know and see.. File-Save Audio in the resulting mkv/mov/mp4 results in a LARGE PCM/WAV file, whereas the same operation on the saved AVI results in an MP3 file. if you/anyone gets other results, let me know...
stormy1777 is offline   Reply With Quote
Old 23rd November 2018, 18:23   #39  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
So you are doing:

1. convert test.mov+test.mp3 to new.mp4 -> success
2. convert new.mp4 to new2.wav -> fail

Why you don't see these are similar and unconnected operations.
You can begin right from #2, get some mp4 and try to extract mp3 from it. You still have to use direct-copy enabled driver as mentioned several times. "Caching input driver" does not support this yet.
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 23rd November 2018, 21:52   #40  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Right:

1) Mux test.mov (which has no audio stream at all) + test.mp3 >> test.mp4 all good.

2) attempt to EXTRACT mp3 from test.mp4 -> strange results...

I thought the focus was on the AUDIO input driver on the Open audio from file stage in step#1, but now i see the input driver of step#2 for the saved *VIDEO* open is critical..

OK for step#2, with Caching input driver, indeed all containers (except avi), produce a large WAV/PCM exported audio file, so clearly not the original mp3.

Tried with Quicktime input driver for step#2, and exporting the audio (via: file->Save Audio, OR: Export-> Raw Audio) yields a 1MB (1 minute) file whereas original is 4 minutes (roughly 4MB) I got no marker points on the video, playing it in VD2 plays the whole 4min, playing the extracted audio, indeed just 1 minute of audio is saved the original audio/video are about 4min long.

Tried with FFMPeg input driver for step#2, but exporting audio as above gets the PCM/fully expanded audio.. I assume it is just "working" on your end

Stormy.
stormy1777 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 16:35.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.