VideoHelp Forum
+ Reply to Thread
Results 1 to 22 of 22
Thread
  1. Member
    Join Date
    Oct 2005
    Location
    England
    Search Comp PM
    I have several videos, .flv files, which I want to put a black bar over a small part to obscure something. I will be watching the videos in MPC-HC, the version that comes with the latest CCCP.

    I'm completely useless when it comes to computer languages.
    Quote Quote  
  2. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Makes a whole lot more sense to do this graphically in an NLE, rather than programmatically as in avisynth.

    Scott
    Quote Quote  
  3. Code:
    BAR_WIDTH = 64
    BAR_HEIGHT = 32
    X_POSITION = 200
    Y_POSITION = 100
    
    # get the source video, since we aren't explicitly naming it the name AviSynth assigns is "last"
    WhateverSource("filename.ext")
    
    #make a small black bar from a piece of the source video
    bar = Crop(last, 0, 0, BAR_WIDTH, BAR_HEIGHT).ColorYUV(gain_y=-256, off_y=16, cont_u=-256, cont_v=-256)
    
    # overly the bar
    Overlay(last, bar, X_POSITION, Y_POSITION)
    Replace the values for the bar size and postion. And change WhateverSource() to whatever is appropriate for your source, AviSource(), ffVideoSource(), DirectShowSource(), etc.
    Quote Quote  
  4. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    But the time taken to figure out those bar sizes/positions is nearly equal to the time to graphically create them within an NLE. Plus, you would likely have to make use of generous applications of TRIM() so those bars would only be applied to certain frames.
    That's a LOT of extra (and IMO, unnecessary) work, just to work with avisynth.

    Scott
    Quote Quote  
  5. Maybe he doesn't have an NLE.
    Quote Quote  
  6. You can use aviutl. Free, multi track editor. You can generate shapes within the program, and animate them if you want to cover up the "something"
    Quote Quote  
  7. Member
    Join Date
    Oct 2005
    Location
    England
    Search Comp PM
    Will using an 'NLE' or aviutl actually edit the video file though? I don't want the file itself touched unless it doesn't require reencoding it. I'll play around with the script though and see if I can get the position correct, thanks for that... I'll let you know if it works.
    Quote Quote  
  8. Of course, doing what you want requires reencoding. The only possible way to avoid at least reencoding the parts with the black bar is to add it as a subtitle.
    Quote Quote  
  9. It sounds to me like he only wants to play the video via the AviSynth script.
    Quote Quote  
  10. Member
    Join Date
    Oct 2005
    Location
    England
    Search Comp PM
    Yeah I want this without the files being edited, if the script doesn't work, do subtitle files work with any video container? Most of what I'm working with are .flvs.

    I 'do' have aegissub, only ever used it to modify text though, but if you can use that to make a black bar.. perhaps if you can have a black background behind the text, then I could just make it using space.
    Quote Quote  
  11. When you edit a video the original file is not changed. The changes are applied to a new video file created by the editor.

    What happens with soft subtitle is player dependent. You can create a graphic subtitle that's a black box and leave it as a separate file, or mux it into the video container. A single 2 hour sub may appear on-screen for the entire duration of the video as long as you don't seek. But if you seek while watching the sub will probably disappear.
    Last edited by jagabo; 17th Jul 2014 at 11:41.
    Quote Quote  
  12. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    See my recent post re: creating black bar subtitles using ANSI text. That might help. Still going to be a pain with placement.

    Scott
    Quote Quote  
  13. Why wouldn't the script work? What are you trying to cover up? Is it "tactically" difficult? e.g. does it animate, move, change shape /size ? Do you just want a static "block" or shape ?
    Quote Quote  
  14. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Maybe it's another one of those sanitizing/censorship jobs.

    Scott
    Quote Quote  
  15. Member
    Join Date
    Oct 2005
    Location
    England
    Search Comp PM
    Okay I tried the script and I've got an issue. The bar appears, but the video isn't playing back correctly. It won't play at all with Avisource, MPC-HC says ffVideoSource isn't an option, and with DirectShowSource the file's audio plays at an extremely accelerated speed, though the video plays at normal speed.
    Quote Quote  
  16. MPC-HC[/url] says ffVideoSource isn't an option,
    ffvideosource works with mpchc, but ffms2.dll is an external plugin (doesn't come with default avisynth install)

    To hear audio, you need ffaudiosource with audiodub(), or use the ffmpegsource2 wrapper function included with the .avsi

    e.g

    FFMpegSource2("video.flv", atrack=-1)
    Quote Quote  
  17. Member
    Join Date
    Oct 2005
    Location
    England
    Search Comp PM
    Says FFMpegSource2 isn't an option either, I'll try and find this ffms2.dll, where would I need to put it?
    Quote Quote  
  18. put the .dll and .avsi in the avisynth plugins folder

    https://github.com/FFMS/ffms2/releases
    Quote Quote  
  19. Member
    Join Date
    Oct 2005
    Location
    England
    Search Comp PM
    Hmm alright, I copied over the files to the correct folder, now all the ones I try simply say they can't open the file. And since adding those, DirectShowsource won't open it not either.

    Er, Cornucopia I might just be blind, but where did you give info on going the subtitle route to make a black bar? If avisynth isn't liking my video files then perhaps subtitle files will...
    Quote Quote  
  20. What is the error mesage you're getting, verbatim ?

    Post your exact avs script

    Make sure you're using the correct version. E.g. you install avisynth 32bit, you use the x86 version of the ffms2.dll plugin . And that's what you should be using because avisynth 64bit is unstable. Both the ffms2.dll and ffms2.avsi should go in the plugins folder

    Are these "regular" flv files? h264/aac compression ? Vp6? What does mediainfo say about these (view=>text)
    Quote Quote  
  21. Member
    Join Date
    Oct 2005
    Location
    England
    Search Comp PM
    Directshowsource : Could not open as video or audio, says both returned Unspecificed error on my .avs, line 7
    FFvideosource and ffmpeg2source returned simpled "Can't open 'filename'" and quoted line 7 again. Here's my script.

    I am definitely using the 32bit version and the x86 version of the plugin.


    "BAR_WIDTH = 64
    BAR_HEIGHT = 32
    X_POSITION = 200
    Y_POSITION = 100

    # get the source video, since we aren't explicitly naming it the name AviSynth assigns is "last"
    ffvideosource("JeffStickAgain.flv")

    #make a small black bar from a piece of the source video
    bar = Crop(last, 0, 0, BAR_WIDTH, BAR_HEIGHT).ColorYUV(gain_y=-256, off_y=16, cont_u=-256, cont_v=-256)

    # overly the bar
    Overlay(last, bar, X_POSITION, Y_POSITION)"

    Here's what mediainfo says about the .flv, they're directly downloaded from twitch.tv.

    "General
    Complete name : C:\Users\Xirix\Desktop\JeffStickAgain1.flv
    Format : Flash Video
    File size : 200 MiB
    Duration : 29mn 59s
    Overall bit rate : 931 Kbps
    Tagged date : UTC 2014-07-14 15:39:59
    Tagging application : flvmeta 1.1-r213

    Video
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L3.1
    Format settings, CABAC : Yes
    Format settings, ReFrames : 4 frames
    Codec ID : 7
    Duration : 29mn 59s
    Bit rate : 768 Kbps
    Width : 854 pixels
    Height : 480 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 30.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.062
    Stream size : 171 MiB (86%)
    Writing library : x264 core 129 r2239 c69e2d0
    Encoding settings : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=4 / lookahead_threads=1 / 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=1 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=abr / mbtree=1 / bitrate=768 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

    Audio
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : 10
    Duration : 29mn 59s
    Bit rate : 125 Kbps
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 44.1 KHz
    Compression mode : Lossy
    Stream size : 28.4 MiB (14%)

    "
    Quote Quote  
  22. Originally Posted by Xirix View Post
    Directshowsource : Could not open as video or audio, says both returned Unspecificed error on my .avs, line 7
    FFvideosource and ffmpeg2source returned simpled "Can't open 'filename'" and quoted line 7 again. Here's my script.

    I am definitely using the 32bit version and the x86 version of the plugin.
    Use the full pathnames

    e.g

    DirectShowSource("S:\folder\path\video.flv")
    or
    FFMpegSource2("PATH\video.flv", atrack=-1)

    of course change "PATH" to the real path

    Code:
    FFMpegSource2("C:\Users\Xirix\Desktop\JeffStickAgain1.flv", atrack=-1)




    For DirectShowSource, you can force an fps, see if that fixes your audio issue. You might have to remove the ffms2 plugins to get it working again, but not sure why that would have affected it in the first place? Maybe something else you did ?

    DirectShowSource("video.flv", fps=30)

    30 because mediainfo says it's 30

    or even try convertfps=true

    DirectShowSource("video.flv", fps=30, convertfps=true)

    Code:
    DirectShowSource("C:\Users\Xirix\Desktop\JeffStickAgain1.flv", fps=30, convertfps=true)
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!