VideoHelp Forum


Try StreamFab All-in-One and rip streaming video! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. I use this command to reencode:

    Code:
    ffmpeg -y -hide_banner -hwaccel auto -copyts -i INPUT.ts -vcodec libx264 -x264opts force-cfr:nal-hrd=cbr -profile:v high -level:v 40 -preset medium -b:v 1000k -maxrate 1000k -bufsize 1000k -flags +ilme+ildct -alternate_scan 1 -top 0 -acodec copy -bsf:v "filter_units=remove_types=6" -map 0 OUTPUT.ts
    MediaInfo for the output:

    Code:
    General
    ID                          : 1 (0x1)
    Complete name               : C:\TV\output.ts
    Overall bit rate mode       : Variable
    Overall bit rate            : 1 379 kb/s
    
    Video
    ID                          : 256 (0x100)
    Menu ID                     : 1 (0x1)
    Format                      : AVC
    Format/Info                 : Advanced Video Codec
    Format profile              : High@L4
    Format settings             : CABAC / 4 Ref Frames
    Format settings, CABAC      : Yes
    Format settings, Reference  : 4 frames
    Codec ID                    : 27
    Duration                    : 13 s 480 ms
    Bit rate mode               : Constant
    Bit rate                    : 1 000 kb/s
    Width                       : 1 920 pixels
    Height                      : 1 080 pixels
    Display aspect ratio        : 16:9
    Frame rate                  : 25.000 FPS
    Color space                 : YUV
    Chroma subsampling          : 4:2:0
    Bit depth                   : 8 bits
    Scan type                   : MBAFF
    Scan type, store method     : Interleaved fields
    Scan order                  : Top Field First
    Bits/(Pixel*Frame)          : 0.019
    Stream size                 : 1.69 MiB (76%)
    Writing library             : x264 core 161 r3033 0d754ec
    Encoding settings           : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / 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=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=tff / 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=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=cbr / mbtree=1 / bitrate=1000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=1000 / vbv_bufsize=1000 / nal_hrd=cbr / filler=1 / ip_ratio=1.40 / aq=1:1.00
    
    Audio
    ID                          : 257 (0x101)
    Menu ID                     : 1 (0x1)
    Format                      : MPEG Audio
    Format version              : Version 1
    Format profile              : Layer 2
    Codec ID                    : 3
    Duration                    : 13 s 464 ms
    Bit rate mode               : Constant
    Bit rate                    : 256 kb/s
    Channel(s)                  : 2 channels
    Sampling rate               : 48.0 kHz
    Frame rate                  : 41.667 FPS (1152 SPF)
    Compression mode            : Lossy
    Stream size                 : 421 KiB (19%)
    
    Menu
    ID                          : 4096 (0x1000)
    Menu ID                     : 1 (0x1)
    Duration                    : 13 s 440 ms
    List                        : 256 (0x100) (AVC) / 257 (0x101) (MPEG Audio)
    Service name                : Service01
    Service provider            : FFmpeg
    Service type                : digital television
    I want to remove the "Encoding settings" and "Writing library" fields from the MediaInfo report, this is what the 'filter_units' bitstream filter does and it works, but I found it removes these 2 fields as well and I want to keep them:

    Scan type, store method : Interleaved fields
    Scan order : Top Field First

    Any way how to do it ?
    Quote Quote  
  2. You could always edit the data with a hex editor.

    this is what the 'filter_units' bitstream filter does and it works, but I found it removes these 2 fields as well and I want to keep them
    Filter units does allow to drop or keep specific NAL units, assuming you understand what that means, have you tried adjusting the list of units to keep/drop?
    There is a list of the NAL units in H.264 over at https://yumichan.net/video-processing/video-compression/introduction-to-h264-nal-unit/ (under 'More about NAL Unit Type') which might help in case you don't know what NAL unit contains what.
    Assuming the info you want to keep and you want to remove are not in the same NAL unit types, adjusting your filter_units should help.


    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. You could always edit the data with a hex editor.
    I prefer a more scriptable solution, editing files one by one will be overkill plus its a bit beyond my knowledge.

    Assuming the info you want to keep and you want to remove are not in the same NAL unit types, adjusting your filter_units should help.
    It seems they are in in the same NAL unit type, I tried everything else from this list that looks appropriate to me e.g. -bsf:v "filter_units=remove_types=0|16-18|22-31".
    Quote Quote  
  4. -> If they are not in separate NAL unit types you can't remove that info with ffmpeg.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  



Similar Threads