VideoHelp Forum

+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Searching everywhere i can think of i can not find an answer. What i would like to do is use yhe output of an ffmpeg script as an input in avisynth.

    A pseudo example would be
    Av=directshowsource(ffmpeg -i file.mp4 -c copy out.mp4)
    More sbisunyh lines.

    I dont know if this is possible but if anyone lnows a way, i would appreciate knowing how.
    Thanks
    Quote Quote  
  2. It's possible with vapoursynth using vsrawsource , because raws.Source accepts input "-" pipe

    I can't get the same thing to work with avisynth 's rawsource or rawsourceplus directly , it has some issue with pipe in. I think should work similary if the plugin is modified

    You can get it to work if you bridge ffmpeg to avisynth with vapoursynth , using VSImport() or VSEval(). It's essentially running vapoursynth in avisynth ; and requires full vapoursynth (not just loading a single vapoursynth .dll)

    Let me know if you want more details
    Quote Quote  
  3. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    What kind of filters do you need to apply in the ffmpeg command line, which are not available in AviSynth? Would it not be possible to just use an ffmpeg related source filter (FFMS2 / L-SMASH Works) to load the original media file and then emulate all the rest in the AviSynth script?
    Quote Quote  
  4. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    @poisondeathray, I am not familiar with vaporsynth but I will definitely check it out as a p;ossible subtitutes in some applications
    @LigH.de LigH.de, I can of course use avisynth for almos everything but I find it easier in some functions to use FFMPEG.

    Let me explain... I have written (work in progress) for a frame accurate cut and merge progream that recodes only what it needs. The also does most everything I need or could want for that matter. The problem is making all functions work as one script, I find it is much better if I create a video file and run it through avisynth for some functions such as stack, zoom, stretch a resolution (e.g. Crop and rescale to original size) as well as others. It would be nice if it is possible to edit the video and send it directly to Avisynth instead of creating an intermediate video file.

    It's not a big effort to create the video and then create the final from it with avisynth. Just thought it would cut my code and work area down. Right now everything works as planned except free rotate and zoom.

    For instance... I have a video that has 2 segments, the first which has been squashed vertically. I cut the frst segment losslessly and send it to the editing portion where it crops, stretches ,adjusts brightness, contrast, adds subs, and scrolling text and more, it works. If I add free rotate avs script to the ffmpeg, it causes errors such as parsing not seen by either sscript by itself. I just thought I might have better results if I used:
    av=somesourcedecoder(ffmpeg script)
    Image
    [Attachment 63016 - Click to enlarge]


    Image
    [Attachment 63017 - Click to enlarge]

    insteads of

    ffmpeg -i file.avs.
    Quote Quote  
  5. So are you applying some filters in ffmpeg and avs ? Or is ffmpeg only used for the cut/merge ?

    Which rotate filter version are you using ? And how are you doing the zoom ?

    Exactly what are the parsing errors ? What is the error message ?


    Unlikely that ffmpeg pipe into avs would help - if anything it would likely cause more problems, especially if you have any non linear access, temporal filters or seeking in the recieving avs or vpy script
    Quote Quote  
  6. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    So are you applying some filters in ffmpeg and avs ? Or is ffmpeg only used for the cut/merge ?

    Most everything is done in ffmpeg, cutting as well as editing. Some functions like zoom is easier with avisynth zoom filter rather than ffmpeg panandzoom.


    Which rotate filter version are you using ? And how are you doing the zoom ?

    Rotation is done with ffmpeg flip,transpose and rotation filters


    Exactly what are the parsing errors ? What is the error message

    Parsing errors are to numerous to list but i can handle them. If it would cause possible problems within avisynth, it looks like it will be better to actually produce the intermediate video to use as a source for avisynth. I just wondered, since using avisynth script as ffmpeg source, it might be possible and easier to do the opposite.

    Please excuse errors and oddities in this reply. I am on my cell phone, have large fingers and a bandaid as well.
    Quote Quote  
  7. If I add free rotate avs script to the ffmpeg, it causes errors such as parsing not seen by either sscript by itself.
    What I mean is you already have errors . It is not clear what kind - "parsing" is a vague description.

    Adding another operation such as piping on top of your existing errors is not a good idea. I would address your original errors first

    If you had no errors, then it works perfectly fine to avoid a "physical" intermediate with ffmpeg pipe into VSEval in avisynth (but it would be nice to do it directly without vapoursynth , if you wanted to use avisynth only ) .

    Or for another reason to pipe - maybe some specific filter is causing whatever error. eg. There are memory leaks in some ffmpeg filters. Maybe you can do equivalent operation in avisynth or vapoursynth (and specific .dll's can have certain issues too, maybe do equivalent operation in ffmpeg instead)
    Quote Quote  
  8. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    I believe a quite similar tool (using ffmpeg for most filtering if AviSynth is not available) is Hybrid by Selur. But I see no reason to insist in scripting ffmpeg when AviSynth or VapourSynth are available as much more versatile solutions.

    AviSynth is a frameserver. It will decode every input to an uncompressed format. Creating a compressed (and probably lossy) intermediate file before feeding video directly into AviSynth doesn't make much sense to me. Regarding frame-accurate cuts, I would trust AviSynth a lot more than ffmpeg, because ffmpeg might rely on GOP structures present in the original file, whereas AviSynth always decodes, hence has only keyframes and can trim at every frame anyway.
    Quote Quote  
  9. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    After receiving all the great help here, it appears my inquiry was not feasible or practical. I will definitely check out all suggestions and want to thank everyone for their help. Thank you
    Quote Quote  
  10. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    But I see no reason to insist in scripting ffmpeg when AviSynth or VapourSynth are available as much more versatile solutions.

    Tried to convert to avisynth but the only image from a particular frame with timestamp embedded alway shows 0.000000 which seems to be peculiar to imagewriter. Anyone know a better method to use from avisynth?
    Quote Quote  
  11. Originally Posted by Budman1 View Post

    Tried to convert to avisynth but the only image from a particular frame with timestamp embedded alway shows 0.000000 which seems to be peculiar to imagewriter. Anyone know a better method to use from avisynth?
    Need more info. My impression is you're coding a "smart editor" that only re-encodes affected segments.

    Where /when/what process is the timestamp being embedded?

    Why are you using imagewriter ? ffmpeg is usually compiled with .avs support (frameserving or pipe "out" of .avs is not an issue; pipe "in" is the issue)
    Quote Quote  
  12. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Now I'm confused... or someone is. If you read my last post it was suggested to me to use avisynth instead of ffmpeg. As far as i can determine, imagewriter is the only way to create an image from a video ? Now it is suggested to use ffmpeg since it has avs support?? Hmmmmm
    Quote Quote  
  13. Originally Posted by Budman1 View Post
    Now I'm confused... or someone is. If you read my last post it was suggested to me to use avisynth instead of ffmpeg. As far as i can determine, imagewriter is the only way to create an image from a video ? Now it is suggested to use ffmpeg since it has avs support?? Hmmmmm

    LigH is suggesting avisynth for the scripting and filters - the transforms like rotate, color correction etc...

    You're making a "smart rendering" editor that only re-encodes specific sections, correct?

    Avisynth frameserves uncompressed video. You can't "stream copy" with avisynth keeping the original compression (unless the original input formats were uncompressed). You have to use some other tools to cut and assemble the parts. I'm assuming you're using ffmpeg for part of that

    Imagewriter is for writing image sequences - such as TIFF, PNG, BMP, etc... I don't see the reason for using image sequences. If you were using intermediates somewhere, you could use video intermediates , lossless compression e.g. FFV1, lagarith, ut video etc... You don't have to use intermediates at all on the avisynth export side. FFmpeg supports avisynth import


    If I add free rotate avs script to the ffmpeg, it causes errors such as parsing not seen by either sscript by itself.
    If everything works as-is , then just address that problem. There are other rotate filters

    Or are there other issues ? "errors such as parsing" is vague...
    Quote Quote  
  14. Instead of intermediate files loaded to avisynth, why don't you just load frame interval data into avisynth that you need to work with. In and out frames. Within avisynth script you always load the whole videofile, but you re-work some segments only, export them into ffmpeg and encode them to concatenate them later?
    Quote Quote  



Similar Threads