VideoHelp Forum
+ Reply to Thread
Results 1 to 30 of 30
Thread
  1. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi, please , i ask this query as i want to do some video edit on a video.
    Now i have taken a snapshot of a video.
    Now, i have to know the position of starting of a rectangle width and height to issue a ffmpeg command
    For that , i need the position of start of upper part of the video
    how to know the pixel position as it is very difficult to find
    i have tried microsoft pic manager, it helps in resizing the picture.
    i will try to know these things from an editior
    But is there any easy way of knowing the pixel position.
    The deduction of cropped portion in picture manager would cut the left and right most part of the video as well.
    experts please
    Quote Quote  
  2. You can use a free image editor, such as gimp . When you mouse over a position, it will read out the x,y coordinates in the status bar

    Or do the crop in a program like vdub2 visually, then use those crop values to calculate the coordinates for ffmpeg since you know the width, height of the original video

    eg. top left coordinate would be
    (x = width - left crop , y = height - top crop)

    Or avspmod for avisynth has mouse over x,y coordinates as well, and/or perform the crop to learn the values
    Quote Quote  
  3. Originally Posted by jraju View Post
    experts please
    Regular (general) experts or SME (Subject Matter Experts)?
    Quote Quote  
  4. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi, do not take literally . i think all who answers my query are experts . i do not mean the other experts
    Quote Quote  
  5. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi, poisoned , thanks for your gist formula.
    Now i know how to fix it in formula
    Thanks . Will check it.
    Quote Quote  
  6. IrfanView. When you mark somethhing it'll show the info in top of the screen.
    Quote Quote  
  7. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi, poisoned..
    if supppose , the picture size is 540x360,
    and if 540-93, then shall i take x as 447
    like, 360-90, hen i take the y as 270
    and supply the full heifht and width of the picture
    Should we take , the pixel count from top of the image or bottom of the image,
    i will try , but want you to give an example , by taking in to ac**** picture size 540x360
    Quote Quote  
  8. The problem with most common types of video, is they are subsampled (4:2:0) , this means you often cannot use odd numbers such as 447 for some types of filters. If you took a screenshot it's different, because it has been converted to RGB (not subsampled) . But you might not be able to apply those numbers to the original video

    The "formula" might be wrong , it was late and I was just typing . Now that I think about it, the top left corner should be those crop values x, y coordinates

    But which ffmpeg filter are you using ? There are expressions that can auto calculate in ffmpeg based on the video characteristics, such as width etc... It helps to work through a concrete example
    Last edited by poisondeathray; 13th Oct 2019 at 09:55.
    Quote Quote  
  9. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi, Poisoned , did you see my other thread. Jaga has given a formula based on the picture i sent, for which i want to delogo.
    His formula works, but gives me 0 bytes output.
    There are some video converters, which help in cropping, but it entirely crops the whole bootom portion making the video smaller and loosing all bottom scenes.
    So, i am trying ffmpeg formula to delogo
    shall i wait for x,y, w, h
    Quote Quote  
  10. no I did not see the other thread, but I see it's jagabo and I' m sure he's got you covered
    Quote Quote  
  11. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi, He is giving me cllues, but executing it in my side, the resultant video is 0 bytes.I thought of opening a separae thread, as i do not know, the position of co oridnates and also ,if it has to be found from top or bottom

    when i move curesor on my image, a frame by snapshot, it shows the same points horizontally, as it is it's width.
    Quote Quote  
  12. Below is a screenshot where some hardcoded subtitles are marked in IrfanView.

    Image
    [Attachment 50526 - Click to enlarge]


    In the top you'll see the coordinate of the left upper corner of the rectangle as is used in ffmpeg delogo. Also the width and heigth of the rectangle is shown as used in ffmpeg delogo. So using the command

    Code:
    ffmpeg -i Hcclip-1.avi -vf "delogo=x=480:y=914:w=946:h=86" -an delogo.mkv
    you get this image

    Image
    [Attachment 50527 - Click to enlarge]
    Quote Quote  
  13. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    hi, videobruger,
    Thanks for the reply, but the expected output is still not achieved by me
    the formula with the irwan view is as below in my case
    ffmpeg -i outputone.mp4 -vf "delogo=x=40:y=278:w=415:h=82" -an delogo.mp4


    the output file has zero bytes.
    is there any missing on my part
    i had issued the command at the bin folder, where my exe resides.
    the path: C: program files\ffmpeg\bin
    So, i opened a command prompt, and went to bin to issue the command
    please correct it, if anything is wrong on my side
    as you say, irfanview, shows xyhw and i had changed my input file, which also is placed on the bin folder
    Quote Quote  
  14. Where is the file outputone.mp4? It should also be in your bin folder or you should specify the path to it.

    It's better to take the 3 files (ffmpeg.exe, ffprobe.exe, ffplay.exe) and place them in your path.
    Quote Quote  
  15. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi, is the file path to ffmpeg correctly included in path
    Then all the exe should be executed

    C:\Windows>echo %path%
    C:\Windows;C:\Windows\System32;C:\Windows\System32 \Wbem;C:\Windows\System32\Wind
    owsPowerShell\v1.0;C:\Program Files\PATHS;d:\;C:\Program Files\PuTTY\;c:\program
    files\kitty;C:\Program Files\Common Files\Adobe\AGL;Crogramfiles\videolan\vlc
    ;c:\program files\ffmpeg\bin\ffmpeg.exe

    C:\Windows>
    Quote Quote  
  16. No.

    Change

    c:\program files\ffmpeg\bin\ffmpeg.exe

    to

    c:\program files\ffmpeg\bin

    Test it by opening a command prompt somewhere and type ffmpeg.

    You should get this

    Image
    [Attachment 50543 - Click to enlarge]
    Last edited by videobruger; 15th Oct 2019 at 00:45. Reason: Added image
    Quote Quote  
  17. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    HI, i am getting the screen, but on execution, i get some errors. . i have taken the four values as shown by irvan view and also just substituTed the four values in the same way as you have shown. but the result is still not achieving.
    Selection points are shown in the same sequences in the formula, is there any missing on my part,
    i have already given the formula for yur perusal
    the eror message is logo area outside the frame
    C:\Program Files\ffmpeg\bin>ffmpeg -i avl.mp4 -vf "delogo=x=43:y=270:w=396:h=90"
    -an delogo.mp4
    ffmpeg version N-95160-g9fdc2c7bc4 Copyright (c) 2000-2019 the FFmpeg developers

    built with gcc 9.2.1 (GCC) 20190918
    configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfi
    g --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libb
    luray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enab
    le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --e
    nable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable
    -libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 -
    -enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enab
    le-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --en
    able-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcode
    c --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 -
    -enable-avisynth --enable-libopenmpt --enable-amf
    libavutil 56. 35.100 / 56. 35.100
    libavcodec 58. 59.101 / 58. 59.101
    libavformat 58. 33.100 / 58. 33.100
    libavdevice 58. 9.100 / 58. 9.100
    libavfilter 7. 59.100 / 7. 59.100
    libswscale 5. 6.100 / 5. 6.100
    libswresample 3. 6.100 / 3. 6.100
    libpostproc 55. 6.100 / 55. 6.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'avl.mp4':
    Metadata:
    major_brand : isom
    minor_version : 512
    compatible_brands: isomiso2avc1mp41
    encoder : Lavf58.33.100
    Duration: 01:24:18.47, start: 0.000000, bitrate: 423 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yu
    v420p, 540x360 [SAR 1:1 DAR 3:2], 289 kb/s, 29 fps, 29 tbr, 14848 tbn, 58 tbc (d
    efault)
    Metadata:
    handler_name : VideoHandler
    Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 12
    8 kb/s (default)
    Metadata:
    handler_name : IsoMedia File Produced by Google, 5-11-2011
    File 'delogo.mp4' already exists. Overwrite? [y/N] y
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    [delogo @ 00eaad80] Logo area is outside of the frame.
    [Parsed_delogo_0 @ 00eaacc0] Failed to configure input pad on Parsed_delogo_0
    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #0:0
    Conversion failed!

    C:\Program Files\ffmpeg\bin>
    are there any wrong input in the four x,y, w, h
    Image Attached Thumbnails Click image for larger version

Name:	sample.png
Views:	154
Size:	331.0 KB
ID:	50544  

    Last edited by jraju; 15th Oct 2019 at 02:38. Reason: add more logs
    Quote Quote  
  18. [delogo @ 00eaad80] Logo area is outside of the frame.
    Use h=88
    Quote Quote  
  19. Originally Posted by videobruger View Post
    [delogo @ 00eaad80] Logo area is outside of the frame.
    Use h=88
    To clarify, a video with a height or 360 pixels has has pixel Y coordinates from 0 to 359. So 360 (270+90) is outside the frame. That will cause ffmpeg to abort.
    Quote Quote  
  20. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi, video bruger,
    It seems working. The process is on and i will report ba
    So the hck.
    i went to the bin folder and then execute your command
    So h is the problematic variable.
    kindly explain, how you got the error message decoded that h is out of logo area
    So, can we take , that by reducing all variables that are shown in irfanview, would correctly execute the command
    one more sub query:
    how to know the inbuilt player of my samsung tv.
    the manual list , the container support formats,
    when i play some files the sound is excellent, while playing some, the sound is low and have to slide to maximum
    Thanks for giving me a solution.
    now, i will try to hardencode english subtitles to the movie

    can i use the same co ordinates and encode the same video with eng subtitles
    what is the code i should use to insert a srt file in the same area
    i have an srt file, which i have chosen , when playing with vlc media player
    for viewing on tv, i have to hardcode the subtitles
    kindly supply the formula in ffmpeg
    Quote Quote  
  21. Originally Posted by jraju View Post
    kindly explain, how you got the error message decoded that h is out of logo area
    Simple math: 270 + 90 = 360.
    Quote Quote  
  22. kindly explain, how you got the error message decoded that h is out of logo area
    jagabo explained this #19 & #21

    that by reducing all variables that are shown in irfanview, would correctly execute the command
    No. As long as the values are kept within the frame no need to change anything.

    when i play some files the sound is excellent, while playing some, the sound is low and have to slide to maximum
    Normalize the audio. Drop the video onto Audacity and use the normalize filter. Save it and use MKVToolnix to replace the original audio with the normalized.

    i have to hardcode the subtitles
    Why? But I would use .ass as it gives you more possibilities for position etc.

    https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo
    Quote Quote  
  23. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi, jaga, and video burger thanks for your clarification.
    I am new to the pixel and so i ask, how to plot those.
    irfan view gives all the four variables by just marking our logo area.
    the video was now without logo, and also without audio.
    i checked in vlc codec, and only video codec was present,
    should i add anything in the formula
    Thought , that there is a meaning in this value , 00eaad80]
    valuable help i got in this fourm.
    why audio went out of video
    Quote Quote  
  24. The -an removes the audio,
    Use

    Code:
    ffmpeg -i Hcclip-1.avi -vf "delogo=x=480:y=914:w=946:h=86" -c:a copy delogo.mkv
    to have the audio
    Quote Quote  
  25. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi, thanks , ass format include conversion etc.
    if suppose, i just use the subtitle command, would it auto, encode the subtitles at the bottom
    if that is , then i will use this formula
    by just modyfying my file names
    ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi
    let me know
    Quote Quote  
  26. Just add the subtitles filter after the delogo filter:

    Code:
    -vf  "delogo=x=480:y=914:w=946:h=86,subtitles=subtitle.srt"
    Quote Quote  
  27. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi, Ok, jaga,
    i do not know, that i should raise a separate topic or continue in this thread, if moderator permits.
    When i download subtitles using vlc media player , through their vl , it downloads srt file for the movie.
    But , it also add something kind of adjustment in the beginning of the srt files.
    the video timing is 1:24:18 seconds whereas SRt file timings ends iwith 1:24:53, i have a github application html to adust the first audio with first line in the time frame with the srt with it. But since i do not know the language of the original film, i could not decipher if all are in place with other time lines in the srt files.
    Is there anything that fixes this,
    There is also a hashtag code option of downloading the movie subtitltles, how to get the code
    if this has to be raised in subtitle title of the fourm, i will raise it there
    i heard that srt time lines are to be in sync with the audio of the movie, how to fix this
    i could match the first voice with the first line, but not others
    Quote Quote  
  28. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi video burger, thanks for that language sync.
    what i meant, is that i have a english srt file, I want that to sync with my first audio voice . Your link , shows, two languages sync in subtitles. what i want is, sync with audio of first line in different language video, say german with english srt first line.Sure , i got subtitle edit software.
    When i open the vlc to download srt files, it shows only english subtitles srt from opensubtitle org
    Quote Quote  
  29. Member jraju's Avatar
    Join Date
    Mar 2013
    Location
    India
    Search Comp PM
    Hi, video burger, quite interesting link. So, i have gone to the internet select fresh subtitles and tried to sync point as you mentioned in the lilnk. That is very nice of you. i do not know that it existed in subtitle edit.
    I just select the first line in both the files , applied sync.
    i just checked some lines and then go to the last page, where i find all are matching with lilne number . As i do not know french, i just tried my maximum best.
    Do i need to , select line by page by page or could randomly select as per my knowledge. i had done it.
    This part i have done as per your link instructions.

    how to set my audio sync with english , that is the problem. i will see , but if you give me a clue, i will be happy to first sync subtitle with audio, and then attempt to hardcode the subtitle
    Quote Quote  



Similar Threads

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