Hello! Sorry if this is a really noob question. I spent forever searching this problem out but I don't think I'm able to articulate it properly or just something weird has happened to me.
I'm rendering some DV Typ-2 files to h.264. They're sourced from some old Video8 tapes over FireWire and a Digital8 camcorder.
I'm using the same workflow I use with my VHS imports. original>Avisynth>QTGMC>ffmpeg>render. I'm de-interlacing the file to 60fps and upscaling to 720 with some sharpening for use on streaming sites. Essentially following this guide here. My install is identical to his.
My problem is that the render is slowing down. It starts at 120+fps and gradually drops to less than 10fps as the render goes on. The renders complete and look great, but there's nothing different about the end of the file compared to the beginning that would warrant such a huge drop. I'm using Avisynth+ with multithreading and everything seems to be working great.... but then it just slows down. I've read that I need to set a memory limit sometimes, but those threads are all really old and I've seen just as many saying that's no big deal now?? I've also adjusted Edithreads and Prefetch and that doesn't make any difference in this case.
ffmpeg scriptSetFilterMTMode("QTGMC", 2)
I'm probably just doing something dumb here, Thanks in advance!ffmpeg -i "oldvideo.avs" -ss 00:00:02 -t 01:03:49 -c:v libx264 -preset medium -crf 19 -tune grain -profile:v high -level 4.2 -movflags +faststart -c:a aac -b:a 256k "oldvideo.mp4"
+ Reply to Thread
Results 1 to 11 of 11
I don't see anything obviously wrong with the script. Have you tried using AviSource() instead of FFmpegSource()? What kind of CPU usage are you seeing? Is memory usage increasing as the encoding progresses? How much? 32bit or 64bit?
CPU usage starts out at around 100% on all 12 cores. The render I'm doing now has dropped to 8 fps and is using 23%.
Memory usage under processes is only around 1.6 gigs, but I'm showing over 22 gigs being used with no other programs running to account for that so I'm assuming it's the render. I didn't check usage at the start but it's been stuck at 22 gigs for a while now. I should probably watch the memory usage from a fresh render.
I'm using 64 bit
I ran your script on an NTSC DV AVI clip on my old quad core i5 2500K. I specified 36 threads in the ffmpeg command line. I'm seeing ffmpeg run at about at about 20 fps, using about 1.5 GB of memory. After 10 minutes or so there's no change in speed, though memory usage has crept up to 1.6 GB. How long is it before you start seeing a slowdown?
By the way, the ConvertToYV12() in your script should be ConvertToYV12(interlaced=true).
That's been a very intermittent problem for quite a while. I don't think anybody has discovered the cause.
The good news is when your current encode has finished, the slowdown problem will probably go away for quite a while. Maybe even forever. It's a mystery.
As odd as it may seem, trimming the first 100 or so frames from the beginning of the script often prevents it happening. At least it sometimes did for me. I have no idea why as it makes no sense.
Encode the first 100 or so frames by adding Trim to the end of the script ie.Trim(0,99), and then edit it to encode the rest when the first part is done. Trim(100,0).
For x264, add --stitchable to the command line so you can append the two sections later.
Fortunately I haven't experienced a slowdown in a long time, but I recall a few encodes where I aborted the encoding job, split the encoded video on a key-frame near the end, added Trim() to the script to start encoding from that key-frame, wait for the slowdown, abort the encoding, rinse and repeat....
If it becomes an issue again I'll definitely try the Trim() option. The solution to a weird problem like this is always something just as weird haha.
https://forum.videohelp.com/threads/389089-Color-Ghosting Note how the green color of the wings is blended with the background (were the wings were in the other field).