VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Okay, so here's the situation:

    Every so often, I have a lot of videos that I need to scan for a certain image appearing in the top-left corner of the video. To do this, I use the Save Image Sequence option, combined with a filter and frame decimation, to save a whole batch of images of that area so I can see which videos have the image appear and where. On its own, this works very well.

    However, I thought that it'd save me a lot of hassle if, rather than manually saving every image sequence when the previous one ends, I could queue up all the videos and have it batch process them.

    I was able to queue up said process fairly easily and it always starts off working fine. However, after a certain number of frames, the process suddenly grinds to a halt and then starts moving at a snails pace. For example, for one file, saves the sequence at a rate of over 20 fps until it reaches around frame 720, whereupon it starts processing around 1 frame every ten seconds, occasionally going faster for two or three frames before returning to a crawl.

    The place where the slowdown starts always seems to be the same for a certain file with certain filter settings, but otherwise seems completely random. For example, the aforementioned video starts slowing down at around frame 720 if I'm decimating the framerate by 120. However, if I decimate it by 100 instead, it starts around frame 30. And, for another video, it doesn't start until around frame 1000. Another video starts slowing down around frame 20.

    I've tried everything I can think of to alter this - different picture formats, playing around with the options, preferences and performance, rearranging the queue - but all I can ever manage to do is change the point where the slowdown happens, never eliminate it.

    Also, I would like to re-emphasize that this only happens with batch processing. If I simply go to Export -> Save Image Sequence, it usually does it without a problem. However, the exact same process happening from job control somehow causes this slowdown to happen.

    I apologize if any part of this is unclear, but I'm kind of at my wit's end trying to figure out what's going wrong. If anyone can give any advice, I'd really appreciate it.
    Quote Quote  
  2. what version of vdub ? Did you try vdub2 ?



    what is the "image appearing in the top-left corner of the video" ? Is it something like a logo ?

    what filters (crop to the region of interest) ? , and what is the reason for decimating (isn't there a chance you would miss the image) ?



    Depending on what the operations are, it might be faster / easier to to with a batch script in something like ffmpeg

    Or another way might be to use a detection script in avisynth if the "image" is consistent
    Quote Quote  
  3. Virtualdub 1.10.4. and I haven't tried vdub2. If you think either that or a newer version will help, I'll try that.

    The image (actually in the top right, sorry, got mixed up) is an error message on my PS3. It's mostly translucent, but has one part that's a solid image - I use images of that part combined with a duplicate photo detector to find error messages.

    The only filter is a Null Transform filter to crop down to just the error message and the decimation is because the message stays on screen for about 4 seconds, thus I only need to export 1 in every 120 frames to detect it.

    I could look into ffmpeg or avisynth but, to be honest, virtual dub works pretty well (at least when creating images manually), so I'd prefer to keep using it if there's a way around this problem.
    Quote Quote  
  4. I think trying vdub2 worth a shot. vdub2 branch has an active developer, so if it had the same problem, there is a chance it could be fixed

    Were your source videos otherwise the same in terms of characteristics in terms of dimensions, codecs used, settings (I'm assuming some PS3 cap ? ) . I'm just wondering why the slowdown affects different videos slightly differently at different points in time


    What I was suggesting with ffmpeg was batch processing . I think vdub requires you to load each video then queue it up. If you had, say 1000 videos, that would be pretty tedious . With ffmpeg, you could say, process every video in a folder. Basically double click a bat file.

    What I was suggesting with avisynth is similar to the duplicate photo detector. Basically run a script and it will print out the frame numbers in a text file that match according to some adjustable threshold value. It wouldn't be necessary to export physical image files .
    Quote Quote  
  5. Nope, all the same dimensions, codecs, settings. I can't see any reason why they're different, but oh well

    I'll look up ffmpeg and avisynth, though if you can point me to any tutorials that would work for this, I'd appreciate it.
    Quote Quote  
  6. when you decimate, the frame number in the image sequence is going to change from the actual video frame number...or do you care? are you looking only for presence of (yes/no) , not where in time it occurs ? I guess you could work backwards...

    also - what are you doing about when the image is present ? so you identify it's there... now what ?




    There's a bit of a learning curve and customizing the settings for your particular case (e.g. crop values will have to be modifed for your area of interest)

    ffmpeg it potentially easier - you would chain together a select filter filter (eg. select every "x" frame, or whatever interval) and crop filter (to region of interest), just like you've been doing in vdub. It's important to set the output rate with this method. e.g. If input frame rate was 30.0 fps and you wanted 1 every 120frames, it would be 30.0/120 = 0.25

    https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect
    https://ffmpeg.org/ffmpeg-filters.html#crop

    So an batch processing all the "AVI" files in a directory, would look something like this. In this example I assumed it was 1920x1080 30.0FPS, and you cropped to retain the top 160x90 top right section . The output png image sequence will start with filename_000000.png (6 place holder digits) , and "filename" will take on the input filename whatever that was. You can specify different input/output drives it will process faster. If you have enough resources, you can do several batches simultaneously

    Code:
    for %%a in ("*.avi") do ffmpeg -i "%%a" -vf select='not(mod(n\,120))',crop=w=160:h=90:x=1760:y=0 -r 0.25 -c:v png -an "%%~na%%06d.png"
    pause


    avisynth is more difficult to learn at first, but you would use WriteFileIF using the runtime function LumaDifference between the current clip and your image reference . You would also crop to the region of interest , and select (e.g. every 120th frame or whatever interval) beforehand to speed things up. Another issue is you would need to generate script per file (there are avs batch scripters), but a benefit is no physical image files would need to be written. The output would be a text file of names

    http://avisynth.nl/index.php/Select
    http://avisynth.nl/index.php/Crop
    http://avisynth.nl/index.php/WriteFile
    http://avisynth.nl/index.php/LumaDifference#Runtime_functions
    Quote Quote  
  7. Well, once I've got all the images in one folder, I use a dupilicate image finder to find all the images with the error message in. Once I've found them, I can calculate the time they occur within each video, check that time and I'll know if I need to rerecord any footage or if I can cut around it.

    Seems like FFmpeg would be the best tool to use then. I'll be honest, as someone not that familiar with coding, it's a little intimidating, but I'm sure I'll be able to figure something out.

    Really appreciate the help. Thank you.
    Quote Quote  
  8. Are you using ffmpeginputplugin? I saw something similar in this ticket: https://sourceforge.net/p/virtualdubffmpeginputplugin/tickets/19/
    With vdub2 you don't (normally) need ffmpeginputplugin, so maybe the issue will go away.
    Quote Quote  
  9. Huh, tried vdub2 and it works fine.

    Appreciate the advice, works great, thanks.
    Quote Quote  



Similar Threads

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