VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. Member
    Join Date
    Mar 2019
    Location
    Henderson, KY, USA
    Search PM
    i'm trying to encode one of my tape transfers via an avisynth script through ffmpeg. for some reason the process is stopping randomly in the middle of the encode with no error message. i loaded the script up in virtualdub and tried an encode, but i get this error after a while:
    Click image for larger version

Name:	DAHb7zc.png
Views:	66
Size:	8.1 KB
ID:	86126

    is there a fix? my source files are ffv1+flac. i'm running 64-bit avisynth+ 3.7.3 r4003

    my script:
    Code:
    setmemorymax(65536)
    v = lwlibavvideosource("g:\virtualdub\tape transfers\heat vs boston games 3 and 4 2012.mkv", fpsnum=30000,fpsden=1001)
    a = lwlibavaudiosource("g:\recordings\heat vs boston games 3 and 4 2012.flac")
    audiodub(v,a)
    delayaudio(-.300)
    assumetff().converttoyuv422(matrix="rec601", interlaced=true).convertbits(10)
    Levels(95, 1,965, 0, 1020, coring=false,dither=true).tweak(bright=0, cont=1.00, hue=-0, sat=1.00, coring=false, dither=true).convertbits(8)
    #turnRight().Histogram().TurnLeft()
    Trim(263, 567113)
    separatefields()
    LSFplus(ss_x=1.5, ss_y=1.5, secure=false, Spwr=2, SdmpHi=0, soothe=false, keep=25)
    FineDehalo(rx=2.5, ry=1.0)
    neo_dfttest(sigma=105, tbsize=5)
    weave()
    f3kdb(dynamic_grain=true)
    converttoyv12(matrix="rec601", interlaced=true)
    prefetch(8)
    ffmpeg commands i've tried:
    Code:
    ffmpeg -hwaccel auto -i "script.avs" -vf setfield=tff -c:v libx264 -x264opts tff=1 -x264-params opencl=true -crf 18 -b:v 0K -preset slow -aspect 652:480 -c:a libopus -b:a 192k -vbr on -compression_level 10 -frame_duration 60 -sample_fmt s16 -y  "output.mkv"
    Code:
    ffmpeg -i "script.avs" -c:v utvideo -c:a copy "output.avi"
    i also tried a fast recompress to magicyuv in virtualdub, and i got the access violation error mentioned above.
    Quote Quote  
  2. Maybe errors in the video or audiostream?

    You could scan both streams with ffmpeg:

    Code:
    FFmpeg.exe -i "inputfile" -f null -
    Quote Quote  
  3. Member
    Join Date
    Mar 2019
    Location
    Henderson, KY, USA
    Search PM
    Originally Posted by ProWo View Post
    Maybe errors in the video or audiostream?

    You could scan both streams with ffmpeg:

    Code:
    FFmpeg.exe -i "inputfile" -f null -
    no errors. my issue is happening at random. it could stop an hour in, 20 minutes in, 4 hours in, 2 hours in, etc. not sure why
    Quote Quote  
  4. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by ENunn View Post
    Originally Posted by ProWo View Post
    Maybe errors in the video or audiostream?

    You could scan both streams with ffmpeg:

    Code:
    FFmpeg.exe -i "inputfile" -f null -
    no errors. my issue is happening at random. it could stop an hour in, 20 minutes in, 4 hours in, 2 hours in, etc. not sure why
    Perhaps some anomaly during multi thread.
    Try lowering the Prefetch() to 2 and/or comment it out altogether
    Quote Quote  
  5. Member
    Join Date
    Mar 2019
    Location
    Henderson, KY, USA
    Search PM
    Originally Posted by davexnet View Post
    Perhaps some anomaly during multi thread.
    Try lowering the Prefetch() to 2 and/or comment it out altogether
    trying that now. unfortunately that's probably gonna be a temporary solution, since my encoding speed is a lot slower now.

    before that, i rebooted my pc and had another go at it, and i finally got an error message in ffmpeg.

    Code:
    [avisynth @ 000001ee95f73d40] LWLibavVideoSource: failed to make a frame
    [in#0/avisynth @ 000001ee95f73ac0] Error during demuxing: Unknown error occurred
    my lsmashworks is already up to date.
    Last edited by ENunn; 16th Mar 2025 at 14:33.
    Quote Quote  
  6. Try to remux the mkv.
    Quote Quote  
  7. Member
    Join Date
    Mar 2019
    Location
    Henderson, KY, USA
    Search PM
    Originally Posted by davexnet View Post
    Perhaps some anomaly during multi thread.
    Try lowering the Prefetch() to 2 and/or comment it out altogether
    didn't fix it.

    Originally Posted by ProWo View Post
    Try to remux the mkv.
    didn't help either.

    i tried loading it with ffmpegsource2 and that didn't fix it either. i'm not sure what's causing it.
    Quote Quote  
  8. Random stops when using Prefetch are pretty common. There are two things to try. First, try adding a SetMemoryMax(1024) command as the first statement. You can play around with how much memory to allocate.

    The other thing is to change the Prefetch number. I always test my script before letting it run. Since I usual VirtualDub to run the scripts, I start a "Video Analysis Pass" and let it crank for 10-20 seconds. While this runs, I note the fps. Very often this will start out at one speed and either speed up or slow down. Note the reading after it has settled down. Then, repeat the test for a smaller Prefetch. You will find that the differences in fps are not at all linear, e.g., Prefecth(3) does NOT produce half the fps as Prefetch(6). In fact, sometimes it will get faster. Your goal is to find the sweet spot. The optimal point is also usually much more stable and should avoid your crashes.
    Quote Quote  
  9. Member
    Join Date
    Mar 2019
    Location
    Henderson, KY, USA
    Search PM
    i tried changing the prefetch but it still didn't fix it. i transcoded to huffyuv and it seems to have worked. i don't know why, i've ran ffv1 files for ages and they all worked fine until now. not sure why.
    Quote Quote  



Similar Threads

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