#1 : 23/09-14 23:05 vletroye
Posts: 7
|
Hello, here after is my script to add the video "format" to the name of my movies...
var format = ''; if (item.videoWidth == 0) { format = ''; } else if (item.videoWidth < 1280) { if (item.videoHeight < 576) { format = ' SD NTSC'; } else { format = ' SD PAL-SECAM'; } } else if (item.videoWidth < 1920) { format = ' HD 720p'; } else if (item.videoWidth < 3840) { format = ' HD 1080p'; } else if (item.videoWidth < 7680) { format = ' UHD 4K'; } else { format = ' UHD 8K'; } format = format + ' (' + item.videoWidth + 'x' + item.videoHeight + ')'; return item.newBasename + format; Unfortunately, for some movies, item.videoWidth and item.videoHeight are null. But I noticed that the correct size is available via the ExifTool. So I can replace item.videoWidth and item.videoHeight with: var w = item.exifToolValue('ImageWidth'); var h = item.exifToolValue('ImageHeight'); but this is much slower... Any idea why the video tags don't have a value? I did compare a movie with the issue and another one that works fine (using MediaInfo v0.7.70) and didn't see any relevant difference. Here is the info of a movie for which AR returns an empty width: Format : Matroska Format version : Version 2 File size : 7.95 GiB Duration : 1h 48mn Overall bit rate : 10.5 Mbps Encoded date : UTC 2009-05-10 09:57:49 Writing application : mkvmerge v2.7.0 ('Do It Again') built on Apr 16 2009 22:41:30 Writing library : libebml v0.7.7 + libmatroska v0.8.1 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : [email protected] Format settings, CABAC : Yes Format settings, ReFrames : 5 frames Codec ID : V_MPEG4/ISO/AVC Duration : 1h 48mn Bit rate : 8 202 Kbps Width : 1 920 pixels Height : 816 pixels Display aspect ratio : 2.35:1 Frame rate mode : Constant Frame rate : 23.976 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.218 Stream size : 6.06 GiB (76%) Title : Video Writing library : x264 core 67 r1128M 682b54d Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x2 / me=umh / subme=7 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=8202 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00 Language : French Default : Yes Forced : No And here is one for which AR returns the correct Widh : Format : Matroska Format version : Version 2 File size : 8.75 GiB Duration : 1h 58mn Overall bit rate : 10.6 Mbps Encoded date : UTC 2009-05-10 09:16:30 Writing application : mkvmerge v2.7.0 ('Do It Again') built on Apr 16 2009 22:41:30 Writing library : libebml v0.7.7 + libmatroska v0.8.1 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : [email protected] Format settings, CABAC : Yes Format settings, ReFrames : 5 frames Codec ID : V_MPEG4/ISO/AVC Duration : 1h 58mn Bit rate : 8 279 Kbps Width : 1 920 pixels Height : 816 pixels Display aspect ratio : 2.35:1 Frame rate mode : Constant Frame rate : 23.976 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.220 Stream size : 6.69 GiB (76%) Title : Video Writing library : x264 core 67 r1128M 682b54d Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x2 / me=umh / subme=7 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=8279 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00 Language : French Default : Yes Forced : No |