VideoHelp Forum
+ Reply to Thread
Results 1 to 26 of 26
Thread
  1. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    The video has Swedish subtitles burned in (white).
    The english .srt subs (yellow).
    Been using ffmpeg delogo filter over the Swedish subs, but it is distracting.
    If I could tell the filter to use the timing from the .srt file it might be less distracting on playback - trouble I don't even know if it's possible.
    Code:
    ffmpeg -i 1.avi  -vf delogo=x=199:y=295:w=269:h=54 -c:a aac -b:a 192k "%~dpn1.delogo.mkv"
    Image
    [Attachment 79352 - Click to enlarge]
    Quote Quote  
  2. Member Ennio's Avatar
    Join Date
    May 2005
    Location
    Netherlands
    Search Comp PM
    Wouldn't it suit better instead to create PGS subtitles with black backgrounds that you'd position over the Swedish subs? Hell of a job, I know. But it can be done.
    Quote Quote  
  3. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    This is for an 800x450 TV show - Hard coded subs are blurred out. An srt file is in the same folder as the final blurred video.
    Crop and overlay figures will need to be changed if the DAR of your videos differ.
    The figures in the overlay should be the same as the last 2 figures in the crop. i.e. 100:380
    Code:
    ffmpeg -i "video.mp4" -filter_complex "[0:v]crop=600:80:100:380,boxblur=6[fg]; [0:v][fg]overlay=100:380[v]" -map "[v]" -map 0:1 -c:a copy -y "blurredVideo.mp4"
    Once you have the blur set how you like it then any external subtitles should be ok. boxblur=10 will blur things a lot. I find 6 is good for me as it leaves a hint of the blurred image..

    crop=600:80:100:380 = a box 600 wide, 80 high - 100 pixels in from the left, 380 pixels down from the top
    overlay=100:380 = the overlay is positioned over the box.
    It will take time to get your head around the figures.
    Image Attached Thumbnails Click image for larger version

Name:	blurredVideo_snapshot.jpg
Views:	9
Size:	80.6 KB
ID:	79357  

    Quote Quote  
  4. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    Sorry about the late reply.

    @Ennio, the black background idea is good, except that the Swedish subs and the English subs differ in the number of characters used.So placing the English srt line over the corresponding Swedish line, doesn't cover it up.

    @pcspeak, that's a good idea too.
    I spent two days trying to figure out, when I used Virtualdub to place a black logo obscuring the Swedish subs, why the output audio was way out of sync.
    Turned out my source avi used packed bitstream and I used ffmpeg to fix that.
    Now the placement of the srt file over the logo is too low and I cannot figure how to move them into the black box.
    In the interim I will try your blur option.
    Image
    [Attachment 79410 - Click to enlarge]
    Quote Quote  
  5. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    Doing this will add a new line containing a space, after the text. moving the text up one line.
    Code:
    5
    00:01:46,910 --> 00:01:48,950
    This is a fun way to go.<br> <br>
    
    6
    00:01:49,350 --> 00:01:51,350
    Not as much fun as the other way.<br> <br>
    I'm not sure how you can easily do this for a full show.
    Also, with two lines of text, or more, there may be problems.

    EDIT: I worked out how to do it with my text editor (NoteTab Light)

    find 2 consecutive carriage return\new line;
    \r\n\r\n
    replace with;
    <br> <br>\r\n\r\n
    Probably don't need the space. Just <br><br>


    I tested this viewing with MPC-HC
    Last edited by pcspeak; 27th May 2024 at 17:53. Reason: Update
    Quote Quote  
  6. Originally Posted by sambat View Post
    The video has Swedish subtitles burned in (white).
    The english .srt subs (yellow).
    Been using ffmpeg delogo filter over the Swedish subs, but it is distracting.
    If I could tell the filter to use the timing from the .srt file it might be less distracting on playback - trouble I don't even know if it's possible.
    Code:
    ffmpeg -i 1.avi  -vf delogo=x=199:y=295:w=269:h=54 -c:a aac -b:a 192k "%~dpn1.delogo.mkv"
    Image
    [Attachment 79352 - Click to enlarge]
    This show is it "Rebus"? The actor looks like the guy who played "Rebus". You can get "Rebus" episodes from The Knowledge Network in Canada and also you can get them from UKTVPlay. Perhaps you could download better quality videos than you have now. I will have to check and see if the Knowledge Network has subtitles that you can turn on if you need them.
    Quote Quote  
  7. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    It's an improvement over my initial effort that's for sure.
    Now if I could move the srt file on top of the original it would be even better.
    Can't figure out how to move it.Aegisub supposedly can do it with ass files except the instructions baffle me.
    Image Attached Thumbnails Click image for larger version

Name:	output.jpg
Views:	4
Size:	28.3 KB
ID:	79414  

    Click image for larger version

Name:	input.jpeg
Views:	5
Size:	76.7 KB
ID:	79415  

    Quote Quote  
  8. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    @Tom Saurus
    Thank you I will check that out.
    Quote Quote  
  9. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    @pcspeak
    Will look at that (there are 700 lines of text) and there are multiple lines in places (see my previous post #7).
    Quote Quote  
  10. Originally Posted by sambat View Post
    @Tom Saurus
    Thank you I will check that out.
    It is only 720 x 404 maximum resolution for Rebus on The Knowledge Network and no subtitles. I will go and check the specs for the show on UKTVPlay. You might want to check out "Pie In The Sky" as it is another UK Mystery show on UKTVPlay.

    I checked UKTVPlay and got the specs for an episode of "Rebus". It is 1024x576 video resolution at 1791 Kbps. It also has English subs that you can select to turn on they would not be hard coded.

    The actor who played "Rebus" can also be seen in "Irvin Welsh's Crime" playing a Police Captain. There are some characters in that show you may need subtitles for because of their thick accent and they get a lot of words out in short order.
    Last edited by Tom Saurus; 27th May 2024 at 19:04. Reason: Additional Information
    Quote Quote  
  11. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    @pcspeak
    I downloaded NoteTab Light and opened a .srt file, but I don't see those \r\n\r\n or br
    Image
    [Attachment 79418 - Click to enlarge]
    Quote Quote  
  12. The problem with using srt subtitles like this is that the original SRT spec doesn't address things like positioning, size, etc. The programmers of some players have added extensions but they apply only to that player. So you need to figure out what will work with the player you are using. But as soon as you switch players, or try to use the player built into your smart TV they may not work.

    https://en.wikipedia.org/wiki/.srt
    Quote Quote  
  13. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    @jagabo
    Thank you.I resolved the issue for now by using Subtitle Edit to load the video and the .srt file and changed format to ass.
    File >Open File -load the .srt file
    Format>ASS
    Edit>Select all
    R/C on the line listing and select ASSA Tools>Select Position
    New screen opens; verify that 'Apply to' is all selected lines (my case 782 lines)
    Drag the displayed line to new position and (all selected lines will be changed) click OK.
    Save the new ass file, and test with video.
    I loaded the video and ass files into my WDTV and the results were quite good.
    Quote Quote  
  14. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    I'm glad to see you switched to ass subtitles. It makes life easier.
    The \r\n\r\n characters are control characters. One can't see them with NoteTab, or most basic editors, but they are there, and can be modified.
    Quote Quote  
  15. Originally Posted by sambat View Post
    I resolved the issue for now by using Subtitle Edit to load the video and the .srt file and changed format to ass.
    Except there's very little support for ass subs outside of a computer.
    Quote Quote  
  16. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    @sambat
    A demo on the altering of \r\n\r\n using NoteTab.
    clip0006.avi
    Not my best creation. :-)

    Cheers.
    Quote Quote  
  17. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    @pcspeak
    No I can't get my head arround the method.
    What I did stumble on is putting a dot or period after each dialog line will move the line up the screen.
    The period is unobtrusive and seems simple, except that there are 700 plus lines and I can't figure a way to automate it.
    I either need a way using your 'notepad' or Notepad++ or Renamer or Subtitle Edit or.....

    1
    00:01:00,482 --> 00:01:02,871
    This machine's been tampered with!
    .

    2
    00:01:03,842 --> 00:01:06,402
    17B was black coffee.
    .

    3
    00:01:06,562 --> 00:01:09,520
    Now it's... It's tea.
    .

    4
    00:01:09,682 --> 00:01:14,198
    If you're whinging' you must be bored.
    Here's something to occupy you.
    .
    Quote Quote  
  18. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    OK. Try this.
    Download this tiny program. http://findandreplace.io/download It's a 133k zip.
    Unzip and put fnr.exe in the folder with the srt file.
    In the following 1 line batch file change the srt file name to match yours, then run it.

    add-line-breaks.cmd
    Code:
    fnr.exe --cl --dir "%CD%" --fileMask "My Video.srt" --useEscapeChars --find "\n\n" --replace "<br><br>\n\n"
    That should do it.
    Quote Quote  
  19. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    I don't see any differences in the output srt file or on video playback.

    C:\Users\Superuser\Desktop\fnr>fnr.exe --cl --dir "%CD%" --fileMask "1.srt" --useEscapeChars --find "\n\n" --replace "<b
    r><br>\n\n"

    C:\Users\Superuser\Desktop\fnr>

    ====================================
    Stats

    Files:
    - Total: 1
    - Binary: 0 (skipped)
    - With Matches: 0
    - Without Matches: 1
    - Failed to Open: 0
    - Failed to Write: 0

    Matches:
    - Found: 0
    - Replaced: 0

    Duration: 0.04 secs
    ====================================
    Quote Quote  
  20. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    I found a small 'Gotcha!" in my batch file.
    It depends how each line of your srt file is terminated.
    I have NoteTab Light terminating lines with just \n, and saving the file with the encoding UTF-8

    Try this.
    Code:
    fnr.exe --cl --dir "%CD%" --fileMask "1.srt" --useEscapeChars --find "\r\n\r\n" --replace "<br><br>\r\n\r\n"
    This is my result - 51 replacements
    Code:
    D:\am2>fnr.exe --cl --dir "%CD%" --fileMask "1.srt" --useEscapeChars --find "\r\n\r\n" --replace "<br><br>\r\n\r\n"
    
    D:\am2>
    File:     .\1.srt
    Matches:  51
    Replaced: Yes
    
    
    ====================================
    Stats
    
    Files:
    - Total: 1
    - Binary: 0 (skipped)
    - With Matches: 1
    - Without Matches: 0
    - Failed to Open: 0
    - Failed to Write: 0
    
    Matches:
    - Found: 51
    - Replaced: 51
    
    Duration: 0.027 secs
    ====================================
    Cheers.
    Quote Quote  
  21. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    The program detects the subs and adds <BR><BR> to the end of each line but the behaviour is the same as before (not scrolling the line up).
    BTW I can't access the online help file for fnr, can't connect to the server "findandreplace.codeplex.com"


    Code:
    C:\Users\Superuser\Desktop\fnr>fnr.exe --cl --dir "%CD%" --fileMask "1.srt" --useEscapeChars --find "\r\n\r\n" --replace
     "<br><br>\r\n\r\n"
    
    C:\Users\Superuser\Desktop\fnr>
    File:     .\1.srt
    Matches:  783
    Replaced: Yes
    
    
    ====================================
    Stats
    
    Files:
    - Total: 1
    - Binary: 0 (skipped)
    - With Matches: 1
    - Without Matches: 0
    - Failed to Open: 0
    - Failed to Write: 0
    
    Matches:
    - Found: 783
    - Replaced: 783
    
    Duration: 0.05 secs
    ====================================

    Code:
    00:01:00,482 --> 00:01:02,871<br><br>
    
    This machine's been tampered with!<br><br>
    
    2
    00:01:03,842 --> 00:01:06,402
    17B was black coffee.<br><br>
    
    3
    00:01:06,562 --> 00:01:09,520
    Now it's... It's tea.<br><br>
    
    4
    00:01:09,682 --> 00:01:14,198
    If you're whinging' you must be bored.
    Here's something to occupy you.<br><br>
    
    5
    00:01:15,202 --> 00:01:17,796
    Under-age kids at Peggy Vernon's?<br><br>
    Quote Quote  
  22. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    Originally Posted by sambat View Post
    BTW I can't access the online help file for fnr, can't connect to the server "findandreplace.codeplex.com"
    Moved to http://findandreplace.io/overview
    Quote Quote  
  23. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    I'm having no problems here. (Win10 Laptop -> HDMI -> Sony 4k TV)

    Maybe put in the full stop you were testing with.
    <br>.<br>
    or even just a space.
    <br> <br>


    This is the default.
    Code:
    7
    00:00:27,193 --> 00:00:30,321
     SEE RIGHT THROUGH THEM
    This is my test.
    Code:
    7
    00:00:27,193 --> 00:00:30,321
     SEE RIGHT THROUGH THEM<br>.<br>.<br>.<br>

    Try another player?
    Image Attached Thumbnails Click image for larger version

Name:	1.mp4_snapshot_00.29.629-1.jpg
Views:	2
Size:	152.0 KB
ID:	79480  

    Click image for larger version

Name:	1.mp4_snapshot_00.29.629-2.jpg
Views:	2
Size:	150.5 KB
ID:	79481  

    Quote Quote  
  24. You can't rely on HMTL tags like <br> to work in SRT files. HTML tags are not part of the SRT standard so support is spotty. Here's another trick that works in some players: put a character with the hex value 0x90 in the SRT file (where you're putting <br> now).
    Image Attached Files
    Quote Quote  
  25. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    @jagabo
    You're absolutely right. Your 0x90 shows up as \r\n in my editor.
    Maybe for sambat do a find "\r\n\r\n" replace "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    Just kiddin'. (sort of)

    @sambat
    I have been using MPC-HC to play all my videos for many years. All subtitles are srt.
    Some symbols (e.g. ♪ ♫ ® ©) are weird when subtitles are converted to srt files. No biggie.
    Last edited by pcspeak; 30th May 2024 at 18:13. Reason: grammatical error
    Quote Quote  
  26. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    Thank-you guys, but this is giving me brain bleed.
    I used this command to print periods after the dialog line and it works, however to save me from slashing my wrists, I'll use subtitle Edit and covert to ass files.
    Again a tip of the hat to everyone!

    fnr.exe --cl --dir "%CD%" --fileMask "1.srt" --useEscapeChars --find "\r\n\r\n" --replace "<br> . <br> . <br>\r\n\r\n"
    Quote Quote  



Similar Threads

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