VideoHelp Forum




+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 61
  1. I've done a few searches here, and only found VirtualDubMod that sounds even close to what I'm looking for. There may be more, but I had trouble narrowing the search.

    I have 1000's of single song music videos, and frequently need to edit them to remove intro's, long endings etc. When doing so, I frequently find that the audio is slightly out of sync (perhaps 100ms one way or the other). None of the conversion/splitting/editing tools that I use at the moment have an option to quickly and simply adjust the audio delay my an amount in ms. I am very surprised that this function is not in every converter/editor because it would be very useful and I believe not difficult to implement.

    A lot of my encodes from years ago have sync errors due to the buggy and flakey conversion and ripping software that used to be around at the time. Please Please Please can someone recommend a nice converter/splitter/editor/ripper that alos has this audio sync correction in it.

    To give you an idea of what I'm looking for, I like :-
    AVS Video Converter (but that currently has a bug that adds a green tinge to most output)
    Aimersoft Video Converter Ultimate (but that has its own audio sync problems)
    Handbrake (but for me it's missing a few basic requirements - simple splitting to all chapters, trimming of output files, input preview etc.)

    Thanks,
    Cy
    Quote Quote  
  2. No responses?

    With all the complexity of converting & editing videos - frame rates, compression codecs and associated variables, AR, it would seem a simple option to add i.e. adjust audio by XXms, and delete/blank video at start/end of audio adjustment. I'd have a go at doing it myself, but my days of assembler coding are over, too old and too busy with other stuff now, I'll leave it to you younger guys and gals LOL
    Quote Quote  
  3. avidemux, there is a shift box under the audio, checkmark it, enter the delay +/- in ms, press play, refine the number, rinse, repeat
    Quote Quote  
  4. Some video converters do let you specify an audio delay, but generally they work out the audio delay used in the source file and apply it when converting. Mostly, you don't know if there's going to be sync issues till the conversion process is complete, which makes it hard to adjust the audio delay accordingly before you convert.

    Usually, you'd try to fix audio sync errors without re-converting either the audio or video, simply by remuxing it into a new file. VirtualDubMod will obviously do it for AVIs (with direct stream copy selected as the video mode). Yamb is an example of an MP4 muxing program, MKVMergeGUI for MKVs. MKVMerge will open AVIs, MP4s, MKVs etc and resave them as MKVs. You'd just click on the audio stream, enter the correct delay and save the output as an MKV.

    Cutting the video can be done easily without re-converting too, as long as you cut on keyframes. VirtualDubMod will, but programs designed to remux video won't give you a preview as they're not designed to be editors, but they will split video. Generally you'd type in the time where you want the video to be split (or a little before) and it'll be split on the next keyframe.

    Personally if I want to adjust the audio sync I open the video using MPC-HC and use the + and - keys on the numeric keypad while the video is playing. Once it's right I make a note of the audio delay being displayed in the status bar (positive or negative) open the video with the appropriate remuxing program, add the audio delay, and then resave it as a new file.

    Or as suggested poisondeathray suggested, there's also avidemux.
    Quote Quote  
  5. Originally Posted by poisondeathray View Post
    avidemux, there is a shift box under the audio, checkmark it, enter the delay +/- in ms, press play, refine the number, rinse, repeat
    Thanks, I'll take a look, but I am really looking for a more universal tool, not just AVI.
    Quote Quote  
  6. VH Wanderer Ai Haibara's Avatar
    Join Date
    Jan 2006
    Location
    Somewhere on VideoHelp...
    Search Comp PM
    AVIDemux supports more than just AVI. For example, here's a list of the input formats it supports. And, a list of the output formats.

    (Of course, those were last updated in 2010, so more may have been added.)
    If cameras add ten pounds, why would people want to eat them?
    Quote Quote  
  7. Originally Posted by hello_hello View Post
    Some video converters do let you specify an audio delay, but generally they work out the audio delay used in the source file and apply it when converting. Mostly, you don't know if there's going to be sync issues till the conversion process is complete, which makes it hard to adjust the audio delay accordingly before you convert.

    Usually, you'd try to fix audio sync errors without re-converting either the audio or video, simply by remuxing it into a new file. VirtualDubMod will obviously do it for AVIs (with direct stream copy selected as the video mode). Yamb is an example of an MP4 muxing program, MKVMergeGUI for MKVs. MKVMerge will open AVIs, MP4s, MKVs etc and resave them as MKVs. You'd just click on the audio stream, enter the correct delay and save the output as an MKV.

    Cutting the video can be done easily without re-converting too, as long as you cut on keyframes. VirtualDubMod will, but programs designed to remux video won't give you a preview as they're not designed to be editors, but they will split video. Generally you'd type in the time where you want the video to be split (or a little before) and it'll be split on the next keyframe.

    Personally if I want to adjust the audio sync I open the video using MPC-HC and use the + and - keys on the numeric keypad while the video is playing. Once it's right I make a note of the audio delay being displayed in the status bar (positive or negative) open the video with the appropriate remuxing program, add the audio delay, and then resave it as a new file.

    Or as suggested poisondeathray suggested, there's also avidemux.
    Thanks very much for the very detailed and helpful response. MKVMerge definitely sounds interesting.

    Yes, I agree with the way you use MPC, that's why I'm looking for a program that accepts ms numbers rather than sliding an audio object around, testing, moving testing......

    I'm still looking for an all in one tool that has this function, and I may try to persuade someone to add it, once I settle on a new tool.
    I haven't had time to checkout the latest tools for a few years, so I'm currently in the middle of testing a load of tools to replace and/or supplement the ones I currently use.

    My favorite is AVS Video Converter. It has grown from a very buggy but usable tool, to a pretty stable allrounder. My big problem is that they just don't seem to be able to fix the bug I mention above, so I have to manually adjust green, brightness and contrast for every job which is just a major pain. Aimersoft on the other hand have slowy tried to combine all their products into one, and IMHO made a big mess of it. Their biggest bug is that the converted output now usually ends up with A/V slightly out of sync. They don't really notice it and are not taking it too seriously because its only about 50ms. My problem is that the content I work with is Music Videos, and if the lips as well as more importantly dancing is out of sync, it is much more noticeable and frustrating.

    The tools mentioned so far will help, but an all in one tool with this function is my ultimate goal.

    You say some converters do let you set an audio delay. Which ones? I've not seen one.
    Quote Quote  
  8. Off the top of my head.... MeGUI definitely lets you set/adjust the audio delay and ffcoder does via an AVIsynth script. It has script templates to make it easy, but unlike MeGUI I assume you have to actually convert the audio to delay it (don't hold me to that). I think RipBot264 and HDConvertToX also do but I don't have either installed to check the moment.

    MeGUI as an example (it's the GUI I use), extracts the audio from the original video file to your hard drive to use when encoding. It's "Input" tab is divided into video and audio sections, the latter having a spot for manually adding an audio delay. Usually when extracting the audio, any delay required is written to the audio file's name and MeGUI automatically specifies the same delay amount, but you can easily change it. Pretty much the same thing applies when using the existing audio rather than converting it but you specify/change the delay while adding the encoding job to the queue.

    If your audio is only around 50ms out using Aimersoft I could take a guess..... what format are you converting the audio to? If it's a lossy format such as MP3 or AAC..... most encoders add "padding" to the beginning and end of an audio file for various reasons.... basically a little bit of silence.... they usually write the amount of padding used to the audio file itself, which is how audio players achieve gapless playback using compressed formats, and in theory a good converter should take that into account when combining the converted audio and video, however....

    VirtualDubMod does it for MP3 (and I assume AC3) but different MP3 encoders use different amounts of padding.... I'm not sure if it just uses a fixed value or if it adjusts MP3s cleverly, although I've converted lots of video to AVI and the sync is basically spot on (I have a convoluted method for checking it's the same as the original).

    In the case of AAC the encoder should write the padding to the MP4 file, and through a bit of trial and error I worked out for Nero AAC it's generally around 50ms or a little more. Recent versions of MKVMergeGUI (which MeGUI uses for muxing) will apply a negative delay accordingly when muxing AAC audio (not other audio types though). As it's a negative delay, MKVMerge basically cuts a little from the beginning of the AAC so both audio and video begin at the same time and in sync. As compressed audio uses frames of sorts, it can't always cut at the exact spot so it adds extra delay to compensate if need be. When a lot of my encodes started appearing with a 9ms audio delay.... well it took a bit of investigating to work that one out.

    50ms is basically very little though. I'm not sure I'd often notice a delay too much under 100ms but once I do.... it drives me nuts. Many times though I've adjusted audio delay while watching video, only to come back the next day to think it was right in the first place, so maybe sometimes it's my brain which is delayed.

    I'd tell you about my current audio sync horrors (I've literally spent the entire day today adjusting the frame rate of encoded video to sync the audio), but the last batch of encoding jobs has finished and I've typed enough anyway.....
    Quote Quote  
  9. THANK YOU AGAIN! I just can't begin to explain how helpful your responses have been.

    I will add the other tools you mention to my evaluation list.
    Yesterday I evaluated another 2 tools.
    SolveigMM Video Splitter - Seems very well put together, professional tool but no function to handle DVD's well.
    Womble MPEG Video Wizard - Seemed a bit like Aimersoft, a lot of individual tools badly glued together but it grows on you. Found the audio delay hidden away deep in one of the menus. Can't handle some files, also crashes occasionally. Its conversion tool is a real mess, and the encode settings are very unclear as to what will be used. As I said it grows on you, and I prefer it over SolveigMM because of the extra functions and especially its DVD Reader that helps with ripping.

    In response to your question - The delay is perhaps a little more, around 100-200 (I've not spent any time measuring in detail because it seems to vary, and I too occasionally believed it was in my head, but its not. Now all you people in there be quiet while I'm typing LOL).
    I just used Womble to fix an Aimersoft encode from a few days ago. The conversion was from DVD to MP4. I don't recall what the source audio was, but it was converted to VBR AAC, so your suspicion about padding could be correct.

    Interesting you are having audio sync problems at the moment too. Because of the variable nature of my problem, and the fact that I caught it far too late, quite a few of my 6000 hand picked music videos exhibit the problem (to varying degrees). As you say, it can drive you crazy, so as I watch them, if I see one that is very noticeable, I make a note to fix it later.

    Sorry can't help with your issues, but if you have computer problems, I'd be happy to help if I can. I worked in IT for about 30 years from PC's to Mainframe OS assembler programming, so I can understand all the technicallities of AV encoding, but never worked with it at a very low level (I did start reading "Video Demistified" in the past, but it was too dry and boring for me to get very far).

    My problem is that quick and dirty tools like Aimersoft can help when I am backed up (like now), with 30 DVD's and other music programs in various formats that need splitting, editing, cleaning up (logos, titles etc.), trimming, cropping and audio adjustments made (volume, sync). New stuff is arriving all the time, and I've got another 2000 individual NEW song files that need to be viewed, compared and edited as necessary simliar to the DVD's above...... Anything that speeds the process up without introducing errors or unacceptable quality loss is a godsend.

    Just a few quick follow up questions:-
    1) MKVMerge links to the tools page for MKVToolnix. Is that the same product you are talking about?
    2) Could you please summarize your convoluted checking method. I might use it myself, but more importantly, I'd like to get Aimersoft to use it and get them to fix their product.
    3) You can spot a 9ms delay?!!! With your eyes?
    4) I noticed in Womble that you can view start/end by timecode. I didn't think any of these formats used timecodes....
    Last edited by CyborgX333; 18th Jul 2012 at 23:01.
    Quote Quote  
  10. 1. Yes.
    2. I'll explain below.
    3. I wouldn't notice a 9ms delay without using my audio sync checking method.
    4. I'm not sot sure if they're always timecodes as such. It can probably work out the position pretty accurately though (according to the frame number).

    To sync the audio and assuming the source video is definitely in sync....
    I open both the source and encoded version using two instances of MPC-HC then get them to play the video at the same time. I adjust them by quickly pausing/restarting one of them (or usually both) until the audio is synced. You can tell when it's in sync because rather than hear any type of delay you'll hear a "phasing" effect. Sometimes it happens nice and easily, other times it takes quite a few quick stop/starts of each video.
    Once the audio is in sync, it's just a matter of watching the video for scene changes. If they happen at exactly the same time the audio/video sync is the same in both versions. Using that method I can usually verify the audio sync down to at least 10ms. If the audio sync isn't the same then I adjust the audio delay using MPC-HC until it is. Unfortunately using the + and - keys to change the audio delay doesn't always seem to work with two instances of MPC-HC playing video. It seems you need to pause them both, adjust the audio sync of one, then restart them.

    I spent yesterday converting a bunch of MKV files. Here's the mystery.....
    They're 25fps according to every program I've tried. ffdshow's on screen display says they're 25fps with a 40ms frame duration, and I even used MKVCleaver to extract the video timecodes from the MKVs to a text file and the time codes all have nice even 40ms frame durations.
    If I open one of those MKVs using MKVMergeGUI and resave it without specifying a frame rate the audio stays in sync. If I specify a 25fps frame rate it invariable puts the audio out of sync (it starts off okay but loses sync gradually). I don't understand why, but the problem is, the same thing happens when converting them. I've even tried putting the original audio and video in an AVI but still have the same sync issues.

    Normally when I have audio sync problems I can't solve I use AnyVideoConverter to do it for me. I've no idea what it does to be clever, but with the sync setting on default and set to maximum in AnyVideoConverter's options it always converts without effecting the audio sync. So if all else fails I use AnyVideoConverter to convert the video to an AVI containing lossless video and audio, then I convert that AVI to the final format using MeGUI or AutoGK. Only problem is, whatever's going on with these MKVs.... AnyVideoConverter won't convert them. It just produces a 5kb file and stops.

    So yesterday, after remuxing each MKV to AVI so I could convert it using AutoGK via DirectShow (I wanted to use some of ffdshow's filter's while converting), I opened each remuxed AVI with VirtualDubMod, took a guess at adjusting the frame rate a little, resaved the AVI, played some of the video, adjusted the frame rate a little more, resaved it.... etc etc. Then when I had it about right I'd use the "2 player" method to check the audio sync with the original, open the remuxed AVI again, adjust the frame rate a little.... then finally I could convert it.
    A couple had to be split so I could adjust the frame rate in sections, so then I used AnyVideoConverter to convert them to lossless AVI while merging the output as a single AVI again, and the lossles AVI could be converted using AutoGK, but most of them could be fixed simply by adjusting the frame rate (although of course hardly ever by the same amount). So I literally spent the whole day sitting in front of the PC manually adjusting frame rates and checking audio sync, and I'm still none the wiser as to why I actually needed to do it.
    Quote Quote  
  11. Tanks for the answers, I'll give the sync test a go when I have a bit of spare time.

    Your problems sound rather weird, but it's the nature of the beast we have decided to tangle with LOL.

    My comments would be:-
    What is the source (MKV) video codec?
    What is the codec of the source audio, and is it DEFINITELY NOT being recoded by MKVMergeGUI on either encode (out of sync or even perhaps the in sync time)?
    Actually Womble conveniently shows you graphically which parts of both video and audio will be recoded and which will be untouched. You might want to try some of your jobs above using that to see which bits are ACTUALLY being changed and when.
    My logic as an IT problem solver for many many years says to me that EITHER:-

    a) the audio is being recoded on at least one of your jobs

    b) MORE LIKELY the frame rate is NOT EXACTLY 25fps, but that is the closest the programs you have used so far can report it. (try loading into SolveigMM Video Splitter. Even though it's not a very useful tool for me, it seems to do a very good analysis of the source file, perhaps it will show a different framerate, or some other abnormality. The trial version is full function.

    c) The MKV's may be built from clips at different frame rates.
    As I already explained I don't know all the codecs down to a low enough level to say what's possible, but I have come across videos put together from varying sources and combined very badly, giving video processors a real headache, especially when trying to deinterlace (but that's another story).

    By coincidence, I did also give AnyVideoConverter a quick evaluation a few days ago. I found it didn't fit my requirements, but I did notice the weird Audio sync option you talk about. There was no explanation of EXACTLY what turning it on/off or moving the slider did, so I asked them. The first response was just a copy paste from the help file, but I said that wasn't an answer. Got their second attempt today. No better. I will find out! LOL

    Totally aside, I was going through my Denon Receiver settings the other day and it has a Lip Sync on/off. Now I haven't asked yet, but it seems to me to be a totally impossible job for an Amp to do. I KNOW it's not interpreting the video and watching lips, so what does the function actually do....? It's great marketing to have it in a brochure, but....... I'll send that question to my Denon techies soon.....

    BTW still waiting for your response to my PM....
    Quote Quote  
  12. Duplicate frames..... something to do with those damn timecodes anyway...... I eventually tried extracting video and audio timecodes from an MKV, re-muxing it while specifying a frame rate (which messes with the audio sync) then using the timecodes from the original MKV while remuxing the second MKV as a third MKV. Using the audio timecodes from the original MKV did nothing, using the video timecodes fixed the audio sync, yet both timecodes had perfect 40ms increments...... then finally the penny dropped.....

    I looked at the very last number for the timecodes from both the original MKV and the second MKV where I'd specified a 25fps frame rate, and they were different, so then I scrolled slowly though each MKVs timecodes and.....
    The timecodes where I'd specified an exact 25fps were always 40ms apart, but in the original MKV every so often, a timecode was missing, so rather than the numerical order being 40, 80, 120, 160, 200 etc, it'd be 40, 80, 160, 200......

    I assume a missing timecode simply causes the frame in question to display for what would normally be two frames. Include enough of them and over the length of a video the audio sync will noticeably change if they're all reduced to normal frame duration instead.

    Why some of these have enough 80ms frames to effect the audio sync I'm not sure, and how I can convert them while taking those 80ms frames into account I don't know. I'm still hoping AnyVideoConverter's audio cleverness will save me, even if I need to convert them all to lossless format using it first, however before I can do that I need to work out why AnyVideoConvrter keeps spitting these MKVs out and how to rexux them so it won't.....
    At least now I know I'm not going mad, I was wondering why sometimes changing the frame rate seemed the perfect solution while other times I wasn't sure it kept the audio sync perfectly consistent, even though it'd be perfect at the beginning, and perfect at the end. I guess if those 80ms frames aren't unevenly distributed......

    Sorry, I saw your PM yesterday, got sidetracked and it's still sitting open in a browser tab, but with about 30 other tabs still open it slipped my mind until I returned here. I'll reply very shortly.
    Quote Quote  
  13. Well done! I bet that was satisfying when you found it.

    I too got sidetracked past couple of days and re cataloged my DVD. Bluray and Digital movie archive collection. I used to use DVD Profiler, but just got a new one that runs on IOS and has a shelf display view as well as a coverflow view. Also syncs across all devices and easy backup.

    If I understand you correctly, in the original file, the video timecodes were ok, but the audio timecode intervals varied between 40 and 80ms, and iyou had more audio timecodes than video timecoes?

    Now you need to keep the original file and try a load of tools against it and see if any of them spot or give any indication of the abnormality. Did you try SolveigMM as I suggested? It has graphic display of the audio and can be zoomed down to frame by frame as I recall...... You may see some Flat lines indicating the missing data, or some other clue that you can look out for next time.

    I still don't understand why actually setting the Frame Rate at 25fps would cause the out of sync, since the video is not the problem, so was my 1st guess right and when you set the 25fps, it was actually recoding the audio and adding some audio timecodes and data? My second guess of not actually being 25fps was not far off either since the audio was not 25fps. Like I said, Womble should have shown you that the audio was going to be recoded to match the vidoe fps. Please do take a look with the 2 programs I suggested and tell me what you find, I am very interested and would also like to know if they help in case I come across a similar situation.
    Quote Quote  
  14. I will try the programs you suggested as I've almost finished battling with the ones I normally use and still don't have all the answers. These MKVs have given me all sorts of problems aside from the frame rate though so I wasn't in a hurry to throw anything new into the mix. So far.... AnyVideoConverter won't convert them while they're MKVs but it will if I remux them as AVIs, which doesn't help much unless I know remuxing them as AVIs won't effect the audio sync, ffmsindex refuses to index them properly, if I do remux them as AVIs and use AVISource to open them with AVISynth it messes with the colours for reasons I can't fathom, they'll only open via DirectShow if I use ffdshow to manually set the aspect ratio, and some are interlaced or appear not to have been de-interlaced properly and AVISynth won't have anything to do with them unless I use ffdshow to de-interlace them first, the usual de-interlacers are producing some odd effects and while I found one which worked well it unfortunately caused small lines to appear down the side of the video, which I eventually fixed by also enabling ffdshow's cropping filter even though it's set not to crop anything.....

    I'm sure the audio is fine. I'm fairly sure the video has "missing" frames, or maybe frames which are intended to display for twice the amount of time, or maybe someone tried to de-interlace these and made a mess of some of them, I'm not sure, but specifying a 25fps frame rate seems to cause each frame to be 40ms apart (as they normally should be), which means in this case the frames which are 80ms apart because the one in between is missing are now closer together..... a few 40ms add up pretty quickly.

    I discovered if I open the MKV with VirtualDub and resave it as an AVI it automatically changes the frame rate, and it seems the first frame and the last frame line up exactly using the new frame rate, but the rest are sort of "evenly spaced" in between which can throw them out a bit.

    Using Directshow while encoding produced results I don't yet understand. Basically encoding via DirectShow produced and AVI with 61 extra frames, which I figured was a good thing, but at 25fps it was out of sync with the audio even though it appeared to have the same duration. When I resaved the encoded version at 24.960 (the frame rate VirtualDub used to save the MKV as an AVI in this case) it's duration increased to 2:011, yet even though that made it a couple of seconds longer than the audio stream it seems to sync with it that way. I'm still trying to work that one out....

    I think the only "real" solution might be to use AviSynth's ability to convert the frame rate.... treat the original as variable frame rate video.... so effectively AVISynth "samples" the video at a specified frame rate (25fps in this case) regardless of the original frame rate. Given these MKVs play at 25fps but just seem to have missing frames, it shouldn't cause any bad side effects.... I've just got to work out how to go about it given the problems I'm having opening these MKVs for converting.

    The only other solution..... I'm mainly re-encoding these MKVs to clean up the cropping, fix the aspect ratio, that sort of thing. As the quality isn't anything exciting I thought I'd just convert them to Xvid AVI and being stubborn once I hit a problem I need to know how to fix it, but if all else fails I guess I can just encode them "as-is". As long as each encode has the same number of frames as the original I could extract the video timecodes from the original MKVs and remux each encoded version as an MKV using the timecodes from the original. In fact the more I think about it, the more I'm wondering why I don't just do it that way....

    PS For the record, when you extract the video timecodes from an MKV you get a text file with a bunch of numbers, each corresponding to a video frame. For constant frame rate video they should increase by the same amount, and in the case of 25fps they'll simply start at zero and increase in increments of 40 (40ms per frame) which is why I initially thought the video looked like it was 25fps, all the software agreed it was 25fps, yet remuxed at 25 fps it seemed to play at the wrong speed, so I thought maybe there was another factor involved in playback speed I wasn't aware of. It wasn't until I looked closer later on that I discovered every so often the incriments increased by 80, hence my "missing frame", or "80ms frame" theory. But of course when re-encoding, the encoder just encodes each frame and each is given a 40ms duration.....
    The audio timecodes can be extracted from an MKV as a text file in the same way, but I really don't understand how to interpret them yet.

    PPS When it comes to AnyVideoConverter's audio sync abilities, I'm sure it actually leaves the audio "as-is" but repeats or drops video frames while encoding to keep the video in sync with the audio. I've used AnyVideoConverter to convert variable bitrate video to constant bitrate, or to convert two videos of different bitrates while merging them together using a single bitrate, and I'm fairly certain it does it by repeating frames occasionally if need be. What I don't know, is how it physically does it....
    Last edited by hello_hello; 23rd Jul 2012 at 11:02.
    Quote Quote  
  15. OK, I just read all of that. Got a little bit lost in the middle (it is nearly midnight and I've been sitting in front of 3 screens for about 8 hours) but was with you again at the end.

    From your first description it sounded like you had 2 sets of timecodes, and the audio was the one with the 80ms gaps. Don't have energy to go back and re-read, but will now take your last description to mean I was mistaken and the timecodes with the variable gaps is for the video. I fully understand the issue.

    Yes, sounds like perhaps bad de-interlacing.

    You still haven't told me what original codecs we are talking about here for audio and video.....

    If it was me right now? I'd probably use SolveiggMM or Womble Video Wizard to do the trimming and check which give best audio sync on output, then put it through handbrake to fix AR and do cropping, converting to h.264 keeping the original audio if possible.
    I'd probably also give AVS Video Converter a chance to do it all in one.
    Quote Quote  
  16. Sorry about the huge post. I think it was partly therapy... and I was thinking of ideas and trying things as I typed. Anyway....

    I've finally been successful at creating a 25fps encode with the audio in sync. It's probably due to the way I'm going about it.... creating an AVIsynth script and wrapping it into an AVI which I then edit with VirtualDub and save for AutoGK to convert, but I've had to fight what seems like a few oddities.

    I'm going to try another method for converting my AVIsynth script to an AVI to see if the minor problems remaining go away (for instance so far every 25fps encode with the audio in sync has had a single random frame from the middle of the video added to the beginning which I've had to remove). Rather than use avs2avi I'll try using AVFS and/or VFAPI Reader as I think avstoavi really only works successfully with the most basic of scripts. I've spent so much time on this.... trying to find a way to get AutoGK to convert these MKVs.... now I've basically got it working I just want to see if I can iron out the "bugs".
    I am however, downloading AVS Video Converter as I type, and I'll download SolveiggMM a little later and report back with the results once I try them.

    To finally produce a 25fps encode with the audio in sync....
    Well I tried adding ConvertFPS(25) to the AVISynth script I was using to open the video, and also ChangeFPS(25), but in both cases I ended up with a 25fps encode which was out of sync. Then I remembered another way to do it when decoding via DirectShow (which I was using anyway) and creating a little script like this to open the video finally worked a treat.

    DirectShowSource("E:\video.mkv", audio=false, fps=25, convertfps=true)

    In all three cases I ended up with an encode with the same number of frames (more than the original), all appeared to be the same length, but only the last method produced an AVI with the audio finally in sync from start to finish.

    Forgot to answer your question.... these MKVs contain DivX4 video and ogg audio. They're fairly odd.... the video is 516x570 with a 4:3 display aspect ratio. It's just that they're caps of an old TV show and I don't think I'll find a better quality version anywhere, otherwise I wouldn't be bothering with all of this....
    Quote Quote  
  17. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by hello_hello View Post
    so far every 25fps encode with the audio in sync has had a single random frame from the middle of the video added to the beginning which I've had to remove

    This happens frequently, when you are doing a 2-pass encode especially, you get the final frame duplicated at the first.

    Anyway, I just add
    Code:
    Trim(1,0).FadeIn(2)
    The Trim chops off the first frame and the FadeIn adds one (black, but you can choose white or any colour if you want).
    So the framecount remains the same.
    Also, having any Trim, even Trim(0,0), which leaves the video unchanged, cuts off any audio that goes after the end -- often when using AviSource for some reason the audio continues for sometimes several minutes (silently) after the video has ended. Was very annoying till I worked it out.

    Or
    Code:
    FreezeFrame(0,1,1)
    will dupe the second frame over the first.
    Last edited by AlanHK; 24th Jul 2012 at 06:37.
    Quote Quote  
  18. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by hello_hello View Post
    DirectShowSource("E:\video.mkv", audio=false, fps=25, convertfps=true)
    Some alternatives:
    First get ffmpegsource2 if you haven't already.


    If the source video is very close to 25 fps :
    Code:
    FFmpegSource2("E:\video.mkv",atrack=-1,fpsnum=25,fpsden=1)
    But if it's a bit off, say 24 fps, I do:
    Code:
    FFmpegSource2("E:\video.mkv",atrack=-1,fpsnum=-1,fpsden=1)
    AssumeFPS(25, sync_audio=true)
    SSRC(48000, fast=false)
    This just speeds up (or slows) the video to 25 fps, keeping the audio in sync, and resamplng to standard 48000Hz (the resampling is necessary for making MPEG, otherwise you could skip it).
    Last edited by AlanHK; 24th Jul 2012 at 06:36.
    Quote Quote  
  19. Don't Forget to try Womble Video Wizard too.

    AVS Video Converter might have problems with the Ogg audio. I had a fix from them for VP8 and Ogg but not sure if it's made a general release yet.

    What's the old TV series? I might be interested or even have it

    Seems we've turned my thread on fixing tools into your problem thread LOL
    Quote Quote  
  20. Originally Posted by AlanHK View Post
    This happens frequently, when you are doing a 2-pass encode especially, you get the final frame duplicated at the first.

    Anyway, I just add
    Code:
    Trim(1,0).FadeIn(2)
    The Trim chops off the first frame and the FadeIn adds one (black, but you can choose white or any colour if you want).
    First, thanks for the info.
    I did try Trim(1.0) to remove the first frame (which actually seems to be coming from somewhere in the middle of the video) but still got the same random frame in place of the first frame. I even tried Trim(1000,0) just to ensure I wasn't going mad, but still got the same result. I didn't try using FadeIn or FreezeFrame though, so if I go back to DirectShow I will try them.

    Originally Posted by AlanHK View Post
    Some alternatives:
    First get ffmpegsource2 if you haven't already.

    If the source video is very close to 25 fps :
    Code:
    FFmpegSource2("E:\video.mkv",atrack=-1,fpsnum=25,fpsden=1)
    But if it's a bit off, say 24 fps, I do:
    Code:
    FFmpegSource2("E:\video.mkv",atrack=-1,fpsnum=-1,fpsden=1)
    AssumeFPS(25, sync_audio=true)
    SSRC(48000, fast=false)
    This just speeds up (or slows) the video to 25 fps, keeping the audio in sync, and resamplng to standard 48000Hz (the resampling is necessary for making MPEG, otherwise you could skip it).
    My knowledge of creating AVIsynth scripts and using ffms2 are fairly limited. Just reading the ffms2 user guide to understand what you'd written and how to get it to work increased my knowledge tenfold. Generally I just use FFVideoSource(E:\video.mkv") as my entire script, wrap it into an AVI, to which I add the existing audio, then give the AVI to AutoGK to convert. So given that's what I'm trying to do here (use the original audio) and after reading through the user guide, I ended up with this script which seems to do the trick, until I tried it on one of these MKVs.....

    FFVideoSource("E:\video.mkv", fpsnum=25, fpsden=1)


    Well &^*% me!! This requires an appropriate amount of swearing...... the amount of time I've wasted because of ffms2.....
    I remember why I'd not used ffms2 in the first place. I tried it and couldn't get it to open these MKVs. But thinking I might be able to work out why.... hours of remuxing and indexing and testing later I remembered I've got two versions of ffms2 on this PC, because the latest beta version won't index AVIs with an audio delay, so I've just been using version 2.17. I switched to the latest beta and my MKVs opened without a problem. ^&%^$#!!!

    One little oddity..... I can open the ffms2 script using VirtualDub or MeGUI and it displays correctly (forgetting the aspect ratio is wrong). However when I open it with VirtualDubMod or MPC-HC I get an odd black and white type video with patches of color "overlayed" on top. I've had this happen before on the odd ocassion but never known why. Adding mod8 resizing to the script fixes it, but I'm curious why the video won't display correctly without resizing when using MPC-HC.

    Anyway, I'm off to run a test encode now. Hopefully now I know how to use ffms2 to convert the frame rate. Thanks for the info.
    Quote Quote  
  21. Originally Posted by CyborgX333 View Post
    Don't Forget to try Womble Video Wizard too.

    AVS Video Converter might have problems with the Ogg audio. I had a fix from them for VP8 and Ogg but not sure if it's made a general release yet.

    What's the old TV series? I might be interested or even have it

    Seems we've turned my thread on fixing tools into your problem thread LOL
    Yeah, sorry.... I do seem to have taken over your thread a little. What was your problem again?

    I've not forgotten your programs, but I thought I'd try ffms2 again thinking it would be a simple exercise.....
    At least I've learned some more.... although the "amount learned"/"time spent ratio" can be somewhat less than ideal when experimenting yourself, but now hopefully my method for using AutoGK to encode will work.

    It probably won't matter if any of those programs don't like ogg audio.... it's easy enough to convert it to MP3 first, which is what I'm doing anyway...
    It'll probably be tomorrow before I try those programs, but even if I don't use them for encoding this time I will try them on some of these MKVs to see what happens, and I'm always keen to try new things anyway.... but probably not till tomorrow now. I haven't even managed to watch this week's episode of Breaking Bad yet, and that's just silly.
    The MKVs I'm trying to convert.... old TV caps of early Doctor Who episodes (the original series).
    Last edited by hello_hello; 24th Jul 2012 at 12:31.
    Quote Quote  
  22. No worries about the thread, your help was much appreciated. No hurry for answers on the software, but I'm curious how they do.....

    I used to luv Dr Who when I was younger, (Pertwee and Baker probably being my favs.). The newer series were intersting too, but IMHO some of the stories got a bit crappie, and they started to rely too much on special effects. Same with Torchwood. Started out well, but after building up the characters nicely with some good stories, they killed them all off, turned the lead character into a slut, and it went to Sh*t. LOL
    Quote Quote  
  23. Just a quick update on my tools testing.

    HDConverttoX looks promising, but doesn't come with all its required components. To expect a user to have to go off in search of REQUIRED components for an application is just very amateur, but I'll probably give it another chance.
    MEGui just seemed too tied into scripting, not my kind of tool, too slow and fiddly.
    VirtualDubMod hung on the first 2 files at the parsing stage, the third failed missing code. Need I say nore?
    AVIdemux could not open first mkv, nor first AVI, didn't waste any more time.
    FFCoder hung during installation. When running, was ridiculously slow analyzing files (which it insisted on doing when opening. Too slow and unstable.
    MKVToolnix was just 2 tools neither with enough functionality to be useful to me. e.g. it spotted 21 chapters, but you didn't seem to be able to do anything with them. No trimming tool, etc....

    These tools make me feel like I'm going back 7 or 8 years and having to use the very flakey programs that were around at the time. They are obviously for people that like messing around with parameters (that probably at least 70% have no clue about what they are adjusting) trying to improve their movie rips.
    There are now reasonably priced professional tools out there that IMHO do 95% of what these homemade tools can do, but with much more ease and speed.

    SolveiggMM has gone up in my estimation. It appears to be able to handle splitting a lot of file types and codecs well.
    Womble Video Wizard. Still useful for DVD, ISO and some other splitting and recoding, but today found that it couldn't split an h.264 AVI, and insisted on recoding. The problem is that the recode had messed up the AR. IT does however still have the nice audio adjustment feature, and I'll keep if in my toolbox.
    Quote Quote  
  24. I still haven't got around to giving your programs a spin. I've downloaded them but haven't had as much spare time the last few days so I've actually been converting some of these when I've had the chance (now that adding frame rate conversion to the process has done the trick). Hopefully tomorrow....

    When it comes to file splitting..... video has to be split on keyframes which could be a reasonable distance apart, so there's no gurantee one will be placed exactly where you want to split. A program capable of simple splitting such as MKVMergeGUI will just split on the keyframe following the time you specified for the split.
    Other than that, something has to be re-encoded if you don't split on keyframes. A clever program might do "smart splitting" and just re-encode the section around the split point if it's not on a keyframe. Other programs might force you to re-encode everything.

    VirtualDubMod/VirtualDub. I use them for splitting AVIs a lot. Neither will seek accurately though if the AVI contains h264 video. VirtualDubMod isn't updated any more so won't open newer versions of MKV. VirtualDub has plugins which allow it to open quite a few file types but once again h264 seeking is nowhere near frame accurate and it'll probably only save the output as AVI.

    I use MKVToolNix pretty much daily. It's just a muxing program which will also split files but that's all it's designed to do. I often use it to adjust delays, add subtitles, set default tracks, replace/add streams in MKVs etc. I'd be lost without it.

    If ffcoder is slow to analyze a file don't be too quick to think that's not a good thing... it's probably doing the job properly.... working out if it's fully or partially interlaced, NTSC or film etc. MeGUI can be slow to analyze files too, as is AutoGK, although neither of them do it immediately when you open a file.
    Quote Quote  
  25. I agree with your comments on proper analysis, but I just don't have the time to sit around waiting for ffcoder to go through every file with a fine tooth comb. As an option yes, it would be nice, but not compulsory for every file.

    I bought SolveigMM yesterday. It does one thing (splitting) well. They have a nice graphic webpage on K-Frame splitting, but it's not exactly clear what it is capapbe of, since it has a few optional settings like "Frame Accuracy (Smart Mode)", Ignore Trimming Errors", "Obey Sample times" (for fixing sync problems), and a couple of K-Frame options.

    For me the container is not important, I use MP4 just for wider playability. It's the compression algorithms and their settings that I need to spend more time understanding better. I've tried some of the latest, and one of the best I've seen is VP8/80 used by Google (very similar to H.264). I've posted an example on TCB here http://www.thecentralbox.com/rips/137717-leann-rimes-probably-wouldnt-way.html. It's not my work, just an example of why I loathe people obsesssed with V0Bs..... (a real problem in the Music Video community....).

    You might need to register to see it. Take a look.
    Quote Quote  
  26. Yeah, analyzing the video the second you open it would drive me nuts pretty quickly unless it's fairly fast. I was actually playing with ffcoder the other day (testing it with my problem MKVs) and it opened them pretty quickly. It probably depends on the file type and frame rate as to how thoroughly it needs to analyze the video.

    I don't know anything about VP8 although the screen shots you linked to seem good for the file size.

    I don't use ffcoder much and I'm not a fan of Handbrake but both convert my "problem" MKVs without audio sync issues. I think I understand why but I'm still investigating. Neither were using AviSynth as MeGUI/AutoGK does though.
    I'm pretty sure my problem is duplicate frames and having them included when encoding. So far I seem to have discovered if I remux the MKVs as AVIs and use AviSource to open them with AviSynth, it'll handles the duplicate frames properly. I'm starting to think not handling them correctly when indexing files using ffms2 is actually a shortcoming of ffms2 itself. I'll probably ask about it in the ffms2 thread at doom9 later, but for the moment adding frame rate conversion to the AviSynth script is doing the trick.
    Quote Quote  
  27. did you ever get around to trying the tools I suggested? I'd appreciate your opinion....
    Quote Quote  
  28. I've only tried AVSVideoConverter so far. I was actually thinking today I should get around to trying SolveigMM Video Splitter as well and report back. Was there another program you also suggested to try? I had it in my head there was but looking through the thread again I can't see it.

    I've been a bit slow because I've been working my way through converting these files as I've had a chance. I've got around 150 of them to do and I think I'm about half way through them. I've got to set up each encode and check the cropping individually, plus I'm editing the crud from the start and the end and converting the audio manually, so they're taking a bit of time. Anyway.....

    I'll admit AVSVideoConverter didn't do much for me. Aside from it not being free, if I was to use a program like AVSVideoConverter I'd probably go for AnyVideoConverter or FormatFactory first, as they're very similar, but free. Only thing is for some reason AnyVideoConverter didn't like these particular files. I never got around to installing FormatFactory to try.... I should add it to the list.

    I couldn't get my head around how the cropping works and the first encode I tried was using the "MPEG4 DivX/Xvid compatible encoder" which I gave up on after a few minutes because it said it was going to take over 2 hours to encode a 25 minute video, so then I switched to Xvid and it encoded it in about 15 minutes. I'll give AVSVideoConverter credit for one thing, it didn't mind the ogg audio and it kept the audio in sync. Only thing is, every so often the encodes had frames out of order.... ie the second last frame from one scene would be followed by the first frame from the next scene, then the last frame from the previous scene.....

    Now admittedly these particular MKVs have been a headache from the start, so I can't say AVS is bad because it didn't encode them well. I did try opening an AviSynth script with AVSVideoConverter, but it doesn't know what they are. AnyVideoConverter will happily open them and use them as the source video when converting.

    So that's my rundown there at least. Considering it's not a free program, I think as a general rule something like FormatFactory or AnyVideoConverter would be better choices because they'd work just as well and they're free. I'll try getting to SolveigMM Video Splitter in the next day or so.
    Quote Quote  
  29. I was in the middle of a longish reply to you when the power went! I have my main PC, NAS and hub on a UPS, but the power supply on this PC takes down the UPS when the power goes for some reason (its not the load being too high). Anyway, before I start to bore you with my UPS supplier battle, I'll get this done before the power goes again!

    AVSVideoConverter gives long estimates sometimes when the file is weird in some way (I've had a few like yours too which cause crashes etc.). If it estimates that long, it more than likely is not gonna turn out well. Yes the cropping is a bit weird because it's incorporated into the AR and has some black bar intelligence. I usually set the resolution first then do the AR, and finally cropping. Because the cropping does all sides at the same time, I use the resolution to reduce in one direction, and then the cropping slider. It also has a SLIDE and ZOOM function in the editor, but the the zoom is not fine enough to be useful. With a combination of all these I can usually reduce the black edges to barely noticeable. My main aim in the cropping is to get rid of most black bars, but as long as the actual image is as large as it can get (when viewed on a 16:9 screen) the screen will supplement any remaining black bar with more black. i.e. as long as there are only 2 black bars on a 16:9 screen I can accept that.
    It does allow totally Custom resolution sizes and Aspect Ratios which is something I have not found everywhere.
    It also has quite a lot of Video and Audio editing tools. Not that I use many, but the Amplify, Normalize and Compressor can be useful. Especially the Amplifier which I have used frequently to adjust the volume to a standard level. The facility to add many Amplifier adjustments to a single file has allowed me to fix various audio problems in quite a few videos. It has a nice fader too which I should use more than I do (just one more step that takes up time...).
    The Video editing tools are quite powerful too, and you can repair bad colouring, brightness etc easily (although I don't recommend using the automatic ones).
    I can dither out logos quite nicely with it too.
    For me it's the best all-in-one tool that suits what I do. It handles single songs well, just about any format, and best of all, when I'm splitting concerts and TV Programs, I can see the whole file/job on a timeline, with all the splits as well as any adjustments to audio and video too. I can play any section of it and see/hear the results of my adjustments immediately. It also allows zooming in and using a slider for very fine editing.
    I've been using it for many many years now, and it has grown from a very unstable buggy product to a 95% stable very popwerful all-in-one tool.
    Things I hate about it - The cropping tool, no audio sync adjustment, weird defaults in the editing tools, idiots on the first level support team LOL

    I did see FormatFactory, but didn't even evaluate because it just looks too out of date and not enough functionality.
    As I said, I did evaluate AnyVideoConverter, and liked the Audio sync option (but I never did get a decent explanation of what it actually does from them). One of my issues with it was that the DVD ripper was very difficult to rip down to chapters (which is usually the breaks for Music Videos). There were other issues too, but I can't recall them now. I might give it another look, but the other program I bought basically does the same but handles the DVD chapter issue better, and is quite powerful and flexible (but flakey and unstable too).

    The name of this second program is Womble MPEGVideoWizardDVD. They do have a reduced function splitter version MPEGVCR. The reduced function version used to be free and they keep it going because it was so popular.

    This is my current working practice. It's quite new so needs some tweaking, but I'm very happy with the results so far.
    Splitting DVD's I use MPEGVideoWizardDVD to split and trim in native format (can also do volume adjustment at this stage but not well implemented).
    Splitting Single files I plan to use SolveigMM as the primary tool to to split and trim in native format (at least for now).

    If I have to do cropping I do it with Handbrake and output in H.264. AR adjustments can be done here too. I also use it to convert any 5.1 audio down to Stereo which IMHO will be better for use in a nightclub/bar environment, to give a more consistent sound for customers.

    I could continue to use AVS and do it all in one, but it still has the green tinge bug that means I have to manually check and adjust brightness, contrast and colours for every encode, and can become laborious hard work.....

    Tell me how you get on with SolveigMM and MPEGVideoWizardDVD

    BTW I've never seen the weird frame shuffling you were talking about with AVS.
    Quote Quote  
  30. I'll get back to the experimenting with programs but I won't get a chance today. However as I read your post....

    I'm fairly sure the "shuffling frame" problem is just something unique to these "problem' MKVs. At least AVS would convert them. AnyVideoConverter just refused to.

    Not being exactly sure how you split/encode DVDs, have you tried splitting them with DVD Shrink? If you use it's reauthor function you can split them that way. Normally you'd drag a title from the right pane to the left pane after opening a DVD, a title usually being an episode or a full movie, but once you've dragged a title across you can edit it down by chapter. So if a single title contained 12 chapters you wanted to encode individually, you'd drag the title from the right pane to the left pane twelve times, then edit each copy of the title so the first starts at chapter one and ends at chapter 2, the second starts at chapter 2 and ends at chapter 3.... etc. It's easy as DVD Shrink letrs you pick a chapter number as the start and end point. Once you're done you'd get DVD Shrink to backup the re-authored DVD to your hard drive, setting the target output size large enough so DVD Shrink doesn't try to re-encode (shrink) the video, and each chapter will be it's own self contained set of vts/vob files which you can open and encode individually. If you're running something like AnyDVD in the background you can open the disc with DVD Shrink directly, re-author it and rip it to your hard drive all in one step.

    I don't know if that's any easier than using MPEGVideoWizardDVD to split a DVD, but if I had to split one (and I pretty much only split DVDs into individual episodes) that's how I'd do it.... if it's any help.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!