VideoHelp Forum




+ Reply to Thread
Page 4 of 5
FirstFirst ... 2 3 4 5 LastLast
Results 91 to 120 of 121
  1. Originally Posted by smrpix View Post
    Like this?
    This is 24.0FPS (not 23.976), and missing the last frame
    Quote Quote  
  2. Do you remember the decoding problem with ffmpeg? The low delay flush error? Since it cannot decode it properly, re-encoding with it won't work unless you decode it properly with something else first

    Since you're re-encoding you can use avisynth for the video

    e.g
    Code:
    FFVideoSource("test.mkv")
    AssumeFPS(24000,1001)

    You can use ffmpeg to encode the video, and copy the audio
    Code:
    ffmpeg -i input.avs -i test.mkv -map 0:0 -map 1:1 -c:v libx264 -crf 18 -c:a copy re-encode.mp4
    Image Attached Files
    Quote Quote  
  3. Originally Posted by poisondeathray View Post
    Originally Posted by smrpix View Post
    Like this?
    This is 24.0FPS (not 23.976), and missing the last frame
    Simply demuxing the file in post #89 with ffmpeg, no other parameters touched, delivered vbr 24.096 fps. --maybe a clue.
    Quote Quote  
  4. Originally Posted by smrpix View Post
    Originally Posted by poisondeathray View Post
    Originally Posted by smrpix View Post
    Like this?
    This is 24.0FPS (not 23.976), and missing the last frame
    Simply demuxing the file in post #89 with ffmpeg, no other parameters touched, delivered vbr 24.096 fps. --maybe a clue.
    ffmpeg is reading the timecodes incorrectly. It's 23.976 CFR

    These are v2 timecodes (and converted to v1, easier to read)
    Image Attached Files
    Quote Quote  
  5. Originally Posted by poisondeathray View Post
    Originally Posted by smrpix View Post
    Originally Posted by poisondeathray View Post
    Originally Posted by smrpix View Post
    Like this?
    This is 24.0FPS (not 23.976), and missing the last frame
    Simply demuxing the file in post #89 with ffmpeg, no other parameters touched, delivered vbr 24.096 fps. --maybe a clue.
    ffmpeg is reading the timecodes incorrectly. It's 23.976 CFR
    Mediainfo on demuxed file said 24.096, so that's simply incorrect metadata generated by ffmpeg? Interesting.
    Quote Quote  
  6. Originally Posted by smrpix View Post
    Originally Posted by poisondeathray View Post
    Originally Posted by smrpix View Post
    Originally Posted by poisondeathray View Post
    Originally Posted by smrpix View Post
    Like this?
    This is 24.0FPS (not 23.976), and missing the last frame
    Simply demuxing the file in post #89 with ffmpeg, no other parameters touched, delivered vbr 24.096 fps. --maybe a clue.
    ffmpeg is reading the timecodes incorrectly. It's 23.976 CFR
    Mediainfo on demuxed file said 24.096, so that's simply incorrect metadata generated by ffmpeg? Interesting.

    If you extract with mkvextract, mediainfo says 23.976 CFR . So it is a problem with ffmpeg

    Also, there are bunch of error messages when trying to demux with ffmpeg
    Quote Quote  
  7. Originally Posted by smrpix View Post
    Like this?
    Yes, this is what I'd expect. How did you do this? I tried to re-encode with default Handbrake settings, but the output gives me a slight stutter at the very beginning of the video. I attached it as a .zip because it won't let me attach .m4v
    Image Attached Files
    Quote Quote  
  8. Originally Posted by Freodon View Post
    Originally Posted by smrpix View Post
    Like this?
    Yes, this is what I'd expect. How did you do this? I tried to re-encode with default Handbrake settings, but the output gives me a slight stutter at the very beginning of the video. I attached it as a .zip because it won't let me attach .m4v
    Handbrake uses many of the same libraries as ffmpeg

    You're missing 12 frames, encoded VFR, and have the wrong FPS (Same thing happens if you decode/ encode with ffmpeg directly)

    Code:
    Frame rate mode                          : Variable
    Frame rate                               : 22.567 fps
    Minimum frame rate                       : 2.000 fps
    Maximum frame rate                       : 24.390 fps
    Quote Quote  
  9. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    FFMPEG, MKVToolNix and AVIDemux all seemed to have decided some of the early P frames are in fact B frames (unless you play it backwards for some reason) which is what seems to be causing the problems. FFVideoSource didn't seem to have that problem so should work fine.

    (...seemingly...)
    Quote Quote  
  10. I can't seem to find FFVideoSource download, I only found FFmpegSource, but I can't find a GUI for it.
    Quote Quote  
  11. Originally Posted by poisondeathray View Post
    Hey, sorry for being such a noob, but I have no idea how to use a .dll file, nor that .exe which closes immediately after I launch it. Is it supposed to be part of a larger program?
    Quote Quote  
  12. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Quote Quote  
  13. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Originally Posted by Freodon View Post
    Originally Posted by poisondeathray View Post
    Hey, sorry for being such a noob, but I have no idea how to use a .dll file, nor that .exe which closes immediately after I launch it. Is it supposed to be part of a larger program?
    I run into troublesome critter videos like this now and then, but probably not as screwed up. Sometimes ffms2 decodes them correctly, so I guess poisondeathray's advice is correct. Getting FFMS2 into a script is a little tricky. To use FFMS2 to open a video, with audio and video joined in the output file:

    The FFMS2 7z file in the link unzips into a ffms2-2.20-id subfolder. Inside that subfolder find another subfolder named ffms2-2.20-icl. Inside that second subfolder is a file named FFMS2.avsi. This is one of two FFMS2 avisynth plugins you will need. Copy ffms2.avsi into your Avisynth plugins folder. An .avsi plugin will load automatically when your Avisynth script looks for it.

    Inside the ffms2-2.20-icl are other subfolders. One of them is the "x86" subfolder with 32-bit versions of files. One of those files is named ffms2.dll. The .dll is the second Avisynth plugin. Copy ffms2.dll into your Avisynth plugins folder.

    To open the audio and video of the movie use the code below. Be sure to change the text of "path" to the full pathname of your plugins folder or to the path of your video, whichever applies:

    Code:
    LoadCPlugin("path to Avisynth plugins\ffms2.dll")
    # --- NOTE: The ffms2.avsi plugin should load automatically --- #
    aud = ffaudiosource("path to video file\filename")
    vid = ffvideosource("path to video file\filename")
    audiodub(vid,aud)
    # [processing, if any]
    # [processing, if any]
    return last
    Last edited by LMotlow; 8th Dec 2014 at 08:48.
    - My sister Ann's brother
    Quote Quote  
  14. A GUI that uses avisynth, and that can use FFMS2 is MeGUI . But it's probably not the easiest GUI to use either , it's probably the most verbose / comprehensive GUI for x264

    It's critical that you include the AssumeFPS(24000,1001) line in the script editor (as shown in the previous post above), because FFMS2 sometimes gets the frame rate slightly off

    If you're going to be appending segments, make sure you add --stitchable in the extra commandline options

    If you're going to be re-encoding all segments, but cutting parts out, then do all the editing in the script so it's encoded only once, and will cause the least problems
    Quote Quote  
  15. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Originally Posted by poisondeathray View Post
    It's critical that you include the AssumeFPS(24000,1001) line in the script editor (as shown in the previous post above), because FFMS2 sometimes gets the frame rate slightly off
    Oops, yep, I forgot. I use that most of the time myself. You can code AssumeFPS the way poisondeathray wrote it, or there's a preset variable "ntsc_video" which does the same thing to get 23.976fps:

    Code:
    LoadCPlugin("path to Avisynth plugins\ffms2.dll") 
    # --- NOTE: The ffms2.avsi plugin should load automatically --- # 
    aud = ffaudiosource("path to video file\filename") 
    vid = ffvideosource("path to video file\filename") 
    audiodub(vid,aud)
    AssumeFPS("ntsc_video",sync_audio=true)
    # [processing, if any] 
    # [processing, if any] 
    return last
    - My sister Ann's brother
    Quote Quote  
  16. I recently learned the appending feature of mkvmerge GUI, so I can just re-encode 2 times and connect outputs later. But I'm encountering an audio sync problem with Handbrake - it starts too late and finishes later than the video (see attachment).
    Image Attached Files
    Quote Quote  
  17. Even the strange framerate got preserved (23.976 fps) but the audio de-sync is a problem. Can I fix it somehow?
    Quote Quote  
  18. If you're going to be re-encoding it, you might as well do everything (including trimming, appending) with avisynth once, and properly; instead of handbrake a few times (which gave you problems before if you remember), only to have another problem pop up on other segments that you join

    If you're still going to waste time fiddling with this, you can try shifting the audio if it's only a constant sync problem . You can do this with avidemux or mkvtoolnix
    Quote Quote  
  19. AviSynth seems to be good, I learned the basics of scripts, and using Trim() ++ Trim() ++ (...) would be just what I need. There is only one thing I can't find - is it possible to include a cover art when encoding the .mkv as .mp4?
    Last edited by Freodon; 5th Jan 2015 at 08:35.
    Quote Quote  
  20. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by Freodon View Post
    But there is one problem - it opens .avi videos fine, but not .mkv.
    DirectShowSource() --- NOT recommended
    DSS2() --- requires Haali Media Splitter, therefore it suxxx
    DSS2mod() --- does without Haali and can use LAV Filters, therefore it rocks \o/

    Last but not least,
    FFVideoSource() and FFAudioSource() --- provided by the FFMS2 plugin

    Also, I'd like to know if it's possible to include a cover art when encoding the .mkv as .mp4?
    Probably, only if you encode with ffmpeg (or ffmbc). Adding 'cover art' is a job more adequate for the standalone multiplexers, such as L-Smash and MP4Box.
    Quote Quote  
  21. I put ffms2.dll, ffms2.lib and ffmsindex.exe to "plugins" folder in main AviSynith installation folder, then I tried these 4 scripts:
    ffmpegsource("E:\AviSynth 2.5\MeGUI_2507_x86\!scripts\test.mkv")
    ffmpegsource2("E:\AviSynth 2.5\MeGUI_2507_x86\!scripts\test.mkv")
    A = FFAudioSource("E:\AviSynth 2.5\MeGUI_2507_x86\!scripts\test.mkv")
    V = FFVideoSource("E:\AviSynth 2.5\MeGUI_2507_x86\!scripts\test.mkv")
    AudioDub(V, A)
    A = FFAudioSource2("E:\AviSynth 2.5\MeGUI_2507_x86\!scripts\test.mkv")
    V = FFVideoSource2("E:\AviSynth 2.5\MeGUI_2507_x86\!scripts\test.mkv")
    AudioDub(V, A)
    But each time it told me that there is no function named "put the 1st line function name here" (I tried both x86 and x64 plugin versions). It seems like it doesn't see the "plugins" folder, did I put it in the right directory?

    @EDIT
    I just discovered a plugins folder at "E:\AviSynth 2.5\MeGUI_2507_x86\tools\avs\plugins" but it doesn't work either...
    I downloaded AviSynth from the direct link that comes from the auto-generated URLs
    Last edited by Freodon; 7th Jan 2015 at 07:11.
    Quote Quote  
  22. https://github.com/FFMS/ffms2/releases

    Download ffms2, unzip, put ffms2.dll and ffms2.avsi in the plugins directory

    Script 3 should work

    If it still doesn't work use LoadPlugin("PATH\ffms2.dll") . This is the vanilla version. If you are using avisynth 2.6, you need to use the CPlugin versions and use LoadCPlugin
    Quote Quote  
  23. Oh, this was that .avsi file that I didn't copy into the plugins folder... this script worked fine:

    LoadPlugin("E:\AviSynth 2.5\plugins\ffms2.dll")
    A = FFAudioSource("E:\AviSynth 2.5\scripts\test.mkv")
    V = FFVideoSource("E:\AviSynth 2.5\scripts\test.mkv")
    AudioDub(V, A)

    Thanks for the help!
    Just trimmed a video and it all looks fine, both video and audio. I hope this will be the final solution to my problem.
    Last edited by Freodon; 7th Jan 2015 at 15:05.
    Quote Quote  
  24. Don't forget to use AssumeFPS(24000,1001) (I'm assuming all your videos are 23.976.. like the sample), because ffms2 get the FPS "off" a bit sometimes
    Quote Quote  
  25. Does it matter in which order I put the commands? Is this script good:

    LoadPlugin("E:\AviSynth 2.5\plugins\ffms2.dll")
    A = FFAudioSource("E:\AviSynth 2.5\scripts\test.mkv")
    V = FFVideoSource("E:\AviSynth 2.5\scripts\test.mkv")
    AudioDub(V, A)
    AssumeFPS(24000,1001)
    Trim(95, 300) ++ Trim(1400, 1500)
    Quote Quote  
  26. Yes, but I would be careful about using Trim and implicit "last". I would use named variables so there is no misunderstanding what the Trim refers to (do those number refer to the original numbering?) When you get to more complex scripts it can cause problems with mixups if you lose track of "last" .

    Code:
    LoadPlugin("E:\AviSynth 2.5\plugins\ffms2.dll")
    A = FFAudioSource("E:\AviSynth 2.5\scripts\test.mkv")
    V = FFVideoSource("E:\AviSynth 2.5\scripts\test.mkv")
    AudioDub(V, A)
    AssumeFPS(24000,1001)
    orig=last
    
    orig.Trim(95, 300) ++ orig.Trim(1400, 1500)
    Quote Quote  
  27. One thing bugs me: AviSynth changed my AAC audio track to AC3/EAC3, so I lost stereo?
    Quote Quote  
  28. Originally Posted by Freodon View Post
    One thing bugs me: AviSynth changed my AAC audio track to AC3/EAC3, so I lost stereo?
    It's just a frameserver for audio & video. So whatever you used to encode changed it. This has been mentioned many times already, but when using avisynth you have to re-encode, because it frameserves uncompressed audio & video.

    You can add info() at the end of the script, open in vdub or avspmod to see the # audio channels loaded in your script (comment it out or erase it before encoding) . Sometimes some source filters might load the wrong audio or channels
    Quote Quote  



Similar Threads

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