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

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th November 2018, 20:44   #1  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
VD2 External Encoder questions

In the "compress" dialog (ctrl-P) I was "force of habit" choosing "x264vfw H.264/MPEG-4 ACV codec", thinking it is the "best", however, was alerted that is probably not the best/latest X264 to use.

Few lines above it has: "x264 8 bit H.264/MPEG-4 ACV codec" as well as 10 bit.. although these seem to be same r2851, and i was told to use r2935...

Question1:
Is there a way for "me" to some how update the x264 to r2935 (without recompiling source codes) or must this be done by the developer of VD2?

Question2:
If "External Encoder" is the only option to get r2935 (latest) to work, is there a way to configure it to only encode the VIDEO, and leave the audio AS-IS, i.e. not compress at all? (direct copy stream) ?

I've setup the external encoding, and it works (aside from projected file size going all over the map), however, could not figure how to disable the Audio encoding..

1) tried setting "Audio encoder" to NONE in the edit external encoder SET. that failed during encoding audio.

2) Tried creating an audio encoder that supposedly is a "noop", just "copy stream" with these arguments:


Program: \Bin\FFMpeg\ffmpeg.exe
command arguments: -y -i - -codec copy "%(tempaudiofile)"
output filename: %(outputname).audio

but that failed as well:

Code:
---------------------------
VirtualDub Error
---------------------------
The audio encoding process has prematurely exited with an error code of 1 (00000001). Check the log for possible error messages.
---------------------------
OK   
---------------------------

Does anyone have a way to run latest X264 codec without external encoders? otherwise, if someone is using external encoders, how does one setup audio copy stream, instead of compressing it.

Thanks much for any tips.
Stormy.
stormy1777 is offline   Reply With Quote
Old 18th November 2018, 04:10   #2  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Q1: no, the codec must be recompiled with updated x264 library. Do you have any references why is r2935 preferred over r2851?
Q2: not 100% sure if this workflow is possible or not.
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 18th November 2018, 12:18   #3  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by stormy1777 View Post
1) tried setting "Audio encoder" to NONE in the edit external encoder SET. that failed during encoding audio.
Post the complete VirtualDub log. For me such things work fine. You did create a muxer setting with only video, right?

I once managed to do direct stream copy with external encoders as well. Worked with ffmpeg as "encoder". Pass raw audio data (do not "bypass compression") to ffmpeg with stream copy and output as e.g. raw .ac3 or something. The input filter is important because some of them decode the audio instead of passing the compressed bitstream to VirtualDub.

(I tested these on VirtualDub 1.10.4, though. Maybe some things broke in VirtualDub2.)


Don't expect any big differences between r2851 vs r2935.
sneaker_ger is offline   Reply With Quote
Old 18th November 2018, 18:52   #4  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
1) I guess the r2935 was just by chance, i.e. the current version.. I was using the x264vfw (naively thinking that as long as x264 is in the name, I'm good it was mentioned here:
https://forum.doom9.org/showthread.p...69#post1857369

2) As for encoding withOUT re-compressing the audio.. you suggest to have a muxer with video only?? won't the final file have NO audio? since only Video is packed there?

I tried to create an AUDIO "encoder" using "ffmpeg" with these flags:

"-y -i - -codec copy "%(tempaudiofile)""

Tried running it on a simple .mp3 and this is the output, so clearly that will also fail in the VD2 pipeline:

Code:
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3
 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libas
s --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenco
re-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enab
le-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libt
wolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --e
nable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --en
able-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable
-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --
enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --e
nable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
pipe:: Cannot allocate memory
it is almost I need something like "cat sound.mp3" just pass the audio onwards, and let the muxer add to the video.

If you have a sample working that would be great, since all my audio is already encoded at source.

Stormy.
stormy1777 is offline   Reply With Quote
Old 18th November 2018, 20:06   #5  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by stormy1777 View Post
2) As for encoding withOUT re-compressing the audio.. you suggest to have a muxer with video only?? won't the final file have NO audio? since only Video is packed there?
I was talking about 2 different issues.

Quote:
Originally Posted by stormy1777 View Post
it is almost I need something like "cat sound.mp3" just pass the audio onwards, and let the muxer add to the video.
The biggest problem is passing through the mp3 (or whatever) data still compressed. Again: the input filter/"driver" is important. Still haven't told us about your source format and input driver.


That said, your error message is about memory? Are you doing anything crazy that would require more than 2GB RAM the 32 bit versions support? Then you can try a LARGEADDRESSAWARE build (support for up to 4GB on 64 bit OS) or the 64 bit version.


P.S.: in the encoder settings let VirtualDub redirect all messages to the log so it's more complete.
sneaker_ger is offline   Reply With Quote
Old 18th November 2018, 22:57   #6  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
So I assume the route I'm going to is correct? To somehow create an AUDIO "compressor" that passes data as-is ("direct copy stream"), and a MUXER that does video+Audio? This is what I have, the thing that does not work in the "audio passthrough" and I've posted the results above.. if anyone knows how to make ffmpeg, or any other tool, just somehow pipe it in a format that muxer will understand , do let me know

Quote:

The biggest problem is passing through the mp3 (or whatever) data still compressed. Again: the input filter/"driver" is important. Still haven't told us about your source format and input driver.
Very simple, DSLR produces MOV (quick time) videos, NO audio is recorded, that is added from a pre-compressed .mp3 or whatever.

As for input driver, it uses the "Caching input driver", only time when i had to use the Quicktime is to save video "direct copy stream", but i don't do that anymore..

Quote:
That said, your error message is about memory? Are you doing anything crazy that would require more than 2GB RAM the 32 bit versions support? Then you can try a LARGEADDRESSAWARE build (support for up to 4GB on 64 bit OS) or the 64 bit version.
The mp3 file is 3MB in size, I can't think of anything 'crazy' , at least knowingly that I'm trying to do
System has 8GB of RAM, and 6GB currently used, that said, and unrelated to this error, I should be getting more memory in few days


Not sure it makes sense to try in VD2 if command line itself is failing, but did it anyways, just for fun

Audio encoding is the "passthrough" as defined earlier, and muxer is normal mp4box for mp4 video + the audio "passthrough".

It runs for a bit of time, sections from the log (removing the video parts b/c that part is OK), later it fails with:

Code:
---------------------------
VirtualDub Error
---------------------------
The audio encoding process has prematurely exited with an error code of 1 (00000001). Check the log for possible error messages.
---------------------------
OK   
---------------------------

This is the Start of the encoding session:

Code:
i] video encoder: "C:\Programs\VirtualDub2-42711\Bin\x264\x264.exe" 
    --input-res 1280x720 --fps 30/1 --demuxer raw --input-csp i420 --crf 18 
    --preset Medium --tune Film --output "M:\temp\test.mp4.video.mp4" -

[i] audio encoder: 
    "C:\Programs\VirtualDub2-42711\Bin\FFMpeg\ffmpeg.exe" -y -i - 
    -codec copy "M:\temp\test.mp4.audio"
[i] AudioEnc: ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
[i] AudioEnc:   built with gcc 8.2.1 (GCC) 20181017
[i] AudioEnc:   configuration: --disable-static --enable-shared --enable-gpl 
    --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls 
    --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype 
    --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb 
    --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy
    --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx 
    --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 
    --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp
    --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc 
    --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom 
    --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid 
    --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 
    --enable-avisynth
[i] AudioEnc:   libavutil      56. 22.100 / 56. 22.100
[i] AudioEnc:   libavcodec     58. 35.100 / 58. 35.100
[i] AudioEnc:   libavformat    58. 20.100 / 58. 20.100
[i] AudioEnc:   libavdevice    58.  5.100 / 58.  5.100
[i] AudioEnc:   libavfilter     7. 40.101 /  7. 40.101
[i] AudioEnc:   libswscale      5.  3.100 /  5.  3.100
[i] AudioEnc:   libswresample   3.  3.100 /  3.  3.100
[i] AudioEnc:   libpostproc    55.  3.100 / 55.  3.100
[i] VideoEnc: raw [info]: 1280x720p 0:0 @ 73/1 fps (cfr)
and then few seconds later it fails with this error:

Code:
[i] AudioEnc: [mp3 @ 0062bb80] invalid concatenated file detected - using 
    bitrate for duration
[i] VideoEnc: 1376 frames: 28.85 fps, 5243.13 kb/s  
[i] AudioEnc: [mp3float @ 0062d200] Header missing
[i] AudioEnc:     Last message repeated 224 times
[i] AudioEnc: Input #0, mp3, from 'pipe:':
[i] AudioEnc:   Duration: N/A, start: 0.025057, bitrate: 104 kb/s
[i] AudioEnc:     Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 104 kb/s
[i] AudioEnc:     Metadata:
[i] AudioEnc:       encoder         : LAME3.91 
[i] AudioEnc: [NULL @ 006358c0] Unable to find a suitable output format for 
    'M:\temp\test.mp4.audio'
[i] AudioEnc: M:\temp\test.mp4.audio: Invalid argument
[i] VideoEnc: 1386 frames: 28.81 fps, 5243.71 kb/s
tail of the log shows what the user is getting on the pop up:

Code:
[E] Error: The audio encoding process has prematurely exited with an error 
    code of 1 (00000001). Check the log for possible error messages.
[*] Ending operation.

Needless to say the MP3 file is 100% valid and works just fine with VD2's builtin audio multiplexer in "direct copy" mode as well as re-compress, i.e. the mp3 is *valid* and OK, the issue is how to mimic mp3/audio "passthrough" (direct copy) using ffmpeg or any other tool in a fashion that will allow the multiplexer to get the data in the right format (without recompressing the audio).

Stormy.
stormy1777 is offline   Reply With Quote
Old 18th November 2018, 23:28   #7  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Code:
[i] AudioEnc: [NULL @ 006358c0] Unable to find a suitable output format for 'M:\temp\test.mp4.audio'
With "-codec copy" ffmpeg knows it should keep mp3 codec from input but it is unable to determine a suitable container because you haven't explicitly specified "-f mp3" and it can't guess from the ".audio" file name. (Maybe it makes sense to choose a container that supports all your audio formats, e.g. "-f matroska". You're remuxing anyways.)

Last edited by sneaker_ger; 18th November 2018 at 23:30.
sneaker_ger is offline   Reply With Quote
Old 19th November 2018, 09:10   #8  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
OK!! some PROGRESS!!!!

Now the "audio encoder" called "Audio passthrough" looks like this (running ffmpeg):

Code:
-y -i - -codec copy -f mp3 "%(tempaudiofile)"
it ran through to completion, and produced a smaller overall MP4 file, say 160MB vs. 270MB (without the passthrough audio)... However I don't think we're there yet.

For AVI containers, GSpot freeware shows video/audio components/size, but not for MP4, so picked up a GUI tool called MP4 Inspector:

https://sourceforge.net/projects/mp4-inspector/

it shows bunch of stuff, but was not clear how large/format is the audio. Took both resulting mp4 and opened them in VD2, then did 4 export operations (RAW audio and RAW video) of both files. This is a 5min clip in MOV/quicktime format from a DSLR.

Video files came as ~23.5GB in size, identical to the number of bytes (prob. content is slightly different).

Audio came as 90MB (for the normal audio encoder) vs 46MB (for the -c copy -f mp3 "passthrough" encoder); whereas the resulting MP3 source file is roughly 5 MB..

by comparison, using an AVI container, with the builtin VD functionality, produces an audio track that is 5MB (with direct copy stream). I'm trying to mimic that with external encoder

So, the question, is it the case that MP4 container force an "upgrade" of the audio stream, or can mp4 contain the unmodified mp3 stream?

Thanks for any thoughts, I'll be happy to test out anything you can think of

Stormy.
stormy1777 is offline   Reply With Quote
Old 19th November 2018, 15:11   #9  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
You can put mp3 audio into an mp4 container. Whether or not your player can play mp3-in-mp4 is a different question.

I don't know how reliable GSpot is when it comes to determining audio stream size. If you want to be sure try to extract the audio again from the file. mp3 has a maximum bitrate of 320 kbps. So a 5 min clip should not have more than 12 MB of mp3 data.
sneaker_ger is offline   Reply With Quote
Old 19th November 2018, 18:07   #10  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Quote:
Originally Posted by sneaker_ger View Post
You can put mp3 audio into an mp4 container. Whether or not your player can play mp3-in-mp4 is a different question.

I don't know how reliable GSpot is when it comes to determining audio stream size. If you want to be sure try to extract the audio again from the file. mp3 has a maximum bitrate of 320 kbps. So a 5 min clip should not have more than 12 MB of mp3 data.
gspot is very reliable for AVI containers, it loses track with MP4 containers, so that is not an option, hence tried the various mp4 explorers, but could not get the Audio stream size...

One way I found very reliable, but time consuming, is EXPORT RAW AUDIO from VD2; and in the cases of the mp4 container (meaning external encoder), the exported RAW Audio comes 10-15 times the size of the original mp3 (e.g. 5MB vs 40MB+!)

Original mp3 is roughly 5MB for ~5 min clip. The exported raw audio comes to more than 40MB!! which means to me that the ffmpeg -c copy -f mp3 is not 100% mp3, OR, the MP4Box muxer "up-converts" this stream into something that is "supported" or "better" for mp4.. OR VD2 is somehow confusing video and audio when it exports raw audio only

End goal is to dedicate as much as possible to VIDEO, and leave the audio at the current size, no good will come from re-encoding an already encoded mp3 at ~256kps

Any further tips welcomed, and I can test right away..
Stormy.
stormy1777 is offline   Reply With Quote
Old 19th November 2018, 18:27   #11  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
In VirtualDub(2) File->Export->Raw audio doesn't necessarily mean it will export the bitstream 1:1 as it is in the source, only as it is delivered by the source filter. I just tried on an mp3-in-mp4 file and it seems to have output PCM (without wav header). If you do File->Save audio you will have the very same PCM but with wav header. But for me this also means such a file wouldn't pass mp3 bitstream through the same source filter.

If you want more insight always post the complete VirtualDub log, export of the External Encoder settings and MediaInfo of input and output files (in "Text" view, "View"->"Text").
sneaker_ger is offline   Reply With Quote
Old 19th November 2018, 18:30   #12  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
When you select mp3 with "Audio from other file", you should pick "MPEG audio input driver". Do you? 40MB sounds like uncompressed (produced by caching input driver).
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 19th November 2018, 20:06   #13  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
The input driver on initial audio open from file is set to "MPEG audio input driver (internal)".

The issue is very simple. take 5MB mp3, and mux it with VD2's builtin encoder, that results in a very small audio segment, take the AVI, and save Audio, will give back the 5MB audio give or take few bytes, with/out the wav/mp3 header, but still the resulting file is roughly same size, and in MP3 format.

Try the same with External encoder, and you cannot get the same mp3 back, b/c it gets up-converted into WAV, much the same way that earlier VirtualDub binaries had a bug and produced AVI with WAV audio despite user selecting "direct copy" and providing an mp3 compressed audio.

I do not know enough about muxer to know who is doing it, but it sounds like ffmpeg is doing a simple "copy" so either it is VD2 feeding ffmpeg, OR it is the muxer which expands the mp3 into WAV.. OR, I'm completely lost and there is no way to do that, although find that hard to believe, I just don't have any mp4 with mp3 audio to verify.

Look in VD-> File-> File Information.

In the mp4 case , it does not look like 100% mp3, it does say encoder mp3, but rest looks different than an avi with mp3 audio track.

if u can get an mp4+mp3 inside, or know where i can download one, that would help too, to compare.

Stormy
stormy1777 is offline   Reply With Quote
Old 19th November 2018, 20:56   #14  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Tried and it works.

This command is ok:
Code:
-y -i - -codec copy -f mp3 "%(tempaudiofile)"
Profile option "Bypass compression" must be unchecked!
Otherwise the audio is decoded by internal mp3 decoder.

Yeah, intuitive
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 20th November 2018, 09:38   #15  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Quote:
Originally Posted by shekh View Post
Tried and it works.
What works? Can you extract the mp3 back from the externally encoded mp4 container, and is it same size as the original mp3? or do you get the PCM/raw/expanded data?

Quote:
This command is ok:
Code:
-y -i - -codec copy -f mp3 "%(tempaudiofile)"
Profile option "Bypass compression" must be unchecked!
Yes, this is what I got setup since '-f mp3' was mentioned the other day; as fpr the "bypass compression", was not aware of that screen, it was/is unchecked, however, not sure i agree with "intuitive" I would think it SHOULD be checked, to "bypass" compression, and send it as-is, tried it checked; it fails on an anonymous pipe failure, so leaving unchecked for now

So, yeah I do get MP4 containers, however, I think that the AUDIO segment in them is WAV format and not mp3.

Can you confirm on your mp4, try save audio, or export audio segment and compare the size of original mp3


This is my profile-SET in effect with full audio processing:

Code:
			"AVC [Film] (10bit)MP4": {
				"videoEncoder": "V AVC [Film] (10bit)x264",
				"audioEncoder": "A AAC @~192K [Qaac]",
				"multiplexer": "M MP4Box",
				"description": "*.mp4 (MPEG-4 Part 14)",
				"extension": "mp4",
				"processPartial": false,
				"useOutputAsTemp": false
			},
and, this is the duplicated entry, just change the Audio to the "A passthrough" encoder:

Code:
			"AVC [Film] (10bit)MP4pass": {
				"videoEncoder": "V AVC [Film] (10bit)x264",
				"audioEncoder": "A Passthrough",
				"multiplexer": "M MP4Box",
				"description": "*.mp4 (MPEG-4 Part 14)",
				"extension": "mp4",
				"processPartial": false,
				"useOutputAsTemp": false
			}
In above, the video, and multiplexer are the SAME, just audio changes.

The "A passthrough" is defined as follows:

Code:
			"A Passthrough": {
				"name": "A Passthrough",
				"program": "C:\\Programs\\VirtualDub2-42711\\Bin\\FFMpeg\\ffmpeg.exe",
				"commandArguments": "-y -i - -codec copy -f mp3 \"%(tempaudiofile)\"",
				"outputFilename": "%(outputname).audio",
				"type": 1,
				"pixelFormat": "",
				"inputFormat": 0,
				"checkReturnCode": true,
				"logStdout": true,
				"logStderr": true,
				"bypassCompression": false,
				"predeleteOutputFile": true
			},
For completeness, the mp4box muxer is defined:

Code:
			"M MP4Box": {
				"name": "M MP4Box",
				"program": "c:\\Programs\\GPAC\\mp4box.exe",
				"commandArguments": "-add \"%(tempvideofile)\" -add \"%(tempaudiofile)\" -fps %(fps) \"%(outputname)\"",
				"outputFilename": "",
				"type": 2,
				"pixelFormat": "",
				"inputFormat": 0,
				"checkReturnCode": true,
				"logStdout": true,
				"logStderr": true,
				"bypassCompression": false,
				"predeleteOutputFile": true
			},
Doing a TEST clip with a small SELECTION (that is 10 seconds from the whole 5 min clip), produced a video withOUT any audio at all... When doing the normal audio processing the video has audio..

Clearly I'm not doing something right, just not sure what it is.. if anyone has external encoder to handle this case, please post the code...

until then I'm back to using the internal encoders, just not sure which should be used:

X264 10 bit - H.264/MPEG-4 AVC codec

OR:

X264 8 bit - H.264/MPEG-4 AVC codec

Using same video/CRF values, etc. the 8bit produced 5980kbps video filesize 5.3MB, vs: 10bit 5093kbps filesize: 4.5MB..

my eyes are not good enough to tell the difference So will use the 10-bit for now.. hopefully that is compatible enough for the long term...

This is not 'urgent', just something to figure out at one point or another

Stormy.
stormy1777 is offline   Reply With Quote
Old 20th November 2018, 09:44   #16  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
For x264 I'd stick with 8 bit unless you really need 10 bit. Everything will play 8 bit AVC, but there's not much support for 10 bit outside of the PC and probably never will be. You'll be encoding your video in a format hardware players don't support.

I haven't followed this thread much, aside from noting the drag and drop nature of VD2 and how quickly easily you're encoding your video (sorry, but I couldn't help myself, I'm only human )

Have you tried manually extracting the mp3 audio from the source and adding it to the output file yourself? Unless you're editing? I can't be of much help as normally I'd remux a MOV file as MKV before re-encoding it, and extract the audio myself. MKVToolNixGUI makes working with MKVs pretty easy and programs such as gMKVExtractGUI and MKVCleaver (and MeGUI) can extract streams from MKVs. Working with MP4s does my head in, and trying to mux with MP4Box destroys my will to live.

Can you use Std In with direct stream copy? I wouldn't have thought so, but I don't know much about VD. Maybe that's why you suspect the output is really a wave file?
-y -i - -codec copy -f mp3 "%(tempaudiofile)"

Anyway, why not extract the audio yourself first, if you're not doing so already?

ffmpeg.exe -i "source.mov" -vn -acodec copy -sn "audio.mp3"

That should be something like a command line for extracting it with ffmpeg outside of VD2. Once you have the MP3 audio extracted, add it via the Audio Menu while making sure MP3 is selected as the input file type. I think that should ensure Direct Stream Copy works it won't be decoded by ffmpeg.
To get VD2 to mux it with the encoded video..... unfortunately I've no idea how that works.

Last edited by hello_hello; 20th November 2018 at 12:15.
hello_hello is offline   Reply With Quote
Old 20th November 2018, 10:24   #17  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Hello_Hello,

You are human and very good at it!! Funny comments, enjoyed every joke Honestly, I did not anticipate it being so complex, but starting to enjoy the puzzle aspect of this very much and the supporting energies

Thanks for the tip on the 10bit!!! Immediately ABORTED the encodes, and restarted with 8bits!! so many speed bumps and trap doors - need a Scooby Doo

As for my sources, the MOV file has NO audio, the audio is a separate mp3 pre-encoded, just need to Mux it (without re-encoding the mp3) into an mp4 container, but your remarks on mp4box are not very encouraging... so you're trying to convert me to MKV, i love that format, but for now i'll stick with the "herd" (mp4 or avi) so it is less 'scary' to others.

Until this external-encoder audio-passthrough is sorted out using the internal one (8bit of course!!!).

Thanks for the education, and feel FREE to joke around, that is very well received - maybe I'll do a video on it one day

Stormy.
stormy1777 is offline   Reply With Quote
Old 20th November 2018, 10:42   #18  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Quote:
Originally Posted by stormy1777 View Post
What works? Can you extract the mp3 back from the externally encoded mp4 container, and is it same size as the original mp3? or do you get the PCM/raw/expanded data?
Works: direct-copy audio through external encoder process. I did not follow mp4 manipulation, for my test I muxed into mkv with ffmpeg and I'm quite sure the resulted audio is mp3 otherwise it would not decode.
Your profiles look ok.
I must say direct-copy with external profiles is darkest shade of grey area.
Checklist of what is required:
1. copy-compatible source (e.g. internal avi, mpeg audio)
Nowhere in the ui you can see what is the format of current audio.
Try to show audio display and if it says "audio is compressed" then maybe it is mp3.
2. audio mode set to direct-copy
3. audio encoder set to not bypass compression (when I said this is intuitive I was joking)
Maybe there is something else. Try using ffmpeg muxer instead of mp4box, maybe it will tell something different.
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 20th November 2018, 11:27   #19  |  Link
stormy1777
Registered User
 
Join Date: Jul 2002
Posts: 241
Ah, should've picked up on the sarcasm with regards to intuitive, just shows how seriously i take your words

In my case the audio stream is well known, and 100% mp3 format as a separate file.

Took both of your offers, and tried MKV, downloaded v28.2, added this:

Code:
			"AVC [Film] (10bit)MKVpass": {
				"videoEncoder": "V AVC [Film] (10bit)x264",
				"audioEncoder": "A Passthrough",
				"multiplexer": "M MKVMerge",
				"description": "*.mkv",
				"extension": "mkv",
				"processPartial": false,
				"useOutputAsTemp": false
			},
and this:

Code:
			"M MKVMerge": {
				"name": "M MKVMerge",
				"program": "c:\\Programs\\VTools\\mkvtoolnix\\mkvmerge.exe",
				"commandArguments": "-o \"%(outputname)\" --default-duration 0:%(fpsnum)/%(fpsden)fps \"%(tempvideofile)\" \"%(tempaudiofile)\" ",
				"outputFilename": "",
				"type": 2,
				"pixelFormat": "",
				"inputFormat": 0,
				"checkReturnCode": true,
				"logStdout": true,
				"logStderr": true,
				"bypassCompression": false,
				"predeleteOutputFile": true
			},
Got an MKV, audio/video play OK, however, I think the Audio is *PCM* and NOT mp3...

As for seeing the format of audio, you would know better than me on that.. however, noticed that selecting VD2-> File -> Save Audio... opens a dialog to enter filename, on the bottom, there is a readonly field "Compression:"

In the resulting MKV file (with supposed Audio Passthrough), it says No compression (PCM), and in the case where a true MP3 is attached, it shows "(Stream Copy)"...

Also, the Saved audio (from the mkv) plays ok, but file info says it is PCM.

If you have time, take a larger clip/mp3, like 10minutes or so, then u'll see SIZE differences, that's how i noticed in the first place, since the source mp3 are ~5mb, but final audio in mp4 was more than 10 times in size, that does not make sense...

Quote:
Try to show audio display and if it says "audio is compressed" then maybe it is mp3.
Where is that option hiding?

Stormy.

Last edited by stormy1777; 20th November 2018 at 12:16. Reason: typo in xml
stormy1777 is offline   Reply With Quote
Old 20th November 2018, 11:44   #20  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
> Where is that option hiding?

Main menu->View->Audio display

atm this is mostly useful with caching input driver but as I said it has side effect of telling "compressed".

When you open the newly created file in VD2 you can go to Main menu->File->Information, there you can see audio format as stored in the file (should be "mp3").

Don't know why it still does not work for you. Can you save temp audio file and inspect it? There is no obvious way to grab it, you need something like muxer command that will simply copy the audio file as is (this could be some generic file utility, pkzip for example).
__________________
VirtualDub2
shekh is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 20:27.


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