VideoHelp Forum




+ Reply to Thread
Results 1 to 3 of 3
  1. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Hopefully someone can explain the following results.

    I have a source video.mp4 x264/aac 29.97 fps. Variable Frame rate/ Progressive

    It is variable frame rate so in order to convert to Constant frame rate (this always worked before) I use FFMpeg as follows:
    Code:
    ffmpeg -i source.mp4 -map 0:v -vcodec copy -bsf:v h264_mp4toannexb source-video.h264
    Then combining the source-video.h264 and copying the audio from the original and outputting to MP4 again:
    Code:
    ffmpeg -fflags +genpts -r 29.97 -i "C:\Path\source-video.h264" -i "C:\Path\source.mp4" -map 0:0 -map 1:1 -c:v copy -c:a copy -f mp4 "C:\Path\video_CFR.MP4"

    I seems to play fine and merges with other converted (CFR) segments but the PTS times seem to be messed up on this one. FFprobe outputs:

    No. pts_time type
    0 0.066733 0 B
    1 0.033367 0 B
    2 0.100100 0 B
    3 0.000000 0 P
    4 0.200200 0 B
    5 0.166834 0 B
    6 0.233567 0 B
    7 0.133467 0 P
    8 0.333667 0 B
    9 0.300300 0 B
    10 0.367034 0 B
    11 0.266934 0 P
    12 0.467134 0 B
    13 0.433767 0 B
    14 0.500501 0 B
    15 0.400400 0 P
    16 0.600601 0 B
    17 0.567234 0 B
    18 0.633967 0 B
    19 0.533867 0 P
    20 0.734067 0 B
    Best Effort Timezstamps are:
    0.066733
    0.1001
    0.133467
    0.166834
    0.2002
    0.233567
    0.266934
    0.3003
    0.333667
    0.367034
    0.4004
    0.433767
    0.467134
    0.500501
    0.533867
    0.567234
    0.600601

    If anyone knows how it can play ok but have PTS times that bounce forward and then backward, it would really help.
    Thank You.
    Quote Quote  
  2. If anyone knows how it can play ok but have PTS times that bounce forward and then backward, it would really help.
    Presentation vs decoding time.
    The time when the frame needs to be loaded into memory differs from the time it is represented.
    This is normal when references can be used into both directions of the time line.

    The Decode Time Stamp (DTS) indicates the time at which an access unit should be instantaneously removed from the receiver buffer and decoded. It differs from the Presentation Time Stamp (PTS) only when picture reordering is used for B pictures. If DTS is used, PTS must also be provided in the bit stream.

    PTS (or DTS) is entered in the bitstream at intervals not exceeding 700 mS. ATSC further constrains PTS (or DTS) to be inserted at the beginning of each access unit.
    see: http://dranger.com/ffmpeg/tutorial05.html, DTS - Decode Time Stamp (http://www.bretl.com/mpeghtml/DTS.HTM) and MPEG Timing Model (http://www.bretl.com/mpeghtml/timemdl.HTM)


    Cu Selur

    Ps.: when working with ffmpeg and messing with time stamps you should read up on some of the MPEG basics regarding time stamps to understand what you are doing.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  3. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    @selur. Thank you for that explanation and those links . I had read an thought I understood pts/dts functions but not in the clear manner you gave. I will continue to read and understand more if I get the chance.

    It makes a lot if sense also since the produced video has a LOT of B frames between I frames without P frames.

    Thank you again
    Quote Quote  



Similar Threads

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