VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    The problem I am having is encoding one video to match another. The original video has 5 ref frames and I thought since the encoded video had 3 ref frames, that was the source of my problem. I am able to generate a video with 5 ref frames by using preset slow but still cannot join the encoded video to the original video. I have even tried duplicating all the settings listed in media info for the original video, but sadly they still do not join without problems during playback.

    Further information is if I join Original --> Encoded the encoded one plays much faster. If i join Encoded --> original the original plays in super slow motion.

    If anyone knows how to duplicate enough x264 settings or at least encode a video that will join to an existing one, I could really use this information.

    Media infor on original video (UNencoded)
    General
    Complete name : D:\Replay Media Catcher\Video1.mp4
    Format : MPEG-4
    Format profile : Base Media
    Codec ID : isom (isom/iso2/avc1/mp41)
    File size : 39.9 MiB
    Duration : 11 min 42 s
    Overall bit rate mode : Variable
    Overall bit rate : 477 kb/s
    Movie name :Something
    Writing application : Lavf57.48.100
    Comment : Recorded and Tagged by Replay Media Catcher 7 (www.applian.com)

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L3
    Format settings : CABAC / 5 Ref Frames
    Format settings, CABAC : Yes
    Format settings, Reference frames : 5 frames
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 11 min 42 s
    Bit rate : 342 kb/s
    Width : 640 pixels
    Height : 480 pixels
    Display aspect ratio : 4:3
    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.045
    Stream size : 28.6 MiB (72%)
    Writing library : x264 core 155
    Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / 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=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=90 / keyint_min=46 / scenecut=0 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=2000 / vbv_bufsize=80 / crf_max=25.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
    Codec configuration box : avcC

    Audio
    ID : 2
    Format : AAC LC
    Format/Info : Advanced Audio Codec Low Complexity
    Codec ID : mp4a-40-2
    Duration : 11 min 42 s
    Bit rate mode : Variable
    Bit rate : 128 kb/s
    Maximum bit rate : 143 kb/s
    Channel(s) : 2 channels
    Channel layout : L R
    Sampling rate : 44.1 kHz
    Frame rate : 43.066 FPS (1024 SPF)
    Compression mode : Lossy
    Stream size : 10.7 MiB (27%)
    Default : Yes
    Alternate group : 1

    Encoded video
    General
    Complete name : D:\Replay Media Catcher\TVideo2.mp4
    Format : MPEG-4
    Format profile : Base Media
    Codec ID : isom (isom/iso2/avc1/mp41)
    File size : 175 KiB
    Duration : 3 s 716 ms
    Overall bit rate : 386 kb/s
    Movie name omething else
    Writing application : Lavf58.47.100
    Comment : Recorded and Tagged by Replay Media Catcher 7 (www.applian.com)

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L3
    Format settings : CABAC / 5 Ref Frames
    Format settings, CABAC : Yes
    Format settings, Reference frames : 5 frames
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 3 s 240 ms
    Bit rate : 284 kb/s
    Nominal bit rate : 397 kb/s
    Width : 640 pixels
    Height : 480 pixels
    Display aspect ratio : 4:3
    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.037
    Stream size : 112 KiB (64%)
    Writing library : x264 core 160
    Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=15 / 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=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=abr / mbtree=1 / bitrate=397 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    Codec configuration box : avcC

    Audio
    ID : 2
    Format : AAC LC
    Format/Info : Advanced Audio Codec Low Complexity
    Codec ID : mp4a-40-2
    Duration : 3 s 716 ms
    Bit rate mode : Constant
    Bit rate : 129 kb/s
    Channel(s) : 2 channels
    Channel layout : L R
    Sampling rate : 44.1 kHz
    Frame rate : 43.066 FPS (1024 SPF)
    Compression mode : Lossy
    Stream size : 58.4 KiB (33%)
    Default : Yes
    Alternate group : 1

    Thank you
    Quote Quote  
  2. For a test, try to join the video streams only, without audio.
    Quote Quote  
  3. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Tried with just video but got the same results. However, Your suggestion made me go a little deeper trying to remove just the video and found my script was using the Concat Demuxer to join the videos because the information says codecs must be the same. I guess they mean the encoding formats as well since both my videos were X264 codec.

    I tried the Concat Protocol with intermediate ts files and it now seems to join them fine. I'm assuming that since the script contains '-c copy' that no loss is encountered. It appears that now I have 2 methods programmed in, 1 for cutting and joining videos from the same original, and one for joining different videos formats.

    Thank you very much for your suggestion that put me on the right path.
    Quote Quote  
  4. Originally Posted by Budman1 View Post
    I tried the Concat Protocol with intermediate ts files and it now seems to join them fine. I'm assuming that since the script contains '-c copy' that no loss is encountered. It appears that now I have 2 methods programmed in, 1 for cutting and joining videos from the same original, and one for joining different videos formats.
    Basically there are 2 options to append:
    A. Encode to exactly the same settings - which you didn't. E.g. your original uses CRF and your encode does not. This can lead to incompatible SPS/PPS. (In mkv/mp4 we usually only have only 1 pair of SPS/PPS stored at the container level for the whole stream. If this pairs fits only the 1st part of your video then seeking into the 2nd part will break playback because SPS/PPS does not match it.)
    B. Workaround: make sure there is SPS/PPS at every keyframes, i.e. store headers "in-band". This is what ffmpeg did for you when you went the ts route.

    Often A is not easy to achieve e.g. because the original was not encoded with a free encoder.
    Last edited by sneaker; 14th Nov 2020 at 03:13.
    Quote Quote  



Similar Threads

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