April 11, 2021, 07:03:43 AM

News:

--


Avidemux 2.7.8 broken AvsProxy

Started by Norbi, April 06, 2021, 06:12:30 PM

Previous topic - Next topic

Norbi

April 06, 2021, 06:12:30 PM Last Edit: April 06, 2021, 06:26:40 PM by Norbi
Hi, it seems Avsproxy(64) executable/function is broken in version 2.7.8 and unable to load audio with ffmpegsource and multithreading support is broken either.
Avs script is loading without issue with other programs but with avsproxy64 not.

FFmpegSource2("L:\xy.mpg",atrack=-1)
results error:
Importing..
25 / 1
Only int16 for audio and not 2!
Err: 0

With atrack=0 or atrack=1 parameters avsproxy do nothing just exiting without any error:
Loading Avisynth.dll
Avisynth.dll loaded
Env created
Importing..

without atrack parameter its working.

MT is not working either with Prefetch(Threads=3) script command, avsproxy exiting after seeking in avidemux.

AviSynthPlus_3.7.0
ffms2-2.40-msvc.7z


EDIT:
I'm confused.
I used avidemux_r210306_win64Qt5_56.zip portable version which has avsproxy function and executable....
I just installed Avidemux_2.7.8VC++64bits.exe which doesnt have any avisynth avs proxy support it seems....

eumagga0x2a

Quote from: Norbi on April 06, 2021, 06:12:30 PMit seems Avsproxy(64) executable/function is broken in version 2.7.8 and unable to load audio with ffmpegsource and multithreading support is broken either.

This is easily possible as I have never ever used any AviSynth functionality, it is 100% untested (in theory, I can perform at least some limited testing with VapourSynth, well, in theory...). Does it affect both MinGW builds and VC++ builds (I even don't remember whether it is packaged in both)?

eumagga0x2a

Quote from: Norbi on April 06, 2021, 06:12:30 PMI just installed Avidemux_2.7.8VC++64bits.exe which doesnt have any avisynth avs proxy support it seems...

Ah, thanks, good to know.

eumagga0x2a

VC++ builds seem to have even two AviSynth demuxers (interfaces between AviSynth and Avidemux), but, again, someone else needs to look into it, perform testing etc.

Norbi

April 06, 2021, 06:57:27 PM #4 Last Edit: April 06, 2021, 06:58:58 PM by Norbi
Quote from: eumagga0x2a on April 06, 2021, 06:46:30 PMVC++ builds seem to have even two AviSynth demuxers (interfaces between AviSynth and Avidemux), but, again, someone else needs to look into it, perform testing etc.
Didn't know that. Yeah, just realized that I'm able to open .AVS file directly from that Avidemux VC++ version and it seems its working with those options included either!  8)  I will do further testing and encoding a bit later. Dont know that the appimage version is faster/better or not comparing this VC++.
Thank you!

Norbi

Quote from: eumagga0x2a on April 06, 2021, 06:46:30 PMVC++ builds seem to have even two AviSynth demuxers (interfaces between AviSynth and Avidemux), but, again, someone else needs to look into it, perform testing etc.
I tried to encode a video,audio from avs script with Mpeg4 AVC x264 codec 2 pass, but I got a critical error at 1st pass end. The error message is:

Assert failed :0 at line 411, file F:
\jenkins\workspace\VS2019_no_import\avidemux_core\ADM_coreMuxer\src\ADM_coreMuxerFfmpeg.cpp
The application has encountered a fatal problem
The current editing has saved and will be reloaded at next start

eumagga0x2a

This assert failure means simply that the bit depth of uncompressed (L)PCM audio as passed to the muxer is unsupported. Currently only 16 and 24 bits per sample are supported, else you need to re-encode the audio stream.

Norbi

Quote from: eumagga0x2a on April 07, 2021, 05:06:47 AMThis assert failure means simply that the bit depth of uncompressed (L)PCM audio as passed to the muxer is unsupported. Currently only 16 and 24 bits per sample are supported, else you need to re-encode the audio stream.
Its PCM 48000Hz stereo 1536kbps [A: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s] (uncompressed PCM?)
It seems avs handling is still very problematic in avidemux. I loaded its original mp2 audio with avs video (dont want to reencode audio), but it seems avidemux is unable to cut external audio with the video together. Audio part is remains the same after I cut video.  :'(  :-X

eumagga0x2a

At the first glance, it looks like the NativeAvisynth demuxer doesn't set (and even doesn't initialize) the bitspersample member of the wavHeader struct, i.e. the bit depth value is just random. I guess it didn't matter back then, all non-float uncompressed audio was assumed to be 16 bits, hardcoded.

I've pushed a tentative fix, completely untested, obviously.

Unsure about audio seek, both issues may be related.

Norbi

Thank you Sir. Despite that saving the uncompressed PCM audio is not a good idea indeed. I didnt have much experience with avisynth, apologize for that.
I tested on the original mpeg2 video too and replaced the original audio track with external mp2, and cut the movie resulted the same. Cutting doesn't affect the external audio track. It always start to play from the beginning.

eumagga0x2a

Quote from: Norbi on April 08, 2021, 12:51:27 AMI tested on the original mpeg2 video too and replaced the original audio track with external mp2, and cut the movie resulted the same. Cutting doesn't affect the external audio track. It always start to play from the beginning.

Yes, indeed. External audio tracks are special as they are by nature independent from video tracks and thus don't have the segment handling logic which is available for internal audio tracks.

There is a good reason not to have one: imagine, you delete a portion of video loaded in Avidemux first, add an external audio track second, then you undo the deletion. What should happen? Should the external audio track get a gap?

Therefore, please always mux an external audio track into the video first, save the video, load the result, then perform any editing steps.

Norbi

Quote from: eumagga0x2a on April 08, 2021, 07:09:16 PMYes, indeed. External audio tracks are special as they are by nature independent from video tracks and thus don't have the segment handling logic which is available for internal audio tracks.

There is a good reason not to have one: imagine, you delete a portion of video loaded in Avidemux first, add an external audio track second, then you undo the deletion. What should happen? Should the external audio track get a gap?

Therefore, please always mux an external audio track into the video first, save the video, load the result, then perform any editing steps.
I think its more realistic scenario that people would like to cut video and audio in same time together, and don't have an already cut audio which needs video part to adjust to with the same cut points as audio.
It would be way better if avidemux was able to handle external audio track as a muxed one. Really cant imagine a scenario which needs to cut a video material to an already existed audio which is already in desired cut state before that somehow and need to add as an external track to video after cut it...


At the moment I have to do more sessions to achieve the desired result with avisynth.
- load the original TS material with its original audio and cut them together
- save copy of mpeg2 video and mp2 audio track as audio file
- load mpeg2 video thru avisynth script without audio
- add the already cut audio as external track and encode them together

I think this is the simplest way as far as I know. If I was able to cut with external audio, I wouldn't need to save the mpeg2 video. Despite that its not too much difference..