+ Reply to Thread
Results 91 to 120 of 121
-
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
-
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 -
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...) -
I can't seem to find FFVideoSource download, I only found FFmpegSource, but I can't find a GUI for it.
-
-
http://avisynth.nl/index.php/FFmpegSource
EDIT: ooops, maybe I should have written http://avisynth.nl/index.php/LoadPlugin -
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 -
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 -
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 -
Even the strange framerate got preserved (23.976 fps) but the audio de-sync is a problem. Can I fix it somehow?
-
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 -
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.
-
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? -
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)
@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 URLsLast edited by Freodon; 7th Jan 2015 at 07:11.
-
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 -
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.
-
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
-
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) -
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)
-
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
Similar Threads
-
[SOLVED] 720p60 video stutters when playing
By white_snake in forum Software PlayingReplies: 31Last Post: 20th Feb 2016, 09:55 -
Trimming subtitles along with video
By msmirjat in forum SubtitleReplies: 2Last Post: 6th Sep 2011, 02:08 -
Video Stutters after windows 7 upgrade
By Habby in forum ComputerReplies: 5Last Post: 10th Mar 2010, 20:56 -
Blu ray conversion to mkv stutters, audio ok but video stutters....
By ajoesmith in forum Blu-ray RippingReplies: 12Last Post: 12th Oct 2009, 00:31 -
Windows Movie Maker. Blank video when splitting, trimming video clips
By rlarden in forum EditingReplies: 2Last Post: 3rd Jul 2009, 06:23