VideoHelp Forum
+ Reply to Thread
Results 1 to 15 of 15
Thread
  1. Trying to render out a DVD compliant video using AVStoDVD. The resulting video is very choppy, and I'm thinking maybe it has something to do with the parameter FPSden. Taking a look at the auto generated AVISynth script, I see this
    Code:
    LoadCPlugin("C:\Program Files (x86)\AVStoDVD\Lib\ffms2.dll")
    
    Audio = FFAudioSource("C:\path\file.mkv", track=-1)
    Video = FFVideoSource("C:\path\file.mkv", track=-1, fpsnum=2997, fpsden=125, colorspace="YV12", seekmode=0)
    
    Video = Video.ConvertToYV12()
    Video = Video.Spline16Resize(720,480)
    #PullDown: using DGPulldown/HCenc to upsize FPS
    
    AudioDub(Video, Audio)
    Now, the source is actually 23.976, and AVStoDVD reports it as "VFR" (even though it is actually CFR).

    What does FPSden do, exactly? What is "den" short for? Lowering the value in AVSPmod seems to fix the choppiness, but changes the speed. Anyone have any ideas?
    Quote Quote  
  2. fpsnum = fps numerator
    fpsden = fps denominator

    Technically "23.976" should be fpsnum=24000 , fpsden=1001 . "23.976" is a 3 decimal approximation
    Quote Quote  
  3. Thanks for the info!! So, how does the whole denominator thing work? What’s the math?
    Quote Quote  
  4. Originally Posted by seanmcnally View Post
    Thanks for the info!! So, how does the whole denominator thing work? What’s the math?
    It's just a fraction

    fps numerator / fps denominator

    24000/1001 =~ 23.976024...


    eg. If you had 25 FPS :

    25/1 = 25


    But you have fpsnum=2997, fpsden=125 . Which is 23.976 exactly. That's usually just an approximation and can cause you to go out of sync. 24000/1001 is the accurate value
    Quote Quote  
  5. Ah, I get it now 29997 / 125 = 23.976, whereas 24000/1001 = 23.97602397602398, a more accurate value. Thanks for the info!

    Unfortunately, it doesn't solve my problem, but perhaps it's a start. Thanks.
    Quote Quote  
  6. Post in the avs2dvd thread for help

    But I'd check file.mkv first to see if it was ok; then ffms2.dll - maybe some problem with that version ; check to see if script output is ok (preview in vdub2, go frame by frame)

    (Technically all "23.976p" MKV's are VFR, because the timebase is 1ms. This is part of the MKV container spec. It might have nothing to do with your choppiness)
    Quote Quote  
  7. Originally Posted by poisondeathray View Post
    Post in the avs2dvd thread for help
    But I'd check file.mkv first to see if it was ok;[...]check to see if script output is ok (preview in vdub2, go frame by frame)
    So, I did this, and it wasn't okay. In fact, even when opening file.mkv directly in Virtualdub 2 with no script or anything, playback is choppy, whereas opening in VLC media player, it's fine. Going frame by frame on both, Vdub2 reveals a lot of repeated frames (and what looks like skipped frames as well), whereas VLC does not. Why is Vdub2 reading the file so differently? Vdub is showing I-frames, B-frames, and + frames...I assume the + means repeated?

    If it helps, here's the MediaInfo output for my file

    Code:
    General
    Unique ID                                : 253814439383215743484232656925853782868 (0xBEF2E2068F63B5E24B18F530767C9354)
    Complete name                            : file.mkv (edited for privacy)
    Format                                   : Matroska
    Format version                           : Version 4
    File size                                : 2.53 GiB
    Duration                                 : 44 min 18 s
    Overall bit rate                         : 8 173 kb/s
    Writing application                      : Lavf58.7.100
    Writing library                          : Lavf58.7.100
    ErrorDetectionType                       : Per level 1
    
    Video
    ID                                       : 1
    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                                 : V_MPEG4/ISO/AVC
    Duration                                 : 44 min 18 s
    Nominal bit rate                         : 8 000 kb/s
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Variable
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Writing library                          : x264 core 164 r3065 ae03d92
    Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-3 / threads=18 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=11 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=480 / keyint_min=3 / scenecut=40 / intra_refresh=0 / rc_lookahead=180 / rc=abr / mbtree=1 / bitrate=8000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=33 / qpstep=4 / ip_ratio=1.40 / aq=2:0.70
    Default                                  : Yes
    Forced                                   : No
    
    Audio
    ID                                       : 2
    Format                                   : AAC LC
    Format/Info                              : Advanced Audio Codec Low Complexity
    Codec ID                                 : A_AAC-2
    Duration                                 : 44 min 18 s
    Channel(s)                               : 2 channels
    Channel layout                           : L R
    Sampling rate                            : 48.0 kHz
    Frame rate                               : 46.875 FPS (1024 SPF)
    Compression mode                         : Lossy
    Default                                  : Yes
    Forced                                   : No
    
    Text #1
    ID                                       : 3
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 42 min 55 s
    Writing library                          : Lavc58.9.100 srt
    Language                                 : English
    Default                                  : No
    Forced                                   : No
    
    Text #2
    ID                                       : 4
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 42 min 55 s
    Title                                    : SDH
    Writing library                          : Lavc58.9.100 srt
    Language                                 : English
    Default                                  : No
    Forced                                   : No
    
    Text #3
    ID                                       : 5
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 44 min 14 s
    Writing library                          : Lavc58.9.100 srt
    Language                                 : Danish
    Default                                  : No
    Forced                                   : No
    
    Text #4
    ID                                       : 6
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 42 min 54 s
    Writing library                          : Lavc58.9.100 srt
    Language                                 : German
    Default                                  : No
    Forced                                   : No
    
    Text #5
    ID                                       : 7
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 42 min 55 s
    Title                                    : Spanish
    Writing library                          : Lavc58.9.100 srt
    Language                                 : Spanish
    Default                                  : No
    Forced                                   : No
    
    Text #6
    ID                                       : 8
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 44 min 14 s
    Title                                    : European
    Writing library                          : Lavc58.9.100 srt
    Language                                 : Spanish
    Default                                  : No
    Forced                                   : No
    
    Text #7
    ID                                       : 9
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 44 min 14 s
    Writing library                          : Lavc58.9.100 srt
    Language                                 : Finnish
    Default                                  : No
    Forced                                   : No
    
    Text #8
    ID                                       : 10
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 44 min 14 s
    Writing library                          : Lavc58.9.100 srt
    Language                                 : French
    Default                                  : No
    Forced                                   : No
    
    Text #9
    ID                                       : 11
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 44 min 14 s
    Writing library                          : Lavc58.9.100 srt
    Language                                 : Italian
    Default                                  : No
    Forced                                   : No
    
    Text #10
    ID                                       : 12
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 44 min 14 s
    Writing library                          : Lavc58.9.100 srt
    Language                                 : Norwegian Bokmal
    Default                                  : No
    Forced                                   : No
    
    Text #11
    ID                                       : 13
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 44 min 14 s
    Writing library                          : Lavc58.9.100 srt
    Language                                 : Dutch
    Default                                  : No
    Forced                                   : No
    
    Text #12
    ID                                       : 14
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 44 min 14 s
    Writing library                          : Lavc58.9.100 srt
    Language                                 : Polish
    Default                                  : No
    Forced                                   : No
    
    Text #13
    ID                                       : 15
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 42 min 54 s
    Writing library                          : Lavc58.9.100 srt
    Language                                 : Portuguese
    Default                                  : No
    Forced                                   : No
    
    Text #14
    ID                                       : 16
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 42 min 55 s
    Writing library                          : Lavc58.9.100 srt
    Language                                 : Russian
    Default                                  : No
    Forced                                   : No
    
    Text #15
    ID                                       : 17
    Format                                   : UTF-8
    Codec ID                                 : S_TEXT/UTF8
    Codec ID/Info                            : UTF-8 Plain Text
    Duration                                 : 44 min 14 s
    Writing library                          : Lavc58.9.100 srt
    Language                                 : Swedish
    Default                                  : No
    Forced                                   : No
    
    Menu
    00:00:00.000                             : :Teaser
    00:04:08.248                             : :Act 1
    00:15:33.182                             : :Act 2
    00:27:28.229                             : :Act 3
    00:35:25.164                             : :Act 4
    Quote Quote  
  8. vdub2 is using an older ffmpeg library version , but it should have no problems with AVC . That ffms2.dll version with avs2dvd might be old too, but it should have no problems with AVC.

    There might be some issues with the timestamps in that MKV causing other problems such as duplicates and skips in vdub2 and that version of ffms2. "normal" VFR jitter from MKV container should not cause that problem you describe

    If you go frame by frame in VLC, are you sure it's ok ? What about other players, MPCHC, or MPV ?


    You can try another source filter, like a modern LSmash version, or DGIndexNV to replace your avs2dvd script . Preview the avs in vdub2 or mpchc. If it's ok there, it will be ok in avs2dvd
    Quote Quote  
  9. Originally Posted by poisondeathray View Post
    If you go frame by frame in VLC, are you sure it's ok ? What about other players, MPCHC, or MPV ?
    Definitely, just double-checked. Works fine in MPCHC as well, even stepping frame by frame.

    This is definitely some sort of muxing issue. My process looks like this:

    Edit in Adobe Premiere > Export to MP4 > Add Subtitles and Chapters with FFmpeg > Copy Stream to MKV

    If I take that original MP4 file and play it in VirtualDub, those (+) frames don't appear, and playback is smooth. Works fine in AVStoDVD as well. But the MKV file at the end of the pipeline (which is what I posted the MediaInfo output for) has these issues. VLC and MPCHC play the MKV just fine, but VDub2 and A2d have issues with it.

    Originally Posted by poisondeathray View Post
    There might be some issues with the timestamps in that MKV causing other problems such as duplicates and skips in vdub2 and that version of ffms2.
    If this is the case, is there a way to fix these timestamps? Thanks!
    Quote Quote  
  10. First, try mkvmerge (mkvtoolnix) instead of the ffmpeg step
    Quote Quote  
  11. I can try that. For reference, this was my FFMpeg script:

    Code:
    ffmpeg.exe -i file.mp4 -f ffmetadata FFMETADATAFILE -loglevel error
    python "prpro_ffmpeg_chap.py" file_chapters.txt
    ffmpeg.exe -i file.mp4 -sn -i FFMETADATAFILE -map_metadata 1 -codec copy "file_chapters.mkv" -loglevel warning -stats
    del FFMETADATAFILE
    del file.mp4
    ffmpeg.exe -i file_chapters.mkv ^
    -i DCTLHD_subs\!episode!_eng.srt -sn ^
    -i DCTLHD_subs\!episode!_eng-sdh.srt ^
    -i DCTLHD_subs\!episode!_dan.srt ^
    -i DCTLHD_subs\!episode!_ger.srt ^
    -i DCTLHD_subs\!episode!_spa-spanish.srt ^
    -i DCTLHD_subs\!episode!_spa-european.srt ^
    -i DCTLHD_subs\!episode!_fin.srt ^
    -i DCTLHD_subs\!episode!_fre.srt ^
    -i DCTLHD_subs\!episode!_ita.srt ^
    -i DCTLHD_subs\!episode!_nob.srt ^
    -i DCTLHD_subs\!episode!_dut.srt ^
    -i DCTLHD_subs\!episode!_pol.srt ^
    -i DCTLHD_subs\!episode!_por.srt ^
    -i DCTLHD_subs\!episode!_rus.srt ^
    -i DCTLHD_subs\!episode!_swe.srt ^
    -map 0:v -map 0:a -map 1 -map 2 -map 3 -map 4 -map 5 -map 6 -map 7 -map 8 -map 9 -map 10 ^
    -map 11 -map 12 -map 13 -map 14 -map 15 ^
    -metadata:s:s:0 language=eng -metadata:s:s:1 language=eng -metadata:s:s:1 title="SDH" ^
    -metadata:s:s:2 language=dan -metadata:s:s:3 language=ger ^
    -metadata:s:s:4 language=spa -metadata:s:s:4 title="Spanish" ^
    -metadata:s:s:5 language=spa -metadata:s:s:5 title="European" ^
    -metadata:s:s:6 language=fin -metadata:s:s:7 language=fre -metadata:s:s:8 language=ita ^
    -metadata:s:s:9 language=nob ^ -metadata:s:s:10 language=dut -metadata:s:s:11 language=pol ^
    -metadata:s:s:12 language=por -metadata:s:s:13 language=rus -metadata:s:s:14 language=swe ^
    -max_interleave_delta 0 -vcodec copy -acodec copy -scodec srt file_chapters_subs.mkv ^
    -loglevel warning -stats
    del file_chapters.mkv
    Quote Quote  
  12. Update: Mission success, taking the MP4 and adding subs and chapters with MKVToolNix works in both VDub2 and AVStoDVD! No more choppiness!

    Also, I know you said it shouldn't matter, but I want to note that the MKV file that MKVToolnix produces is reported as Constant Frame Rate in MediaInfo as well as A2D, whereas the MKV from FFMpeg is reported as Variable Frame Rate.

    So my next question is, is there any way to fix the FFMPeg MKV files, rather than having to start from scratch with the MP4s? I kept 90% of the original MP4s, but unfortunately not all of them, and re-rendering would be a huge pain.
    Quote Quote  
  13. Originally Posted by seanmcnally View Post
    Also, I know you said it shouldn't matter, but I want to note that the MKV file that MKVToolnix produces is reported as Constant Frame Rate in MediaInfo as well as A2D, whereas the MKV from FFMpeg is reported as Variable Frame Rate.
    According to mediainfo; but technically it's still variable if you extract the timestamps

    So my next question is, is there any way to fix the FFMPeg MKV files, rather than having to start from scratch with the MP4s? I kept 90% of the original MP4s, but unfortunately not all of them, and re-rendering would be a huge pain.
    You should be able to just remux them with mkvmerge to "fix" them (and if you needed to, replace the timestamps with CFR ones. It's just a text file, read the section "external timestamp files" in the mkvmerge documentation) . It's really 2 lines. More decimal places or precision doesn't matter, because MKV only has a timebase of 1/1000s anyway

    Code:
    # timestamp format v1
    assume 23.976
    But there might be some other issues with the other files caused by ffmpeg ... You can try a few and see if they work
    Quote Quote  
  14. If there were no other issues introduced by ffmpeg , you could probably use --default-duration 0:24000/1001p in a mkvmerge remux without using external timestamp file . It says in the documentation for default-duration you can

    --default-duration TID
    .
    .

    This option can also be used to change the FPS of video tracks without having to use an external timestamp file.
    Quote Quote  
  15. Originally Posted by poisondeathray View Post
    According to mediainfo; but technically it's still variable if you extract the timestamps
    Yeah, I get that. But the fact that the reporting was different means that *something* was different about the timestamps. I don't know exactly what, but something must have been, or else they would've both been reported as VFR.

    Originally Posted by poisondeathray View Post
    You should be able to just remux them with mkvmerge to "fix" them (and if you needed to, replace the timestamps with CFR ones. It's just a text file, read the section "external timestamp files" in the mkvmerge documentation) . It's really 2 lines. More decimal places or precision doesn't matter, because MKV only has a timebase of 1/1000s anyway

    Code:
    # timestamp format v1
    assume 23.976

    This actually works!
    Thanks so much for the info! For those who find this thread in the future, this text file can be specified in the GUI when you click on the video stream, and find the "Timestamp File" selector on the right hand side. I didn't need to check "Fix bitstream timing info" in my case.

    Originally Posted by poisondeathray View Post
    [...]you could probably use --default-duration 0:24000/1001p in a mkvmerge remux without using external timestamp file
    This works great too from the command line! Here's the code I used:

    Code:
    "C:\Program Files\MKVToolNix\mkvmerge.exe" --output ^"C:\file_fixed.mkv" --language 0:eng --default-track 0:yes --display-dimensions 0:1920x1080 --default-duration 0:24000/1001p --language 1:eng --default-track 1:yes ^"^(^" ^"C:\original_file.mkv^" ^"^)^" --track-order 0:0,0:1
    Thanks once again for all your help And to your point about FFMpeg possibly causing other issues in the MP4 > MKV conversion, I'll keep a lookout, but for now everything seems fine. In the future, I'll definitely opt for MKVToolnix vs FFMpeg.
    Quote Quote  



Similar Threads

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