Go Back    Forum > Digital Video > Video Project Help > Encode, Convert for streaming

Reply
 
LinkBack Thread Tools
  #1  
01-06-2024, 03:35 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 30 Times in 26 Posts
I am trying to encode a video from Avisynth to FFMPEG but the video hangs each time, whether I encode directly to mp4 or to HUFFYUV. I have tried increasing the buffer size but the video still hangs, at a random frame of the video each time. One time it was frame 150, next time it worked until frame 44,000.

To mp4:
Code:
ffmpeg -i input.avs -c:a mp3 -qscale:a 0 -c:v libx264 -preset slower -crf 18 -profile:v high -pix_fmt yuv420p -tune grain output.mp4
To huffyuv:
Code:
ffmpeg -i input.avs -acodec copy -c:v huffyuv -bufsize 500000k output.avi
In the past, if I managed to get it to the Huffyuv, converting it to mp4 proceeded without issue. I was also able to encode this script successfully using a similar script that did not upscale to HD, but most of my scripts no matter the functions used have this hanging issue with FFMPEG.

Here is my Avisynth script:

Code:
Import("C:\Program Files (x86)\AviSynth+\plugins64+\ReplaceFramesMC2_AD.avsi")
Import("C:\Program Files (x86)\AviSynth+\plugins64+\Deemphasize.avs")

video = AVISource("D:\VW011_before_avisynth_YT_progressive_version.avi")

last = video.ConvertToYV16(matrix="Rec709",interlaced=True)

AssumeBFF().nnedi3(field=-2)

ReplaceFramesMC2_AD(last, 13106,1)
ReplaceFramesMC2_AD(last, 13108,7)
ReplaceFramesMC2_AD(last, 13124,1)
ReplaceFramesMC2_AD(last, 13126,1)
ReplaceFramesMC2_AD(last, 13128,27)
ReplaceFramesMC2_AD(last, 26980,5)

#removes strip on left side
no_stripe =last.DeStripe(2,2,80).Crop(0,0,120,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,0,-4,-8)

#removes some dropout lines
RemoveDirtSMC(55).RemoveDirtSMC(25).RemoveDirtSMC(55)
FFT3DFilter(sigma=2, bt=5)
SpotLess(RadT=3, ThSAD=5000, Blksz=16)

smoothuv2(radius=3,interlaced=0)

AssumeBFF().SeparateFields().SelectEvery(4,0,3).Weave()


first = last.Trim(0,20472)
#avoids filtering first or ending, will add back at end
second = last.trim(20472,23678)
ending = last.trim(23678,0)

#further filtering of drop outs on dave street segement
second = second.AssumeBFF().nnedi3(field=-2)

second = second.SpotLess(RadT=3, ThSAD=4000, Blksz=16)

second = second.AssumeBFF().SeparateFields().SelectEvery(4,0,3).Weave()


#____________________
final = first ++ second ++ ending

final = final.AssumeBFF().nnedi3(field=-2)

#add back border cropped earlier
final = final.AddBorders(2,0,10,8)

final = final.AssumeBFF().SeparateFields().SelectEvery(4,0,3).Weave()


#deinterlace for YT, remove combing
final = final.QTGMC( Preset="fast", EZKeepGrain=1.0, NoisePreset="Faster", NoiseProcess=0)
final = final.VInverse2()

#upscale to 1080 then add grain
final = final.nnedi3_rpow2(4, cshift="Spline64Resize", fwidth=1440, fheight=1080)
final = final.AddgrainC(var=10)

#Adds Segue
blackVideo = BlankClip(clip=final,length=100)

Clip1 = final.Trim(0,22928)
Clip2 = final.Trim(22928, 0)

editVideo = Clip1 ++ blackVideo ++ Clip2

editVideo = editVideo.Subtitle("Part Two", lsp=10, align = 5, text_color = color_white, size = 120,first_frame = 22929, last_frame=23144)

return editVideo
Any help is appreciated, as I don't know what else to do.

Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz. 16 GM RAM
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
01-06-2024, 06:01 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 30 Times in 26 Posts
With the debug level of error handling in FFMPEG, this is where it froze last, on the last line:

[rawvideo @ 0000018edd397740] PACKET SIZE: 3110400, STRIDE: 2880ate=664721.4kbits/s speed=0.132x
Last message repeated 4 times
[rawvideo @ 0000018edd397740] PACKET SIZE: 3110400, STRIDE: 2880ate=664722.7kbits/s speed=0.132x
Last message repeated 4 times
[rawvideo @ 0000018edd397740] PACKET SIZE: 3110400, STRIDE: 2880ate=664724.1kbits/s speed=0.132x
Last message repeated 4 times
[rawvideo @ 0000018edd397740] PACKET SIZE: 3110400, STRIDE: 2880ate=664725.5kbits/s speed=0.132x
Last message repeated 4 times
[rawvideo @ 0000018edd397740] PACKET SIZE: 3110400, STRIDE: 2880ate=664726.8kbits/s speed=0.132x
Last message repeated 4 times
[rawvideo @ 0000018edd397740] PACKET SIZE: 3110400, STRIDE: 2880ate=664728.2kbits/s speed=0.132x
Last message repeated 4 times
[rawvideo @ 0000018edd397740] PACKET SIZE: 3110400, STRIDE: 2880ate=664729.5kbits/s speed=0.132x
Last message repeated 4 times
[rawvideo @ 0000018edd397740] PACKET SIZE: 3110400, STRIDE: 2880ate=664731.2kbits/s speed=0.132x
Last message repeated 3 times
Reply With Quote
Reply




Tags
ffmpeg, ffmpeg freezes, ffmpeg hangs

Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing in NLE after encoding Prores 422 HQ with ffmpeg in the Window 10. jsj2251 Edit Video, Audio 2 05-04-2022 01:47 PM
Best command script for encoding Separate Field Interlaced files? Cjdavis83 Encode, Convert for discs 0 09-05-2021 03:33 PM
Perfect my Avisynth script? geordie10 Restore, Filter, Improve Quality 7 10-23-2020 10:31 AM
Avisynth ffmpeg only green frames? knumag Restore, Filter, Improve Quality 16 10-27-2018 10:23 AM
FFMPEG, AviSynth, VirtualDub - Which tool for which purpose? naripeddi Restore, Filter, Improve Quality 2 07-05-2018 02:18 AM




 
All times are GMT -5. The time now is 02:56 PM