Hello, I have been having an issue with FFMPEG hanging when encoding .avs files to mp4 or huffyuv. It will just stall on a random frame. This could be 8000 or 35,000. Each time I eventually get it to work with one setting, that setting never works the next time.
For instance, All of these settings worked only once, then failed when used again:
ffmpeg -i VW014.avs -c:a mp3 -qscale:a 0 -c:v libx264 -flags +ilme+ildct -preset slower -crf 18 -profile:v high422 -pix_fmt yuv422p -tune grain -vf setfield=bff -nostdin VW014Broadcast_Interlaced_FINAL.mp4
ffmpeg -i VW014.avs -c:a mp3 -qscale:a 0 -c:v libx264 -preset slower -crf 18 -profile:v high422 -pix_fmt yuv422p -tune grain -vf setfield=bff -nostdin VW014Broadcast_Interlaced_FINAL.mp4
ffmpeg -i VW014.avs -c:a mp3 -qscale:a 0 -c:v libx264 -preset slower -crf 18 -profile:v high422 -tune grain -nostdin VW014.mp4
This failed at frame 20295:
ffmpeg -i VW014.avs -c:a mp3 -qscale:a 0 -c:v libx264 -preset slower -crf 18 -profile:v high422 -pix_fmt yuv422p -tune grain -nostdin VW014_YT_Progressive.mp4
This worked once:
ffmpeg -i VW014.avs -c:a mp3 -qscale:a 0 -c:v libx264 -flags +ilme+ildct -preset slower -crf 18 -profile:v high422 -vf setfield=bff -nostdin VW014Broadcast_Interlaced_FINAL.mp4
Then the next time, failed at Frame 8999
ffmpeg -i VW015.avs -c:a mp3 -qscale:a 0 -c:v libx264 -flags +ilme+ildct -preset slower -crf 18 -profile:v high422 -vf setfield=bff -nostdin VW015Broadcast_Interlaced_FINAL.mp4
Here is example of full output that failed:
ffmpeg -i VW015.avs -c:a mp3 -qscale:a 0 -c:v libx264 -flags +ilme+ildct -preset slower -crf 18 -profile:v high422 -nostdin VW015Broadcast_Interlaced_FINAL.mp4
Input #0, avisynth, from 'VW015.avs':
Duration: 00:28:21.83, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: rawvideo (Y42B / 0x42323459), yuv422p(tv), 720x480, 29.97 fps, 29.97 tbr, 29.97 tbn
Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (pcm_s16le (native) -> mp3 (libmp3lame))
[libx264 @ 000002821c449300] interlace + weightp is not implemented
[libx264 @ 000002821c449300] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000002821c449300] profile High 4:2:2, level 3.1, 4:2:2, 8-bit
[libx264 @ 000002821c449300] 264 - core 164 r3172 c1c9931 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: cabac=1 ref=8 deblock=1:0:0 analyse=0x3:0x133 me=umh subme=9 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=15 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=tff bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=18.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'VW015Broadcast_Interlaced_FINAL.mp4':
Metadata:
encoder : Lavf60.16.100
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv422p(tv, progressive), 720x480, q=2-31, 29.97 fps, 30k tbn
Metadata:
encoder : Lavc60.31.102 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1: Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p
Metadata:
encoder : Lavc60.31.102 libmp3lame
frame=39635 fps= 11 q=24.0 size= 734720kB time=00:22:05.01 bitrate=4542.5kbits/s speed=0.366x
I used -nostdin because I read that may help when FFMPEG expects the buffers to be read. Fixed the issue once, but that's it. Thanks for any advice.
+ Reply to Thread
Results 1 to 14 of 14
-
-
Thanks, this is the most recent one having trouble, which is simple:
Code:Import("C:\Program Files (x86)\AviSynth+\plugins64+\ReplaceFramesMC2_AD.avsi") video = AVISource("D:\VW015.avi") last = video.ConvertToYV16(matrix="Rec601",interlaced=True) ReplaceFramesMC2_AD(last, 30486, 4) ReplaceFramesMC2_AD(last, 30491, 2) ReplaceFramesMC2_AD(last, 30499, 4) #at end ReplaceFramesMC2_AD(last, 49694, 7) ReplaceFramesMC2_AD(last, 49711, 9) ReplaceFramesMC2_AD(last, 49734, 7) ReplaceFramesMC2_AD(last, 49754,6) ReplaceFramesMC2_AD(last, 49773, 9) ReplaceFramesMC2_AD(last, 49790, 10) AssumeBFF().nnedi3(field=-2) #removes strip on left side no_stripe =last.DeStripe(2,1,80).Crop(0,0,30,0) last = Layer(last, no_stripe, op="add") #center image part 1 to save processing time (no need to apply filters to black areas) Crop(8,8,-8,-12) RemoveDirtSMC(55).RemoveDirtSMC(25) FFT3DFilter(sigma=2, bt=5) smoothuv2(radius=3,interlaced=0) AddBorders(8,8,8,12) AssumeBFF().SeparateFields().SelectEvery(4,0,3).Weave() AddGrainC(var=5) return last
-
This happend to me one time, inside the command prompt where you see theese things during the encoding "frame=39635 fps= 11 q=24.0 size= 734720kB time=00:22:05.01 bitrate=4542.5kbits/s speed=0.366x".. i pressed enter and the process continued and completed eventually! it didnt give any error message or such! if it just look like it have stopped/paused the proccess, it worked with pressing enter, allso you could try increase the process priority for the future or try clear up some more free ram memory by turning of some programs thats not needed during the encoding!
-
Thanks, from what I recall pressing Enter did nothing but I will run it again and see. Could it be from anything in my script?
-
Yeah give it an try, it worked for me atleast, to my surprise, and i still wasnt sure why it started stopping/pausing, only thing i recall was different from normal was a bit more used ram memory and allso the computer had been doing alot of stuff lately so probably the windows cache or something similar was more full then normal!
I have never used AviSynth, atleast not yet but with the Avanti GUI + FFMpeg Essentials v.6.0 gave some sort of message about the initialized FFMpeg beeing AviSynth compitable or something, so it had me a lil bit interested, to me it looked allright atleast but on the other side i dont really know what is good or bad either when it come to AviSynth!
Edit: Well now when i took an look at it again you see the "+" in the path name there, some programs dont really like the weird type of letters sometimes such as +, å, ä, ö and so on!Last edited by Swedaniel; 25th Jan 2024 at 19:58.
-
Do you have old version of AVSTP in plugins directory ? It can cause hanging on random frames. Upgrade if you do
https://github.com/pinterf/AVSTP/releases -
Thanks for all the tips!
Swedaniel--I tried running the script again and when it stalled I tried pressing Enter but nothing happened. The cursor would just continue to blink under the first character.
jagabo--I am running 64 bit Avisynth+ 3.7.2. I never use Prefetch because I just never spent time looking into it.
poisondeathray--Indeed, I did have an older version of AVSTP. I downloaded the new one and will re-run the script and let everyone know. -
I had the same thing when using ReplaceFramesRIFE -- I could safely use up to about 15 commands. Reduce yours and check if the problem still occurs.
Use VirtualDub -- it allowed more Replace commands than ffmpeg.
The fact that you also have other commands doesn't help the script -
Thanks, but it has happened with scripts even when I don't use ReplaceFrames. I would use VirtualDub but it does not have all the options of FFMPEG, like the unique interlace encoding ildct, which cuts the file size down in half, nor the tune grain feature, which lets more grain come through even with an h.264 encoding, giving the illusion of more detail.
Similar Threads
-
FFMPEG encoding for Adobe Encore CS6 video buffer underflows
By n0M3n in forum Authoring (Blu-ray)Replies: 9Last Post: 27th Sep 2022, 13:21 -
Avisynth Video & Audio Encoding and joining trimmed sections
By tugatomsk in forum EditingReplies: 2Last Post: 4th Apr 2022, 15:04 -
ffmpeg fade out beginning & end of video without re-encoding middle part ?
By DonSeenu in forum Video ConversionReplies: 4Last Post: 28th Sep 2021, 03:00 -
How to convert .m2ts video to .mkv video without re-encoding by ffmpeg ?
By aaajan in forum Video ConversionReplies: 13Last Post: 27th Aug 2021, 08:30 -
Avisynth to ffmpeg 32 bits, i7 6700K, measly encoding rate
By abolibibelot in forum Video ConversionReplies: 2Last Post: 31st Dec 2019, 19:23