VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 32
Thread
  1. i have video 1920x1040 but can't play on my TV (out 1920x1080). this video have AVC codec high profile, try to reduce profile with tsMuxer but not work.
    so, i need to re-encode my video. libx264 is better but more slow: for 2 hour video, need 70 minute to conversion!
    then i need to re-encode with mpeg4 (with high bitrate result is satisfying). i want scale video to reduce my time encoding. then i have used this command:
    Code:
    ffmpeg -i video.mp4 -acodec copy -c:v:0 mpeg4 -b:v:0 2000k -s 960x432 -y video2.mp4
    but with this code my TV enlarge image to my screen. i need to add -vf pad but i can't find the right proportions on:
    Code:
    -vf pad=960:xxx:0:xx
    tanxs to all for help.
    Quote Quote  
  2. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    In AviSynth you could use the AddBorders() function...

    This answer on StackOverflow might help you.
    Quote Quote  
  3. tanxs for reply but it's more simple add -vf pad to ffmpeg.
    i need correct value to this.
    Quote Quote  
  4. i've solved with 2 step:
    first scale video -s 960x432
    second add pad only (found correct value!) with -vf pad=960:540:0:54

    but how to have everything in one step?
    Quote Quote  
  5. Code:
    -vf pad=1920:1080:0:20,scale=960:540
    Quote Quote  
  6. yes. tanxs jagabo

    anyway another way is:
    Code:
    ffmpeg -i video.mp4 -c:a copy -c:v:0 mpeg4 -b:v:0 2400k -crf 23 -filter:v:0 "crop=1920:824:0:108,scale=960:432" -t 01:56:00.000 -y vid-007.mp4
    Last edited by lomero; 15th Sep 2021 at 12:37.
    Quote Quote  
  7. edit: @jagabo
    your code not work properly. my TV always adapt the image to its output...
    no black borders above and below
    Last edited by lomero; 15th Sep 2021 at 13:55.
    Quote Quote  
  8. The filter sequence I gave added black borders to the top and bottom of the 1920x1040 source to create a letterboxed 1920x1080 frame (standard 16:9 frame size). Then it resized to 960x540, 1/2 on each dimension so the aspect ratio is retained. So there are black borders in the the final video. They may be small enough that they are hidden by the TV's overscan.

    The filter sequence you gave doesn't really make sense. First of all, you're cropping the 1920x1040 source video to 1920x824. Why? Does the source already have black borders? If so you should have seen them on your TV when playing the original video. If not you are removing part of the picture. After that you resize the 1920x824 frame to 960x432. That will distort the video a little. If the original was square pixel you should have resized to 960x412 to retain the aspect ratio. And if your TV always stretches the video to full screen you should not have seen any borders.

    You should post a small sample of your source (without re-encoding) so we can see exactly what you have.
    Quote Quote  
  9. maybe your speech is correct, but in the end with your code on my TV i do not have black borders, with my code work fine.

    i have find this solution with help ffmpegyag app. put my resolution and add black borders to window app, save script and i see correct code for my question.

    here small sample source (without re-encoding): https://www.upload.ee/files/13475461/Joker_2.mp4.html
    Quote Quote  
  10. This works here:

    Code:
    -c:v libx264 -crf 20 -vf "pad=1920:1080:0:20, scale=960:540" -c:a copy
    Last edited by Sharc; 16th Sep 2021 at 03:24.
    Quote Quote  
  11. with libx264 work also without -vf pad
    but i need re-encode with mpeg4 (see my first post) and your code with mpeg4 not work.
    Quote Quote  
  12. Originally Posted by lomero View Post
    maybe your speech is correct, but in the end with your code on my TV i do not have black borders
    That movie was shot at 1.85:1. It's supposed to have very small borders at the top and bottom, about 20 lines each, when viewed on a 16:9 TV. Turn off the overscan on your TV so you can see the small letterbox bars with my filter sequence.

    Your sequence is throwing away 20 percent of the picture at the top and bottom and turning it into a 2.35:1 movie. That's not the way the movie was meant to be watched.
    Last edited by jagabo; 15th Sep 2021 at 18:41.
    Quote Quote  
  13. Originally Posted by lomero View Post
    with libx264 work also without -vf pad
    but i need re-encode with mpeg4 (see my first post) and your code with mpeg4 not work.
    Works perfectly with mpeg4 codec as well.
    Code:
    -c:v mpeg4 -b:v 5000k  -vf  "pad=1920:1080:0:20, scale=960:540" -c:a copy
    Must be your TV which hides the small top and bottom bars.
    Image
    [Attachment 60749 - Click to enlarge]
    Quote Quote  
  14. i don't know.
    maybe it's a problem to my TV, but tanxs Sharc but i don't have borders on my TV screen...

    and yes jagabo, you'r right: original is 1920x1040. my resolution is 960x432 i don't really remember why i chose this resolution... but in the endless tests i did, I looked at some sequences of the video well in detail, i can change the resolution of the video, but the center of the speech are the black bands on the sides.
    and i don't even understand why your code on my TV doesn't work. but this is.

    another question: crf factor is prerogative only for libx264 or also mpeg4? i see on Sharc code:
    Code:
    -c:v libx264 -crf 20
    Code:
    -c:v mpeg4 -b:v 5000k
    Quote Quote  
  15. Originally Posted by lomero View Post
    ... another question: crf factor is prerogative only for libx264 or also mpeg4? i see on Sharc code:
    Code:
    -c:v libx264 -crf 20
    Code:
    -c:v mpeg4 -b:v 5000k
    I don't think that the mpeg4 Visual has an CRF equivalent for rate control. The closest would probably be encoding with a fixed quantizer, but I didn't try and perhaps someone more knowledgable will chime in.

    You could check the available options with
    Code:
    ffmpeg.exe -h encoder=mpeg4
    Unless you have a strong reason (like a player restriction) to encode in mpeg4 Visual, I would drop it and go for mpeg4 AVC (-c:v libx264) instead which is much more efficient.
    Quote Quote  
  16. as already mentioned in my first post, i know that libx264 is better and more efficient, but a 2-hour video like mine, it takes a time of 60-70 minutes for encoding (speed 1.8x)
    with mpeg4 codec same video required 20 minute to encode (speed 5-6x) and the difference (on my little TV) it's not so much as to justify a time of 3 times as much for encoding.
    for only reason i preferred re-encode my video with mpeg4.
    Quote Quote  
  17. Originally Posted by lomero View Post
    maybe it's a problem to my TV, but tanxs Sharc but i don't have borders on my TV screen...
    Look up how to turn off the overscan feature on your TV. That will allow you to see the entire picture.

    Originally Posted by lomero View Post
    another question: crf factor is prerogative only for libx264 or also mpeg4? i see on Sharc code:
    Code:
    -c:v libx264 -crf 20
    Code:
    -c:v mpeg4 -b:v 5000k
    The constant quantizer setting for the mpeg4 encoder in ffmpeg is "-c:v mpeg4 -qscale:v 3".

    For faster encoding with libx264 try specifying the veryfast of superfast preset "-c:v libx264 -preset veryfast -crf 20". The quality will be less than the default (-preset medium) but it will still be better than the mpeg4 encoder at the similar bitrates.
    Quote Quote  
  18. tanxs jagabo for your help.
    now i try your suggestion.
    Quote Quote  
  19. In case you don't know what overscan is:

    https://www.howtogeek.com/252193/hdtv-overscan-what-it-is-and-why-you-should-probably-turn-it-off/

    Most TVs do it by default and have a way of disabling it. Turning it off will give you a sharper picture and let you see the entire picture. Attached is a sample video that lets you check for overscan. With overscan disabled you should see a picture like:

    Image
    [Attachment 60753 - Click to enlarge]


    On a 1080p monitor you should see all the way to edges of picture and there shouldn't be any distortion in the middle of the picture.

    With no overscan you should be able to see all of the gauges at the edges of the frame:

    Image
    [Attachment 60754 - Click to enlarge]


    With overscan part of the edges will be cut off:

    Image
    [Attachment 60758 - Click to enlarge]


    The center of the image should have clear alternating dark/bright lines:

    Image
    [Attachment 60756 - Click to enlarge]


    Not distortions like:

    Image
    [Attachment 60757 - Click to enlarge]


    On a 720p monitor you will see distortions in the middle but you should still be able to see all of all four gauges.
    Image Attached Files
    Last edited by jagabo; 16th Sep 2021 at 18:51.
    Quote Quote  
  20. with your advice, i've search overscan first on web, and after on my TV.
    on my TV i don't have the chance to turn off overscan, but i have 4 choices: automatic, 16/9, 4:3LB, 4:3PS
    with this video, if put auto or 16/9 i don't have black borders and image is adapted on my screen.

    but if i set overscan 4:3LB i see correct image with borders and right AR!
    but this rule is not always valid: with another video, 1696x720, 4:3LB setting not work, but i need put on 16/9 or auto to have right image out on my TV.
    probably changes the ratio and then has to change the output: while before it was 1920x1040 (AR 1.85) now here is 1696x720 (AR 2.35) and then you have to change TV output.
    thanks to your advice, jagabo, tried the various outputs, i found the correct one for my TV! Thank you.
    Quote Quote  
  21. Originally Posted by jagabo View Post
    In case you don't know what overscan is ......
    Nice test video, thank you.
    As a sidenote, just in case: The video did not play here on my TV because it has Profile "High@L5". Remuxing it (e.g. with tsmuxer) and changing to Profile to "High@L4.1" solved the problem. In worst case one may have to re-encode it with more relaxed settings, depending on player capability.
    Image Attached Files
    Last edited by Sharc; 17th Sep 2021 at 14:30.
    Quote Quote  
  22. Oh, I didn't notice the Profile@Level. I just used a batch file on my desktop to do the encoding and didn't think about that.
    Quote Quote  
  23. i've try to change profile level with tsmuxer but not work for me.
    this doesn't always work.
    Quote Quote  
  24. You don't need to change if if your player can play it. But here's a new one that High@4.0.
    Image Attached Files
    Quote Quote  
  25. Originally Posted by jagabo View Post
    You don't need to change if if your player can play it
    i try. sometimes work, other no.

    Originally Posted by jagabo View Post
    But here's a new one that High@4.0 ---- Overscan1920x1080.mkv
    what is that?
    Quote Quote  
  26. anyway this is mediainfo report to this my video that not play on my TV:

    HTML Code:
    General
    
    Format : MPEG-4 
    Format profile : Base Media 
    Codec ID : isom (isom/iso2/avc1/mp41) 
    File size : 1.07 GiB 
    Duration : 2 h 1 min 
    Overall bit rate : 1 258 kb/s 
    Writing application : Lavf58.29.100 
    
    Video
    
    Format : AVC 
    Format/Info : Advanced Video Codec 
    Format profile : High@L4 
    Format settings : CABAC / 4 Ref Frames 
    Format settings, CABAC : Yes 
    Format settings, Reference frames : 4 frames 
    Codec ID : avc1 
    Codec ID/Info : Advanced Video Coding 
    Duration : 2 h 1 min 
    Bit rate : 1 126 kb/s 
    Width : 1 920 pixels 
    Height : 1 040 pixels 
    Display aspect ratio : 1.85:1 
    Frame rate mode : Constant 
    Frame rate : 23.976 (24000/1001) FPS 
    Color space : YUV 
    Chroma subsampling : 4:2:0 
    Bit depth : 8 bits 
    Scan type : Progressive 
    Bits/(Pixel*Frame) : 0.024 
    Stream size : 981 MiB (90%) 
    Writing library : x264 core 157 r2969 d4099dd 
    Encoding settings : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=6 / 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=32 / lookahead_threads=5 / 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=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=1200 / vbv_bufsize=2048 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00 
    Tagged date : UTC 2019-12-18 02:55:56 
    Codec configuration box : avcC 
    this is another video that no play on my TV:

    HTML Code:
    General
    
    Format : MPEG-4 
    Format profile : Base Media 
    Codec ID : isom (isom/iso2/avc1/mp41) 
    File size : 630 MiB 
    Duration : 1 h 58 min 
    Overall bit rate : 742 kb/s 
    Writing application : Lavf58.29.100 
    
    Video
    
    Format : AVC 
    Format/Info : Advanced Video Codec 
    Format profile : High@L3 
    Format settings : CABAC / 4 Ref Frames 
    Format settings, CABAC : Yes 
    Format settings, Reference frames : 4 frames 
    Codec ID : avc1 
    Codec ID/Info : Advanced Video Coding 
    Duration : 1 h 58 min 
    Source duration : 4 min 17 s 
    Bit rate : 609 kb/s 
    Width : 720 pixels 
    Height : 304 pixels 
    Display aspect ratio : 2.35:1 
    Frame rate mode : Constant 
    Frame rate : 23.976 FPS 
    Color space : YUV 
    Chroma subsampling : 4:2:0 
    Bit depth : 8 bits 
    Scan type : Progressive 
    Bits/(Pixel*Frame) : 0.116 
    Stream size : 518 MiB (82%) 
    Source stream size : 518 MiB (82%) 
    Writing library : x264 core 157 r2969 d4099dd 
    Encoding settings : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=4 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=9 / 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=1 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=20 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=1200 / vbv_bufsize=2048 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00 
    Tagged date : UTC 2019-12-31 12:07:49 
    mdhd_Duration : 7129909 
    Codec configuration box : avcC 
    this is report that PLAY on my TV:

    HTML Code:
    General 
    
    Format : MPEG-4 
    Format profile : Base Media 
    Codec ID : isom (isom/iso2/avc1/mp41) 
    File size : 598 MiB 
    Duration : 54 min 14 s 
    Overall bit rate mode : Variable 
    Overall bit rate : 1 541 kb/s   
    Writing application : Lavf58.45.100 
    Cover : Yes 
    Part_ID : 1 
    
    Video
    
    Format : AVC 
    Format/Info : Advanced Video Codec 
    Format profile : High@L3.1 
    Format settings : CABAC / 4 Ref Frames 
    Format settings, CABAC : Yes 
    Format settings, Reference frames : 4 frames 
    Codec ID : avc1 
    Codec ID/Info : Advanced Video Coding 
    Duration : 54 min 13 s 
    Bit rate mode : Variable 
    Bit rate : 1 408 kb/s 
    Maximum bit rate : 14.0 Mb/s 
    Width : 1 280 pixels 
    Height : 720 pixels 
    Display aspect ratio : 16:9 
    Frame rate mode : Constant 
    Frame rate : 25.000 FPS 
    Color space : YUV 
    Chroma subsampling : 4:2:0 
    Bit depth : 8 bits 
    Scan type : Progressive 
    Bits/(Pixel*Frame) : 0.061 
    Stream size : 546 MiB (91%) 
    Title : 264:moovts=-1:fps=25:deps:par=auto@GPAC1.1.0-DEV-rev5187-g1ffb067d9-HEAD 
    Writing library : x264 core 148 r2722 1b0121b 
    Encoding settings : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x111 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=120 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / stitchable=1 / constrained_intra=0 / bframes=16 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=126 / scenecut=0 / intra_refresh=0 / rc_lookahead=250 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.50 / qpmin=6 / qpmax=51 / qpstep=4 / vbv_maxrate=14000 / vbv_bufsize=14000 / crf_max=0.0 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:0.80 
    Codec configuration box : avcC 
    all 3 video file have audio AAC. and this audio works, both on video that i don't play and on video that i play.
    all video use codec libx264 with High Profile Level. what differences? and why don't i see the first two while I see the last video well?
    Quote Quote  
  27. Maybe your TV player only plays standard resolutions like 1920x1080, 1280x720, 1440x1080, 720x480, 720x576

    Your 3 examples
    - the first is 1920x1040 = non standard, no play
    - the second is 720x304 = non standard, no play
    - the third is 1280x720 = standard, play

    Can you play jagabo's test clip?
    Quote Quote  
  28. yes, not play.
    start and re-start continuously...
    Quote Quote  
  29. Ugghh! How about this one? Does it play?
    Image Attached Files
    Quote Quote  
  30. yes, your version work for me.

    Image
    [Attachment 60793 - Click to enlarge]


    and then?
    Quote Quote  



Similar Threads

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