Ticket #4539: mythburn-addffmpegparams.diff

File mythburn-addffmpegparams.diff, 2.3 KB (added by thrantastic@…, 16 years ago)

Add additional ffmpeg parameters when transcoding from nuv to mpeg2

  • mythburn.py

    old new  
    20912091    parameters = profileNode.getElementsByTagName("parameter")
    20922092
    20932093    # default values - will be overriden by values from the profile
    2094     outvideobitrate = 5000
     2094    outvideobitrate = "5000k"
    20952095    if videomode == "ntsc":
    20962096        outvideores = "720x480"
    20972097    else:
     
    21012101    outaudiobitrate = 384
    21022102    outaudiosamplerate = 48000
    21032103    outaudiocodec = "ac3"
     2104    deinterlace = 0
     2105    croptop = 0
     2106    cropright = 0
     2107    cropbottom = 0
     2108    cropleft = 0
     2109    qmin = 5
     2110    qmax = 31
     2111    qdiff = 31
    21042112
    21052113    for param in parameters:
    21062114        name = param.attributes["name"].value
     
    21192127            outvideobitrate = value
    21202128        if name == "-s":
    21212129            outvideores = value
     2130        if name == "-deinterlace":
     2131            deinterlace = 1
     2132        if name == "-croptop":
     2133            croptop = value
     2134        if name == "-cropright":
     2135            cropright = value
     2136        if name == "-cropbottom":
     2137            cropbottom = value
     2138        if name == "-cropleft":
     2139           cropleft = value
     2140        if name == "-qmin":
     2141           qmin = value
     2142        if name == "-qmax":
     2143           qmax = value
     2144        if name == "-qdiff":
     2145           qdiff = value
    21222146
    21232147    if chanid != -1:
    21242148        if (usecutlist == True):
     
    21582182    command += "-f s16le -ar %s -ac %s -i %s " % (samplerate, channels, os.path.join(folder, "audout"))
    21592183    command += "-f rawvideo -pix_fmt yuv420p -s %s -aspect %s -r %s " % (videores, aspectratio, fps)
    21602184    command += "-i %s " % os.path.join(folder, "vidout")
    2161     command += "-aspect %s -r %s -s %s -b %s " % (aspectratio, fps, outvideores, outvideobitrate)
    2162     command += "-vcodec mpeg2video -qmin 5 "
     2185    command += "-aspect %s -r %s " % (aspectratio, fps)
     2186    if (deinterlace == 1):
     2187        command += "-deinterlace "
     2188    command += "-croptop %s -cropright %s -cropbottom %s -cropleft %s " % (croptop, cropright, cropbottom, cropleft)
     2189    command += "-s %s -b %s -vcodec mpeg2video " % (outvideores, outvideobitrate)
     2190    command += "-qmin %s -qmax %s -qdiff %s " % (qmin, qmax, qdiff)
    21632191    command += "-ab %s -ar %s -acodec %s " % (outaudiobitrate, outaudiosamplerate, outaudiocodec)
    21642192    command += "-f dvd %s" % quoteFilename(destvideofile)
    21652193