Avidemux Forum

Avidemux => Stable branch (2.5) discussion => Topic started by: Selvyr on August 19, 2012, 09:19:03 AM

Title: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Selvyr on August 19, 2012, 09:19:03 AM
I'm trying to trim a video clip (uncompressed direct video from PCSX2, a PS2 emulator) and sync it with the .wav sound file that comes along with it, separate from the video clip.

Whenever I press Play on Avidemux to preview the video and audio to see if they're in sync, the whole program simply disappears on the spot, without any message (apparently a crash).

- This happens regardless of what codecs (if any) I've chosen for either the video or the audio.
- If I play only the video with no audio, it doesn't crash.
- If I play a .m2v video file with the same .wav audio, it doesn't crash.
- The only way I can get around it is processing the video, watching it, determining if its in sync or not, adjusting the time shift, processing it again, watching it, etc...which is very slow and inefficient.

I'm going to try and look for more efficient ways past this that don't involve encoding the video twice (for obvious quality reasons) or losing bits of audio from the beginning and/or end, but I thought I should let you know about this rather crippling crash.
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: mean on August 19, 2012, 10:12:16 AM
what version of avidemux are you using ?
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Selvyr on August 19, 2012, 10:45:42 AM
Oh, sorry, forgot to mention.

Avidemux 2.5.6 (64-bit)
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Jan Gruuthuse on August 19, 2012, 11:28:38 AM
Can you try  if on windows this version: avidemux 2.5.6-1 (7716) @ http://avidemux.razorbyte.com.au/?
Can you upload an approx. 20 MB video in size causing this behavior to rapidshare, non pro should be non paying (https://www.rapidshare.com/) or similar service and provide the link for it?
Could help in pinpointing the problem?
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Selvyr on August 19, 2012, 11:58:04 AM
Tested it on 2.5.6-1, same crash but instead of just disappearing without a word it audibly plays a fraction of a second of the video, then crashes with a crash message: "Crash - Press OK to build crash info"

The uncompressed video has a VERRRRY high bitrate, so I had to cut it into a 0.066 second bit to meet 20 MB. (The cut piece still makes Avidemux crash, tested it.) It can be found here: http://www.mediafire.com/?18wo95fo5dur1dr
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: mean on August 19, 2012, 12:21:23 PM
It's because it's yuv422
Avidemux assumes yuv420 which is the more common flavor (DVD/bluRay/DVB/....)
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Selvyr on August 19, 2012, 12:39:34 PM
All I have options for in PCSX2's inbuilt capture system is 'YUY2' and 'RGB32', as far as uncompressed goes. It also has options for encoding with whatever codecs you have, but I'd have to trim the video afterwards so that's a no-no.

Is there any way of processing 'yuv422' to 'yuv420' without suffering in the quality / information department? I've no idea what those two stand for so I have no idea how to proceed. :P
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Jan Gruuthuse on August 19, 2012, 02:03:10 PM
Suggestions are around on the web to use fraps instead for recording? Don't know if free version is only usable for limited period?
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: mean on August 19, 2012, 02:19:07 PM
Actually It s a bug
Fixing it
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Jan Gruuthuse on August 19, 2012, 03:15:57 PM
works now with avidemux 2.6 r8140, pfew 20 MB for one frame ;).
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Selvyr on August 19, 2012, 11:42:11 PM
Fraps works too, but it's prone to making PCSX2 have random FPS dips, which in turn ruin the recorded cutscenes. PCSX2's inbuilt recording system produces flawless, 100 % solid footage at the cost of being slow to use...and now this.

I have a purchased version of Fraps too, but with my high settings on PCSX2 even running a 4.5 GHz cpu doesn't stop FPS dips from happening. Thus I have to use the built-in system and combine that footage with separate .wav clips...

Awesome, I'll try that once I have time; busy with other stuff atm.

Edit: I read 2.6 is 'highly experimental' and 'shouldn't be used for serious stuff'. What I'm doing is pretty serious so I'd at least like to know if the basic functions (encoding, audio time shifting etc.) work well... =\
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Selvyr on August 20, 2012, 07:49:47 AM
Sorry for the double-post, but I thought that way I'd alert you guys of new content in this thread. :p

When I open a 'yuv422' file in Avidemux 2.6.0 (r8140), the preview is discolored and, upon pressing play, only previews for a few frames before stopping by itself. You can't slide the timeline slider around either; it's stuck at the beginning. All this without even adding audio.
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: mean on August 20, 2012, 08:30:36 AM
Make sure your display is not set to openGl (it is known to be borked in some case)
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Jan Gruuthuse on August 20, 2012, 08:49:06 AM
Is avidemux 2.6 showing the correct colors?
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Jan Gruuthuse on August 20, 2012, 08:56:56 AM
This is how OpenGL display sometimes shows content. As mean says don't use OpenGL in preference video display. You can leave Enable OpenGL support marked.
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Selvyr on August 20, 2012, 09:48:34 AM
That first picture shows it discolored as well.

This is how it should actually look like:

(https://avidemux.org/smif/proxy.php?request=http%3A%2F%2Fpuu.sh%2FX3Wg&hash=a5b21fb80910b9a12a82bd172347a9eb819498cc)

And that discoloring problem wasn't alone; like I said it stops after only playing the first couple frames (which you wouldn't notice with the sample clip since it's less than 0,1 seconds long) and you're unable to move the timeline slider. =\
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Selvyr on August 24, 2012, 03:10:00 AM
Hello, any headway?

If it's too much work to fix, is there any way I can go around it? Can I process yuv422 to yuv420 without losing (virtually any) quality?
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: mean on August 24, 2012, 05:14:53 AM
I'd need a bigger sample
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Selvyr on August 24, 2012, 09:24:09 AM
Uploading a 0,8 second sample (max filesize for mediafire). Estimated to be done in 22 minutes.
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Jan Gruuthuse on August 24, 2012, 09:24:51 AM
some more yuv samples: http://media.xiph.org/video/derf/

List of supported YUV formats:
ffmpeg -pix_fmts
Resizing YUV:
ffmpeg -s 320x240 -i <input_320x240.yuv> -s 640x480 <output_640x480.yuv>
Changing YUV formats:
ffmpeg -s 320x240 -pix_fmt nv12 -i <input_320x240_nv12.yuv> -s 320x240 -pix_fmt yuv420p <output_320x240_yuv420p.yuv>
"-s" option can be used to resize YUV in same command
source: Open Source Video Processing Tools - MPlayer, FFMpeg, AviSynth, MKVToolnix, MP4Box (http://processors.wiki.ti.com/index.php/Open_Source_Video_Processing_Tools_-_MPlayer,_FFMpeg,_AviSynth,_MKVToolnix,_MP4Box)
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Selvyr on August 24, 2012, 09:55:13 AM
0,8 sec sample of uncompressed yuv422 from PCSX2: http://www.mediafire.com/?w7q49eakc0rde44

Meanwhile I tried to pick formats other than Uncompressed to get footage that can be properly worked on in Avidemux, but Fraps Video Decompressor resulted in no created video file (probably isn't compatible with PCSX2's built-in capture or something), and the rest I had there were compressed formats. Unless I use x264 I have to encode it again, and encoding twice = major quality loss. If I encode it with x264 right off the bat, I'm back to square one since Avidemux doesn't really tolerate working with them. So... I've still no idea what to do. =__=

@Jan: Is there no GUI program that does that? I've no experience working with ffmpeg / AviSynth; I've heard of them but that doesn't help me much.
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Jan Gruuthuse on August 24, 2012, 10:46:42 AM
Beyond basic usage, as I grade myself still a basic user. Was reply for mean.
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: mean on August 25, 2012, 06:37:50 AM
Thanks for the sample
Should work fine starting from r8157
Title: Re: Instant crash when previewing uncompr. video with .wav audio (x64 Avidemux)
Post by: Selvyr on August 27, 2012, 09:01:28 AM
Yep, it seems to work fine now. Problem is, the audio shift tool doesn't work in 2.6, so I still can't work on syncing the video and audio, unless I edit the audio clip in audacity beforehand. Also, there doesn't seem to be an option for Single pass (lossless) in the x264 options. All it offers is Constant rate factor and the likes. =\ I'm guessing I have to drag the rate factor closer to 0 to reach better quality...?

Anyway, I really appreciate the work you did, plus this tool (Avidemux) in itself of course. The lack of lossless option in Avidemux's x264 configs (it only exists in x264's OWN configs but it seems the configs in Avidemux override those) is the only thing holding me back now. The audio clips PCSX2 produces seem to be mostly in-sync with the video clips, so it seems I don't have to play with the audio shifts anyway. Though, for other peoples' purposes I suggest you try and fix it, if you can.