VideoHelp Forum
+ Reply to Thread
Results 1 to 19 of 19
Thread
  1. I'm trying to mimic my 20+ year test pattern tape that I've use to do electronic maintenance, my tapes are all busted, worth nothing anymore, so I'm willing to create new ones. This tapes has a loop of 10s B&W screen followed by 10s color bar with a stereo, non intermittent, background sound of a 440 Hz sine. With the help of Inkscape I was able to draw this iconic RCA Indian Test Pattern

    I borrow the avisynth code from here to create my own.
    Code:
    x1=ImageSource("J:\monoscope.png")
    x2=ImageSource("J:\cbar.png")
    edit=x1.Trim(0,240).Grayscale() + x2.Trim(0,240)
    return edit.loop()
    I've tried to use the ColorBar function, it doesn't work in this script. The Tone also doesn't work inside or outside the loop.
    Code:
    Tone(frequency=440, samplerate=48000, channels=2, type="sine", level=0.5)
    I thought I could import the script and latter add the tone, also without success.
    Code:
    Import("pattern.avs")
    Tone(frequency=440, samplerate=48000, channels=2, type="sine", level=0.5)
    Trim(0,43200).info()


    Another thing I couldn't figure it out by my self is how to make this work like this professional pattern tapes I had, the B&W screen is true B&W or grayscale, it has no color information on it, is possible to confirm this with a oscilloscope. I've converted this to different file formats, created a DVD and I could not get rid of the color signal from this screen.

    The Color Bars works great.


    The monosco is another history, can't get rid of the chroma signal.


    The original monosco test pattern test generates a signal like this that I use this to align the tape guides.


    How to create a B&W video of this pattern?
    I've looked in this forum, doom9 and other forums, there are tons of information about grayscale images, ffmpeg, but didn't find anything practical that really works.

    Any suggestions?
    Thanks.
    Quote Quote  
  2. B&W: GreyScale(), Tweak(sat=0.0), or ColorYUV(cont_u=-256, cont_v=-256) -- the latter two require YUV.

    Add audio:
    Code:
    video=Import("pattern.avs")
    audio=Tone(frequency=440, samplerate=48000, channels=2, type="sine", level=0.5)
    AudioDub(video, audio)
    Trim(0,43200).info()
    Last edited by jagabo; 21st Feb 2018 at 07:45.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    B&W: GreyScale(), Tweak(sat=0.0), or ColorYUV(cont_u=-256, cont_v=-256) -- the latter two require YUV.
    I'm using GreyScale(), you can check at my script, but still it has this info.

    This was using tmpgenc.
    Code:
    ID                                       : 224 (0xE0)
    Format                                   : MPEG Video
    Format version                           : Version 2
    Format profile                           : Main@High
    Format settings                          : BVOP
    Format settings, BVOP                    : Yes
    Format settings, Matrix                  : Default
    Format settings, GOP                     : M=3, N=18
    Duration                                 : 30 min 0 s
    Bit rate mode                            : Variable
    Bit rate                                 : 2 337 kb/s
    Maximum bit rate                         : 7 000 kb/s
    Width                                    : 720 pixels
    Height                                   : 480 pixels
    Display aspect ratio                     : 4:3
    Frame rate                               : 24.000 FPS
    Standard                                 : Component
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 0.282
    Time code of first frame                 : 00:00:00:00
    Time code source                         : Group of pictures header
    GOP, Open/Closed                         : Open
    GOP, Open/Closed of first frame          : Closed
    Stream size                              : 501 MiB (84%)
    Writing library                          : TMPGEnc 2.521.58.169
    Color primaries                          : BT.601 PAL
    Transfer characteristics                 : BT.470 System B, BT.470 System G
    Matrix coefficients                      : FCC 73.682
    This ffmpeg (DVD Styler)
    Code:
    ID                                       : 224 (0xE0)
    Format                                   : MPEG Video
    Format version                           : Version 2
    Format profile                           : Main@Main
    Format settings, BVOP                    : No
    Format settings, Matrix                  : Default
    Duration                                 : 467 ms
    Bit rate mode                            : Variable
    Maximum bit rate                         : 9 000 kb/s
    Width                                    : 720 pixels
    Height                                   : 480 pixels
    Display aspect ratio                     : 4:3
    Frame rate                               : 29.970 (30000/1001) FPS
    Standard                                 : NTSC
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Compression mode                         : Lossy
    ffmpeg -i pattern.avs -vf format=gray -pix_fmt yuv420p output.mp4
    Code:
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L3
    Format settings                          : CABAC / 4 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, RefFrames               : 4 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 30 min 0 s
    Bit rate                                 : 41.7 kb/s
    Width                                    : 720 pixels
    Height                                   : 480 pixels
    Display aspect ratio                     : 3:2
    Frame rate mode                          : Constant
    Frame rate                               : 24.000 FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.005
    Stream size                              : 8.96 MiB (24%)
    Writing library                          : x264 core 146 r2538 121396c
    Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    At the end, it will not be a true gray or B&W file.
    Quote Quote  
  4. What is a "true gray or B&W file"? And why do you think you need one?
    Quote Quote  
  5. About the late edition to Audio, the script makes the screen swap from 2 files (a monoscope and colorbar) used as video back and forth in loop, the AudioDub is useless in this case.
    Quote Quote  
  6. Originally Posted by amaipaipai View Post
    At the end, it will not be a true gray or B&W file.
    I'm not sure what you mean. All the functions I gave you reduce the chroma channels to flat 128, meaning there is no color. Are you looking to remove the chroma channels altogether? Use ConvertToY8(). What your encoder does with that is another issue.
    Quote Quote  
  7. Originally Posted by sneaker View Post
    What is a "true gray or B&W file"? And why do you think you need one?
    A true gray or B&W is a file without any color (chroma) information.

    I need one to do mechanism alignment, is a necessary visual cue, like this:


    A file with color information returns a different pattern on the oscilloscope, making it impossible to align the tape guides. In the past many manufactures sold this special tapes, VHS, DV, minDV, etc. Since we are talking about a old technology, they don't sell it anymore.
    Last edited by amaipaipai; 21st Feb 2018 at 11:46.
    Quote Quote  
  8. Originally Posted by jagabo View Post
    Originally Posted by amaipaipai View Post
    At the end, it will not be a true gray or B&W file.
    I'm not sure what you mean. All the functions I gave you reduce the chroma channels to flat 128, meaning there is no color. Are you looking to remove the chroma channels altogether? Use ConvertToY8().
    Yes, I need a video without any chroma information, just luma. After that, I need it to stay like that, if I convert the file to DVD it converts to another color format.

    Originally Posted by jagabo View Post
    What your encoder does with that is another issue.
    Well, that is the main issue.
    Quote Quote  
  9. I'm pretty sure DVD only supports YV12. But if the chroma channels are flat 128 you will get no color in the output.
    Quote Quote  
  10. If you use Greyscale() and encode to e.g. x264 (4:2:0) there will technically be chroma planes but they will be completely 0. Since chroma and luma planes are encoded separately there is no kind of color information present. If you still "get"/measure color during playback it has nothing to do with the encoding but only your playback/measuring equipment.
    Quote Quote  
  11. Originally Posted by amaipaipai View Post
    About the late edition to Audio, the script makes the screen swap from 2 files (a monoscope and colorbar) used as video back and forth in loop, the AudioDub is useless in this case.
    Again, it's not clear what you're asking for. You want different audio for the two patterns? Then use two AudioDubs in the script that builds the pattern videos.
    Quote Quote  
  12. Originally Posted by jagabo View Post
    Again, it's not clear what you're asking for. You want different audio for the two patterns? Then use two AudioDubs in the script that builds the pattern videos.
    I need a test pattern that swap between 2 different screens 10s apart from each other with a default 440 Hz tone as a default audio, I've already done the script to swap the patterns. The script just fail to add the audio.

    I'm attaching a sample video with the swapping patterns.
    Image Attached Files
    Quote Quote  
  13. Code:
    x1=ImageSource("J:\monoscope.png")
    x2=ImageSource("J:\cbar.png")
    edit=x1.Trim(0,240).Grayscale() + x2.Trim(0,240)
    loop = edit.loop()
    
    audio=Tone(frequency=440, samplerate=48000, channels=2, type="sine", level=0.5)
    
    AudioDub(loop, audio)
    Not what you want?

    (Of course you could just put the tone in a completely separate script, encode that to audio and mux with the H.264 video at the end. It's not mandatory to have them in a single script.)
    Quote Quote  
  14. Originally Posted by sneaker View Post
    Code:
    x1=ImageSource("J:\monoscope.png")
    x2=ImageSource("J:\cbar.png")
    edit=x1.Trim(0,240).Grayscale() + x2.Trim(0,240)
    loop = edit.loop()
    
    audio=Tone(frequency=440, samplerate=48000, channels=2, type="sine", level=0.5)
    
    AudioDub(loop, audio)
    Not what you want?

    (Of course you could just put the tone in a completely separate script, encode that to audio and mux with the H.264 video at the end. It's not mandatory to have them in a single script.)
    Yes, thats it.
    With a few changes for a 30min loop.
    Code:
    x1=ImageSource("J:\monoscope.png")
    x2=ImageSource("J:\cbar.png")
    edit=x1.Trim(0,240).Grayscale() + x2.Trim(0,240)
    loop = edit.loop()
    
    audio=Tone(length=1800, frequency=440, samplerate=48000, channels=2, type="sine", level=0.5)
    
    AudioDub(loop, audio)
    Trim(0,43200)
    It would be nice to create a DVD without YV12 and the B&W part to stay B&W.
    How the industry creates this B&W movies?
    On my equipment a B&W movie is B&W, do I need to encode this in a different standard?

    Than you for fixing the script!
    Quote Quote  
  15. Does this make a difference?
    Code:
    x1=ImageSource("J:\monoscope.png").ConvertToYV12().Grayscale()
    x2=ImageSource("J:\cbar.png").ConvertToYV12()
    edit=x1.Trim(0,240) + x2.Trim(0,240)
    loop = edit.loop()
    
    audio=Tone(length=1800, frequency=440, samplerate=48000, channels=2, type="sine", level=0.5)
    
    AudioDub(loop, audio)
    Trim(0,43200)
    Quote Quote  
  16. This is the DVD I have, Elvis Presley Jailhouse Rock, the Japanese release is B&W
    https://www.amazon.co.jp/監獄ロック-DVD-エルビス・プレスリー/dp/B00005I1PL/ref=sr_1_1?ie=UTF8&qid=151...=4988135516350

    The US release is NTSC B&W.
    https://www.amazon.com/Jailhouse-Rock-Deluxe-Elvis-Presley/dp/B000QUUD5G/ref=sr_1_1?ie...house+rock+dvd

    Do I need to do something special to convert this to B&W instead of NTSC B&W?
    Quote Quote  
  17. Originally Posted by sneaker View Post
    Does this make a difference?
    Code:
    x1=ImageSource("J:\monoscope.png").ConvertToYV12().Grayscale()
    x2=ImageSource("J:\cbar.png").ConvertToYV12()
    edit=x1.Trim(0,240) + x2.Trim(0,240)
    loop = edit.loop()
    
    audio=Tone(length=1800, frequency=440, samplerate=48000, channels=2, type="sine", level=0.5)
    
    AudioDub(loop, audio)
    Trim(0,43200)
    Yes, it mess up the colors, I'm not a big fan of YV12.
    YV12 (4:2:0)


    I rather prefer YV24 or any other 4:4:4 like RGB for storage, this is YV24
    Quote Quote  
  18. If your goal is DVD you have to use 4:2:0. No way around it. Even UltraHD Blu-Ray uses 4:2:0.

    (And 4:2:0 doesn't mess up large, single-color areas, anyways.)
    Quote Quote  
  19. Originally Posted by sneaker View Post
    If your goal is DVD you have to use 4:2:0. No way around it. Even UltraHD Blu-Ray uses 4:2:0.
    (And 4:2:0 doesn't mess up large, single-color areas, anyways.)
    Yes, for DVD looks like there is no way around it.

    I'm attaching the monosco file, don't know what a person will do with it outside a maintenance bench but... Just in case some one need it, fell free to use it. The colorbar file is a copy from the colorbar function from avisynth.


    Anyway, I can figure things up from now on, thank you both @sneaker and @jagabo for helping out.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!