+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 71

Thread: [SOLVED] Editor to increase brightness of half of screen only?

  1. #1
    Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Posts
    616

    [SOLVED] Editor to increase brightness of half of screen only?

    Hello

    I shot a conference that was badly lit and, to make matters worse, I had to include the screen where the speaker showed slides. I included a screenshot.

    Is there an application that can brighten up only part of the screen vertically, and leave the other half untouched?

    I tried AviDemux, but it doesn't seem to support that feature.

    Thank you.
    Attached Thumbnails Click image for larger version

Name:	vlc.snapshot.bt.peniche.png
Views:	430
Size:	177.4 KB
ID:	33578  

    Last edited by yetanotherlogin; 14th Sep 2015 at 04:03.
    Quote Quote  

  2. #2
    Member
    Join Date
    Jun 2012
    Location
    USA
    Posts
    5,219

    Re: Editor to increase brightness of half of screen only?

    The classy way -- free -- is to use Resolve Lite. Depends on the codec of your original.
    Assuming this is a static shot, you can create a mask in any half-decent NLE.
    Slightly harder:
    Create a mask in a paint program and combine two instances of your shot with Avisynth.
    Quote Quote  

  3. #3
    Member
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    28,719

    Re: Editor to increase brightness of half of screen only?

    Another approach is to use a luma mask. That would work even if there was motion / handheld shot . Essentially the filter(s) are only applied differentially to either brighter or to darker areas. So you might darken the screen but brighten the other areas. Most NLE's can do this, and you can do it in avisynth
    Quote Quote  

  4. #4
    Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Posts
    616

    Re: Editor to increase brightness of half of screen only?

    Thanks. Is it easy to use?

    "DAVINCI RESOLVE 11
    Entry level DaVinci color correction software for use with third party panels."
    https://www.blackmagicdesign.com/products/davinciresolve

    I don't really need to create a mask: Simply splitting the screen in half vertically would be good enough.
    Quote Quote  

  5. #5
    Member
    Join Date
    Jun 2012
    Location
    USA
    Posts
    5,219

    Re: Editor to increase brightness of half of screen only?

    Quote Originally Posted by yetanotherlogin View Post
    I don't really need to create a mask: Simply splitting the screen in half vertically would be good enough.
    Whatever you want to call it -- that's a mask.

    Davinci Resolve Lite (13) does not require external hardware. Yes there is a learning curve and you'll want to look at some tutorials. It offers exquisite control over color corrections. This basic stuff isn't particularly difficult.
    Quote Quote  

  6. #6
    Member
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    28,719

    Re: Editor to increase brightness of half of screen only?

    Resolve is incredible software, even the free version is amazing, but it's probably more difficult to use for most people

    You can do this in almost any editor that has more than 1 layer. Something also free, easy to use and will import almost anything is aviutl. (Resolve has very limited formats it can import)

    cropping (called "clipping" in aviutl) example
    Click image for larger version

Name:	aviutl_clipping.jpg
Views:	3168
Size:	257.8 KB
ID:	33579

    luminance key example
    Click image for larger version

Name:	aviutl_luminancekey.jpg
Views:	3147
Size:	233.2 KB
ID:	33580

    I've included both project files in the zip file. This is just a quick example of how to apply filters differentially - you'd spend more time fixing the brightness and contrast.

    Short description:
    What you 're basically doing with either case, is compositing 2 layers. The top layer #1 is actually the "bottom" (layer order is reversed). So in the screenshots, layer #1 is the original, with no effects applied. Layer 2 is a copy of the same video, but has the effects applied

    In the "clipping" (cropping) example, The right side of layer 2 is cropped. This is sort of what you wanted, to brighten the "left" side. Thus the layer #1 right side "shows" through on the right side , and only the left side on layer 2 has the color compensation effect applied with the lightness adjusted

    The other example is the luminace key , where brights show through. This is the method I would use. Basically, it's masking out either bright or dark areas. In this case, the bright areas are keyed out (transparent) so the bright areas on layer 1 are shown through, but the filter is applied to the dark area on layer 2. Same basic idea, but the mask is based brightness levels instead of a static crop

    So you might composite a 3rd layer, where you adjust the visibility with brightness/contrast/levels of the screen, so it's more legible



    Additional basic instructions:
    1) You need the "adv editing timeline" activated by going in the menu => filter+ => adv. editing timeline.
    2) drop and drag your video(s) onto the timeline. In this example you would drop one onto layer 1 as-is , then another one onto layer 2 (or make a copy of layer 1 by ctrl+c to copy, ctrl+v to paste). The effects are applied on layer 2 as described above

    To open the "image file [standard drawing]" dialog box shown in those screenshots, you just double click a layer. Clicking The "+" button in the top right corner of that dialog box gives you access to the filter list

    All parameters are "keyframeable" - meaning they can vary over time. Lets say you want to adjust the brighness due to different exposures etc..Go to the aviutl thread and look at the tutorials posted by maverick tse and racer-x if you want more info. There are video and written tutorials on basic usage
    Attached Files
    Last edited by poisondeathray; 9th Sep 2015 at 18:22.
    Quote Quote  

  7. #7
    Member
    Join Date
    Dec 2005
    Posts
    59,234

    Re: Editor to increase brightness of half of screen only?

    AviSynth script to cut the video in half, adjust the two halves, then put them back together:

    Code:
    ImageSource("vlc.snapshot.bt.peniche.png").ConvertToYV12()
    left=Crop(0, 0, width/2, height).ColorYUV(gain_y=600, off_y=-30)
    right=Crop(width/2, 0, width/2, height).ColorYUV(cont_y=400, off_y=-170)
    StackHorizontal(left,right)
    I can't upload images anymore. Maybe someone else can use the script and upload the result.

    Click image for larger version

Name:	adj.jpg
Views:	3312
Size:	22.3 KB
ID:	33593

    Looks like the problem was in my router! A week or so ago I was playing with the router's filtering options. I must have screwed something up. Reset to factory defaults then setup again appears to have fixed the problem.
    Last edited by jagabo; 11th Sep 2015 at 06:10.
    Quote Quote  

  8. #8
    Member
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    28,719

    Re: Editor to increase brightness of half of screen only?

    jagabo try pm baldrick or post in the feedback section

    maybe you posted too many "naughty" images and got a suspension
    Quote Quote  

  9. #9
    aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Posts
    10,842

    Re: Editor to increase brightness of half of screen only?

    jagabo - have you added anything to your browser lately? i added privacy badger to chrome and lots of website buttons don't work unless it's turned off.
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  

  10. #10
    DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Posts
    5,142

    Re: Editor to increase brightness of half of screen only?

    With the (optional-?) help from the DScaler filters, one can get similar results through ffdshow's raw video filter.

    Yes, I like to complicate things needlessly
    Attached Thumbnails Click image for larger version

Name:	ffdshow-ex.png
Views:	473
Size:	91.4 KB
ID:	33583  

    Quote Quote  

  11. #11
    Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Posts
    616

    Re: Editor to increase brightness of half of screen only?

    Quote Originally Posted by poisondeathray View Post
    2) drop and drag your video(s) onto the timeline. In this example you would drop one onto layer 1 as-is , then another one onto layer 2 (or make a copy of layer 1 by ctrl+c to copy, ctrl+v to paste). The effects are applied on layer 2 as described above
    Thanks much for the infos.

    I'm giving AviUtl a try, but can't figure out how to copy/paste the video into Layer 2 after successfully (?) dragging and dropping it onto the Layer 1 section in the timeline:

    I hit CTRL+C and CTRL+V, but nothing happens, and there are no Edit > Copy/Paste Video menu either.

    FWIW, here's the video I'm trying to import:
    Code:
    Input #0, mpeg, from 'full.mpeg':
      Duration: 02:26:46.56, start: 0.226767, bitrate: 8810 kb/s
        Stream #0:0[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
        Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:4
    5 DAR 16:9], max. 9100 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Attached Thumbnails Click image for larger version

Name:	AviUlt.imported.video.into.layer.1.png
Views:	284
Size:	45.9 KB
ID:	33586  

    Last edited by yetanotherlogin; 10th Sep 2015 at 07:34.
    Quote Quote  

  12. #12
    Member
    Join Date
    Jun 2012
    Location
    USA
    Posts
    5,219

    Re: Editor to increase brightness of half of screen only?

    Returning to Resolve for a moment -- once you learn how to get your material in and out, the actual correction is fairly easy.


    For your file I created a new serial node, added an oval power window with soft edges to the dark section and lifted the gamma and highlights.

    For the fun of it, I added a second node and brought down the gamma on the screen display to add a bit more contrast.

    This image shows the circular window node selected -- note the gamma and gain settings under the color wheels.
    Attached Thumbnails Click image for larger version

Name:	work.png
Views:	492
Size:	601.8 KB
ID:	33590  

    Attached Images  
    Quote Quote  

  13. #13
    Member
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    28,719

    Re: Editor to increase brightness of half of screen only?

    Quote Originally Posted by yetanotherlogin View Post

    I'm giving AviUtl a try, but can't figure out how to copy/paste the video into Layer 2 after successfully (?) dragging and dropping it onto the Layer 1 section in the timeline:

    Were you able to drop it onto layer 1 ? (it's not shown in the screenshot). If not, make sure L-smash has higher priority as an import plugin (file=>settings=>import plugin priority => move L-smash up higher in the list and push ok)

    I hit CTRL+C and CTRL+V, but nothing happens, and there are no Edit > Copy/Paste Video menu either.
    In the version I'm using there is edit => copy/paste in the menu aviutl 1.10 (not installed version, portable) . It's also there in 1.6 version which I have on a different WIN XP computer


    Make sure the layer is selected. If you click away, copy / paste won't work. CTRL+C to copy, put the cursor onto layer 2 and left click to select the destination (eg. you might have wanted to use track 7), then CTRL+V and the start of the layer will be pasted where you clicked (e.g. for another project you might want the IN point to start at frame 4636 on track 8)
    Quote Quote  

  14. #14
    Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Posts
    616

    Re: Editor to increase brightness of half of screen only?

    Quote Originally Posted by poisondeathray View Post
    Were you able to drop it onto layer 1 ? (it's not shown in the screenshot). If not, make sure L-smash has higher priority as an import plugin (file=>settings=>import plugin priority => move L-smash up higher in the list and push ok)
    Yes, but indeed, it's not shown in the timeline.

    There are no trace of L-smash in the list:
    Name:  AviUtl.Imports.Plugins.Priority.png
Views: 4340
Size:  5.9 KB

    Incidently, I downloaded "Download AviUtl Extra Pack 1.11 (direct link) (39.4MB)" through the direct link provided by VideoHelp, but it's actually release 1.00: http://www.videohelp.com/software/AviUtl
    Last edited by yetanotherlogin; 11th Sep 2015 at 04:21.
    Quote Quote  

  15. #15
    Member
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    28,719

    Re: Editor to increase brightness of half of screen only?

    Some people don't like 1.11 because it's an installed version. The previous versions were all "portable" and ran within a folder, could be put on usb key etc..

    Here are older versions. I think l-smash is included with them (l-smash is based on libav/ffmpeg libraries, so you can open basically anything up with aviutl, even MKV , 10bit AVC, HEVC etc...)
    http://www.videohelp.com/software/AviUtl/old-versions#download

    I can vouch for 1-10[win7] and 1-6[xp] . The 1-6[xp] version actually runs ok on win8 machine too
    Quote Quote  

  16. #16
    Member racer-x's Avatar
    Join Date
    Mar 2003
    Location
    3rd Rock from the Sun
    Posts
    2,975

    Re: Editor to increase brightness of half of screen only?

    Aviutl has a Shadow-Highlight recovery filter that is suited for this type of thing. You'll find it in the "Animation" effects...
    Attached Thumbnails Click image for larger version

Name:	Aviutl.png
Views:	371
Size:	341.7 KB
ID:	33596  

    Got my retirement plans all set. Looks like I only have to work another 5 years after I die........
    Quote Quote  

  17. #17
    Member
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    28,719

    Re: Editor to increase brightness of half of screen only?

    I never new aviutl had that; it looks like it's shadow/highlight is sort of like photoshop/ae's shadow/highlight

    avisynth also has HDRAGC() to boost shadows without touching brights. You can use histogram() to help guide your levels

    Code:
    ImageSource("vlc.snapshot.bt.peniche.png")
    ConvertToYV12()
    HDRAGC(coef_gain=1.0, coef_sat=0.75)
    HDRAGC(coef_gain=0.2, coef_sat=0.75)
    Click image for larger version

Name:	hdragc.png
Views:	3382
Size:	238.0 KB
ID:	33602

    In your screenshot in the 1st post, the brights are clipped, but your camera probably records some usable info that is recoverable in the superbrights (Y >235 ) . It's VLC that is probably clipping in the screenshot
    Quote Quote  

  18. #18
    Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Posts
    616

    Re: Editor to increase brightness of half of screen only?

    Thanks for the extra tips.

    After installing AviUtl_ExtraPack1-10[Win7]Release on a Windows7 host, AviUtl complains with this:

    System Error: The program can't start because d3dx9_43.dll is missing from your computer. Try reinstalling the program to fix this problem.
    Does someone what package I should install?

    ---

    If I wanted to try AviSynth, should I launch it from VirtualDub? If that's the case, is there a good tutorial on how to set things up?
    Last edited by yetanotherlogin; 11th Sep 2015 at 04:38.
    Quote Quote  

  19. #19
    Member
    Join Date
    Dec 2005
    Posts
    59,234

    Re: Editor to increase brightness of half of screen only?

    Quote Originally Posted by yetanotherlogin View Post
    If I wanted to try AviSynth, should I launch it from VirtualDub? If that's the case, is there a good tutorial on how to set things up?
    AviSynth is script based. You use a text editor like Notepad to create a script then open that script in an editor or encoder as if it was a video file. Yes, you can use VirtualDub's File -> Open Video File. I usually use VirtualDub to preview scripts, then use the x264 command line encoder to encode the script. Here's another example of what you could do, whether in AviSynth or some other editor (blending two videos via an alpha mask):

    Click image for larger version

Name:	four.jpg
Views:	3042
Size:	39.8 KB
ID:	33605

    On the top left is a brighter version of the original video. They speaker is more normally lit but the projection screen is completely washed out. On the top right is a darkened version of the video, there's a little more detail visible in the screen but the speaker and background have gone completely black. On the lower left is an alpha mask I created using a paint program (starting with the original image). That controls how the two videos (lightened and darkened) are mixed when they are blended together. The black parts of the mask will select one video, the bright parts of the mask will select the other. Shades of grey in between will be a weighted average of the two. On the bottom right is the final result.

    Code:
    alpha=ImageSource("alpha.png", start=0, end=23, fps=23.976).ConvertToYV12(matrix="PC.601")
    ImageSource("vlc.snapshot.bt.peniche.png", start=0, end=23, fps=23.976).ConvertToYV12()
    
    darks=ColorYUV(gain_y=600, off_y=-30) # a lighted version of the video
    brights=ColorYUV(cont_y=400, off_y=-170) # a darkened version of the video
    
    Overlay(darks, brights, mask=alpha) # blend the two together
    A static mask like this will only work if the camera doesn't move. If the camera is moving you might be able to build a mask from the video itself -- by pumping up the contrast so that the bright screen is totally blown out and the darker background is totally crushed.

    Another approach is to use Gradation Curves in VirtualDub. That gives you non-linear brightness adjustments:

    Click image for larger version

Name:	grad.jpg
Views:	3022
Size:	83.3 KB
ID:	33606
    Last edited by jagabo; 11th Sep 2015 at 06:46.
    Quote Quote  

  20. #20
    Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Posts
    616

    Re: Editor to increase brightness of half of screen only?

    It's a bit over my head

    The camera was kept still the whole time, and the movie is in MPEG.

    Since I can't use AviUtl because of the error I reported above, I'll try to use VirtualDub + AviSynth.
    Quote Quote  

  21. #21
    Member
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    28,719

    Re: Editor to increase brightness of half of screen only?

    System Error: The program can't start because d3dx9_43.dll is missing from your computer. Try reinstalling the program to fix this problem.
    I think that is a directx error message . I think if you install DirectX from Microsoft it will stop complaining
    Quote Quote  

  22. #22
    Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Posts
    616

    Re: Editor to increase brightness of half of screen only?

    [strike]The error disappears after installing "VC2010, VC2012 and VC2013 redistributables" as written in that page:
    http://mavericktse.mooo.com/wordpress/archives/891[/strike]

    It showed up again. It really does go away by installing the following release of DirectX:
    http://answers.microsoft.com/en-us/windows/forum/windows_7-gaming/system-error-the-pro...9b31bf5?auth=1


    Now I'm back with "AviUtl_ExtraPack1-10[Win7]Release".

    However, even after drag 'n dropping the MPEG file onto the "Layer 1" line at the bottom, and clicking on OK in the "Create a new project" dialog, the Layer 1 line is empty, unlike the screenshot in the thread above. Actually, it's not totally empty, as it now shows a thin, blue line on each line:
    Click image for larger version

Name:	AviUtl.Imports.Plugins.Priority.empty.Layers.jpg
Views:	3358
Size:	79.6 KB
ID:	33608

    As shown, I made sure to move the "L-SMASH" item at the top of the list of Imports Plugins Priority.
    Last edited by yetanotherlogin; 11th Sep 2015 at 10:39.
    Quote Quote  

  23. #23
    Member
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    28,719

    Re: Editor to increase brightness of half of screen only?

    You might have to close, restart aviutl for change in the import plugins priority to "stick"
    Quote Quote  

  24. #24
    Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Posts
    616

    Re: Editor to increase brightness of half of screen only?

    I did, but still no go

    Checking the "Match imported file" option in the import dialog makes no difference.

    Incidently, the play button does nothing: The video doesn't play.
    Quote Quote  

  25. #25
    Member
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    28,719

    Re: Editor to increase brightness of half of screen only?

    Can you drag your still image in post #1 onto track 1 ? or another random video e.g. from youtube ? (does anything else import ?)
    Quote Quote  

  26. #26
    Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Posts
    616

    Re: Editor to increase brightness of half of screen only?

    Yes, I tried with two different MP4 files, and they import OK.

    Does AviUtl actually support MPEG files?

    Code:
    c:\>ffprobe.exe -i full.mpeg
    ffprobe version N-58043-g0062869 Copyright (c) 2007-2013 the FFmpeg developers
      built on Nov 12 2013 18:01:41 with gcc 4.8.2 (GCC)
      configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
    e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
    ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
    ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
    eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aa
    cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
    ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
      libavutil      52. 52.100 / 52. 52.100
      libavcodec     55. 41.100 / 55. 41.100
      libavformat    55. 21.100 / 55. 21.100
      libavdevice    55.  5.100 / 55.  5.100
      libavfilter     3. 90.102 /  3. 90.102
      libswscale      2.  5.101 /  2.  5.101
      libswresample   0. 17.104 /  0. 17.104
      libpostproc    52.  3.100 / 52.  3.100
    
    Input #0, mpeg, from 'full.mpeg':
      Duration: 02:26:46.52, start: 0.226767, bitrate: 8810 kb/s
        Stream #0:0[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
        Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:4
    5 DAR 16:9], max. 9100 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Quote Quote  

  27. #27
    Member
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    28,719

    Re: Editor to increase brightness of half of screen only?

    Yes, it support mpeg2. It supports basically anything ffmpeg can open

    Can you cut a small sample , maybe with ffmpeg and post it ?
    Quote Quote  

  28. #28
    Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Posts
    616

    Re: Editor to increase brightness of half of screen only?

    Here's a 20-second sample:
    http://dl.free.fr/nDe4EBTEB
    (You might need to disable adblockers for that site to see the CAPTCHA)

    Incidently, ffmpeg displays a warning when slicing:
    Code:
    [mpeg @ 0428f980] ac3 in MPEG-1 system streams is not widely supported, consider using the vob or the dvd muxer to force a MPEG-2 program stream.
    Quote Quote  

  29. #29
    Member
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    28,719

    Re: Editor to increase brightness of half of screen only?

    BTW One thing you will have problems with when using 1-10[win7] is keeping the 5.1 audio - it seems to downmix 5.1 to stereo. If you're not' doing any actual editing (only fixing the levels/brightness), then you can just remux the original audio

    That is why I keep the 1-6 [xp] around. It's able to keep 5.1 when you enter FL+FR+FC+LFE+SL+SR in the channel layout settings for l-smash (file=>settings => import plugin => l-smash => channel layout)
    Quote Quote  

  30. #30
    Member
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    28,719

    Re: Editor to increase brightness of half of screen only?

    Yes, it won't open it properly as-is. Probably due to that same error about mpeg1-ps. Just remux it into a mpeg2-program stream and it will open it

    eg.
    ffmpeg -i input.mpeg -c:v copy -c:a copy -f vob output.mpg

    And what I said above about "usable" overbrights was correct - you a tiny bit of usable data >235 which you can manipulate to make the projection screen slightly better. Most consumer cameras actually record ~16-255
    Quote Quote  

+ Reply to Thread

Similar Threads

  1. Replies: 6
    Last Post: 23rd Jul 2014, 07:11
  2. Replies: 5
    Last Post: 9th Jun 2014, 04:08
  3. Problem with VideoPad Editor - screen turns black
    By titothetitan in forum Editing
    Replies: 3
    Last Post: 18th May 2013, 03:13
  4. Half-half Black-green screen on Philips DVDR 3455H dvd/hdd recorder
    By 1234567 in forum DVD & Blu-ray Recorders
    Replies: 4
    Last Post: 22nd Dec 2012, 14:51
  5. Blu-ray Subs - half hardcoded, half unavailable?
    By playXray in forum Video Conversion
    Replies: 7
    Last Post: 13th May 2012, 16:17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts