VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Page 2 of 6
FirstFirst 1 2 3 4 ... LastLast
Results 31 to 60 of 156
Thread
  1. Oh, be careful with that script. You might end up in an endless loop since it creates new MKV files and those new MKV files might be picked up by the loop. Put the results in another folder. Or save them as MP4 instead of MKV.
    Quote Quote  
  2. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    What's the "^" for at the end of each AviSynth command? Some kind of escape, or what?

    And seriously, what is "%%F"? In the sense of, what are alternatives, what's the syntax, etc?
    Quote Quote  
  3. Originally Posted by koberulz View Post
    Is there an explanation of how all that works? I've been given batch scripts on here before but it's always just a copy-and-past-this-exact-code thing, and googling "%%F" and the like...doesn't return hugely helpful results.
    There are hundreds of places on the Internet which provide excellent tutorials on Windows/DOS batch scripting. You can start with the Wiki:

    Windows Batch Scripting
    Quote Quote  
  4. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    Originally Posted by jagabo View Post
    > creates the file and puts the text in it
    >> appends the text to the existing file

    Remove the "del script.avs" line to see the resulting AVS file -- for debugging your batch file.

    Here's an more relevant example I came up with since then:

    Code:
    for %%F in (*.mkv) do (
    echo LWLibavVideoSource("%%F"^) >script.avs
    echo AssumeFPS(24000, 1001, sync_audio=true^) >>script.avs
    echo ResampleAudio(48000^) >>script.avs
    ffmpeg -i script.avs "%%F.new.mkv"
    del "%%F.lwi"
    del script.avs
    )
    
    pause

    I'm not sure how well LWlibavVideoSource() works with MPEG 2 in MKV. I usually demux to an mpg/m2v file and use DgIndex/Mpeg2Source() when dealing with MPEG 2 video.
    Am I misunderstanding how LwLib works, or does this not load the audio at all?
    Quote Quote  
  5. Oh sorry, you'll need to load the audio too:

    Code:
    a = LWlibavAudioSource("filename.ext")
    v = LWlibavVideoSource("filename.ext")
    AudioDub(v,a)
    Code:
    for %%F in (*.mkv) do (
    echo a=LWLibavAudioSource("%%F"^) >script.avs
    echo v=LWLibavVideoSource("%%F"^) >>script.avs
    echo AudioDub(v,a^) >>script.avs
    echo AssumeFPS(24000, 1001, sync_audio=true^) >>script.avs
    echo ResampleAudio(48000^) >>script.avs
    ffmpeg -i script.avs "%%F.new.mkv"
    del "%%F.lwi"
    del script.avs
    )
    
    pause
    Quote Quote  
  6. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    It doesn't work, I just get an "unknown error" with the script. It opens fine in VDub and I can scrub through it, but if I try to actually play it VDub just locks up.

    There doesn't seem to be any LWI files, even after removing the line saying to delete them.
    Quote Quote  
  7. I get LWI files and an output video. But I only have a small file with MPEG2 in MKV (and it's NTSC). Can you provide a smallish file that shows the problem you're having?

    And BTW, you'll have to resize the video or encode with aspect ratio flags. For the latter add "-aspect 4:3" (or 16:0) after importing the script:

    Code:
    ffmpeg -i script.avs -aspect 4:3 "%%F.new.mp4"
    Quote Quote  
  8. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    Here's my batch script:
    Code:
    for %%F in (*.mkv) do (
    echo A = LWLibAvVideoSource("%%F"^) > script.avs
    echo B = LWLibAvAudioSource("%%F"^) >> script.avs
    echo AudioDub(A,B^) >> script.avs
    echo AssumeFPS(24000,1001,sync_audio=true^) >> script.avs
    echo ResampleAudio(48000^) >> script.avs
    ffmpeg -i script.avs -aspect 16:9 -acodec ac3 -vcodec x264 -preset 
    
    slow -qp 20 "Output\%%F.mkv"
    )
    
    pause
    Sample file attached.
    Image Attached Files
    Quote Quote  
  9. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    I am also curious to see a sample if only to glean if all the work this entails is really worth the effort. Of course I am partially deaf (one ear is totally dead) but I still, as already stated, do not have issues with speed-up.
    Quote Quote  
  10. Originally Posted by koberulz View Post
    Here's my batch script:
    Code:
    for %%F in (*.mkv) do (
    echo A = LWLibAvVideoSource("%%F"^) > script.avs
    echo B = LWLibAvAudioSource("%%F"^) >> script.avs
    echo AudioDub(A,B^) >> script.avs
    echo AssumeFPS(24000,1001,sync_audio=true^) >> script.avs
    echo ResampleAudio(48000^) >> script.avs
    ffmpeg -i script.avs -aspect 16:9 -acodec ac3 -vcodec x264 -preset 
    
    slow -qp 20 "Output\%%F.mkv"
    )
    
    pause
    Sample file attached.
    Maybe the forum software screwed up the batch file but the "slow.." line should be on the same line as the "ffmpeg" line:

    Code:
    for %%F in (*.mkv) do (
    echo A = LWLibAvVideoSource("%%F"^) > script.avs
    echo B = LWLibAvAudioSource("%%F"^) >> script.avs
    echo AudioDub(A,B^) >> script.avs
    echo AssumeFPS(24000,1001,sync_audio=true^) >> script.avs
    echo ResampleAudio(48000^) >> script.avs
    ffmpeg -i script.avs -aspect 16:9 -acodec ac3 -vcodec libx264 -preset slow -qp 20 "Output\%%F.mkv"
    )
    
    pause
    Otherwise, it worked fine for me. It generated this script:

    Code:
    A = LWLibAvVideoSource("sample.mkv") 
    B = LWLibAvAudioSource("sample.mkv") 
    AudioDub(A,B) 
    AssumeFPS(24000,1001,sync_audio=true) 
    ResampleAudio(48000)
    an LWI index file, and resulted in the attached video (in the Output folder).
    Image Attached Files
    Quote Quote  
  11. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    Yeah, not sure how that happened, or whether it was the case or not. That's right where the line would wrap anyway given my window size, but it's definitely correct now and I'm still getting the same error.

    Code:
    I:\Plex\TV\Psych\Season 1\Output>for %F in (*.mkv) do (
    echo A = LWLibAvVideoSource("%F")  1>script.avs
     echo B = LWLibAvAudioSource("%F")  1>>script.avs
     echo AudioDub(A,B)  1>>script.avs
     echo AssumeFPS(24000,1001,sync_audio=true)  1>>script.avs
     echo ResampleAudio(48000)  1>>script.avs
     ffmpeg -i script.avs -aspect 16:9 -acodec ac3 -vcodec libx264 -preset slow -qp
    20 "Output\%F.mkv"
    )
    
    I:\Plex\TV\Psych\Season 1\Output>(
    echo A = LWLibAvVideoSource("sample.mkv")  1>script.avs
     echo B = LWLibAvAudioSource("sample.mkv")  1>>script.avs
     echo AudioDub(A,B)  1>>script.avs
     echo AssumeFPS(24000,1001,sync_audio=true)  1>>script.avs
     echo ResampleAudio(48000)  1>>script.avs
     ffmpeg -i script.avs -aspect 16:9 -acodec ac3 -vcodec libx264 -preset slow -qp
    20 "Output\sample.mkv.mkv"
    )
    ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 6.3.0 (GCC)
      configuration: --enable-gpl --enable-version3 --enable-d3d11va --enable-dxva2
    --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontcon
    fig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libb
    luray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --e
    nable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-l
    ibopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libope
    njpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --en
    able-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enabl
    e-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable
    -libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --e
    nable-libzimg --enable-lzma --enable-zlib
      libavutil      55. 34.101 / 55. 34.101
      libavcodec     57. 64.101 / 57. 64.101
      libavformat    57. 56.101 / 57. 56.101
      libavdevice    57.  1.100 / 57.  1.100
      libavfilter     6. 65.100 /  6. 65.100
      libswscale      4.  2.100 /  4.  2.100
      libswresample   2.  3.100 /  2.  3.100
      libpostproc    54.  1.100 / 54.  1.100
    script.avs: Unknown error occurred
    
    I:\Plex\TV\Psych\Season 1\Output>pause
    Press any key to continue . . .
    Quote Quote  
  12. If you're using 64 bit ffmpeg be sure you have 64 bit AviSynth installed (along with LSMASH.dll). If you're using 32 bit ffmpeg be sure you have 32 bit AviSynth installed (and LSMASH).
    Quote Quote  
  13. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Thank you for the sample. But for my purposes a 10 second studio logo hardly fits the bill.


    But, honestly, can you detect issues with your original material ?


    I had a look on Amazon and I saw a few versions of this series for sale. One is an original from Universal. The other is from a secondary source. I also saw an Australian release


    Could not see any entry on IDMB tho.
    Quote Quote  
  14. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    AviSynth and its plug ins are all 32 bit. Not sure about ffmpeg or how to find out?
    Quote Quote  
  15. This particular method deesn't require AviSynth. The conversion can be done entirely with ffmpeg. I believe this will work:

    Code:
    ffmpeg -y -i input.mkv -r ntsc-film -vf setpts=1.04270833*PTS -af atempo=0.95904096 output.mkv
    Quote Quote  
  16. Originally Posted by koberulz View Post
    AviSynth and its plug ins are all 32 bit. Not sure about ffmpeg or how to find out?
    open a console window and type:

    Code:
    ffmpeg -i con output.mkv
    ffmpeg will be waiting for input from the console windows (rather than a video file). Start Task Manager and see if ffmpeg is 32 bit or 64 bit.
    Quote Quote  
  17. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    What am I looking for in task manager that tells me how many bits it is?

    Your non-AviSynth thing runs, although I'm kinda having to trust you on the math.
    Quote Quote  
  18. Originally Posted by koberulz View Post
    What am I looking for in task manager that tells me how many bits it is?
    The method I gave worked in Win10 but not in Win7. In Win10 once the program starts open Task Manager and go to the Processes tab (you might have to press "More Details" at the bottom of the window). In the Apps section open up the Windows Command Processor line. You should see "ffmpeg" or "ffmpeg (32 bit). The former indicates 64 bit, the latter 32 bit.

    Image
    [Attachment 52092 - Click to enlarge]


    In Win7 the command exits with an error right away so there's no time to check Task Manager. In that case you can just start some long encoding, start Task Manager, go to the Processes tab. If you see "ffmpeg" it's 64 bit. If you see "ffmpeg (*32)" it's 32 bit.

    Originally Posted by koberulz View Post
    Your non-AviSynth thing runs, although I'm kinda having to trust you on the math.
    I found how to do the conversion with a web search. But I verified the numbers.

    Code:
    1.04270833 ~= 25/(24000/1001)
    0.95904096 ~= (24000/1001)/25
    And they work in the short test video.
    Quote Quote  
  19. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    Well that's handled season one. Season two claims to be interlaced, 25fps, top field first, and the same two minutes shorter than it should be. But I'm not seeing any combing, so is it perhaps just flagged incorrectly?
    Quote Quote  
  20. If you're not seeing any comb artifacts you can treat the video as progressive. It's very common for progressive PAL video to be encoded interlaced.
    Quote Quote  
  21. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    Cheers.

    And yes, it looks like ffmpeg is 64 bit.
    Quote Quote  
  22. Originally Posted by koberulz View Post
    And yes, it looks like ffmpeg is 64 bit.
    So just get a 32 bit version and use a full path on the command line:

    "C:\Path\To\ffmpeg32\bin\ffmpeg"...
    Quote Quote  
  23. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    And if I wanted to do a film, is it the same process?

    EDIT: I tried downloading a 32-bit ffmpeg, and it throws several errors saying the program couldn't start because of a missing DLL. To wit:

    avresample-3.dll
    avcodec-57.dll
    avutil-55.dll
    avuitl-55.dll

    It still seems to output the MKV file, but it throws that error at the start of each conversion which defeats the whole purpose of batching it in the first place. Plus I don't know if something's going wrong with the output even if it does actually exist.

    EDIT 2: All three of those DLL files are present in my AviSynth plugins folder.

    EDIT 3: Copying them into the 32-bit FFMPEG folder seems to have solved the issue.
    Last edited by koberulz; 21st Feb 2020 at 23:56.
    Quote Quote  
  24. Some versions of ffmpeg have those libraries built into ffmpeg.exe ("static" builds), and some versions keep them as separate libraries ("shared" builds).
    Quote Quote  
  25. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    The same issue occurred with both.

    Would this same script apply to a movie that's been converted to PAL?
    Quote Quote  
  26. That script (and the ffmpeg equivalent) only applies to PAL speedup. Neither will work for field blended PAL/NTSC conversions (the other major type of conversion). With the latter the running time and pitch are not changed. But there are blending artifacts any time there is motion. Removing those requires SRestore(). I don't know if ffmpeg has an equivalent filter.
    Quote Quote  
  27. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    Well yeah, speedup is really all I'm interested in here. I know I have sped-up films - I actually started looking into this after test-running Like Mike and finding the Fox fanfare jarringly fast. Field-blending, meh. It's a DVD, it's not gonna look amazing anyway.
    Quote Quote  
  28. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    My friend. Is it really only the logo/fanfare that you find 'fast' ? That is what you posted in your sample.


    If it is then you are over-reacting (not that I could detect an issue).


    I hate to say this but you are practically saying that this is PAL and is not as it should be (even if for the casual viewer it is quite fine) and you can only really tell of you listened to the original.


    But what ultimately occurs to me is why these were EVER converted to PAL. You must know that any PAL playback device can handle NTSC material. I have seen UK music releases on NTSC so that they are viewable on NTSC devices with no issue for PAL devices.


    And, essentially, many would find field-blending more annoying than speed-up. And what if you had a mixed source ? You 'determined' that such a sample also plays 'slower' when actually it should not.


    But it's your baby. By all means spend the time on converting. You have already watched these. How many times will you watch them again ?


    What I am really saying is that EVERY film released on PAL dvd has speed-up. Can you honestly say that all your PAL dvds do not sound OK ?
    Quote Quote  
  29. Everything I say is false koberulz's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    What I don't understand is why you continue to post in this thread when you've made it quite clear you neither understand nor care about the topic at hand.
    Quote Quote  
  30. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Why ?


    Because you have not proved, to me atleast, why you need to waste your time doing this. But, hey, it's your time to waste.


    But do prove by posting a clip where actual dialogue is so sped-up that this is required. Yet, as I already said, without hearing the original you would not know so you pre-judge.


    I have already posted situation from both PAL and NTSC versions of the same film where I can not detect an issue. But then an NTSC version from a PAL source would not have such issue when properly prepared.
    Quote Quote  



Similar Threads