Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
12th September 2015, 21:33 | #1 | Link |
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
Freaky question of the decade: frame-serving from ffmpeg to Avisynth
Is there a way of frame-serving ffmpeg output to Avisynth?
I foresee doing some processing in ffmpeg, and then continuing in Avisynth. This project is huge and where possible I'd like to avoid intermediate files. Is Avisynth's TCPSource() compatible with any of the ffmpeg output protocols, and if so, in this case what ffmpeg command line would be needed for that protocol, especially '-f format'? Thanks, François |
13th September 2015, 12:29 | #2 | Link | ||
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
After a few tries, I got ffmpeg to stream to VLC Player:
Quote:
But TCPSource... Quote:
(EDIT I just realized compression here refers to over-the-network compression, not video compression.) Checking the source code, I have to conclude that TCPSource is designed to work with TCPServer only - they are a matched pair. Code:
SendRequest(CLIENT_CHECK_VERSION, &ccv, sizeof(ccv)); GetReply(); if (reply->last_reply_type != REQUEST_CONNECTIONACCEPTED) { env->ThrowError("TCPSource: Version Check failed! (Ensure Client and Server are same version)"); } Now I'm wondering if it's a Windows 8.1 compatibility issue. EDIT about that...scroll down to post #19. ...If you want to do ffmpeg processing of some kind (what does it do that Avisynth filters can't?) with frameserving, you need some kind of ^DirectShow wrapper for ffmpeg.^ Fortunately a very good one exists, namely, ffdshow tryouts. Last edited by raffriff42; 8th January 2016 at 02:55. Reason: post 19 |
||
13th September 2015, 18:16 | #3 | Link | ||||
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
Thanks for your trouble, much appreciated.
Quote:
Regrettably TCPSource()'s success did not extend to working with this particular ffmpeg command. I got the default unacceptable response: Quote:
Quote:
Quote:
In any event, I'm looking into ffdshow-tryouts also for its FFV1 support. |
||||
13th September 2015, 19:13 | #4 | Link | |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
Quote:
(source) >> Vdub >> "ffvdub" plugin >> Vdub >> frameserve...but it's easier to access ffdshow's decoders and effects in one step: (source) >> DirectShowSource calling ffdshow >> Avisynth >> frameserveYou just need to enable the appropriate decoders in ffdshow options. If you have problems with this ("DirectShow video decoders are not required to support frame-accurate seeking"), you can fall back to the VirtualDub method. EDIT I was thinking in terms of video effects filters. I wasn't thinking of audio processing at all, so this might not help you. Last edited by raffriff42; 13th September 2015 at 19:20. |
|
14th September 2015, 12:30 | #5 | Link |
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
Thanks for explaining that. I was hoping that I could frame-serve to Avisynth from ffmpeg instead, because the latter can concatenate directly from non-AVI files without requiring intermediate conversion (and storage). However, reality seems to dictate otherwise...
|
15th September 2015, 13:18 | #6 | Link | ||
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
Quote:
Then came the issue of which format to specify for that protocol. ffmpeg reports Avisynth's input format as 'avisynth', which the former does not support as an output format. I tried a couple of likely-looking candidates, mostly the 'raw' ones. With some, e.g. 'rawvideo' or 'dnxhd': Code:
ffmpeg -y -i 00000.MTS -c:v rawvideo -c:a pcm_s16le -f dnxhd tcp://127.0.0.1:22050?listen Quote:
If only I had the time, I would get into coding and adapt TCPSource() to FFTCPSource() (or whichever ffmpeg protocol most suitable in terms of seeking etc.)... |
||
15th September 2015, 14:06 | #8 | Link |
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
Nothing exciting to note. Without audio, Avisynth seems to exit with the "TCPSource: Version Check failed! (Ensure Client and Server are same version)" message more often instead of crashing, compared to before. And for what it's worth, with two protocols Avisynth exited with the error message without aborting, AND the ffmpeg server continued running now. The protocols are 'mpegts' and 'rtsp'. With audio the ffmpeg server would exit with an error condition each time.
|
15th September 2015, 14:34 | #9 | Link | |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
I've been Googling for alternatives and gotten nowhere...
Quote:
|
|
15th September 2015, 15:15 | #10 | Link | |
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
Quote:
Thanks for your trouble, much appreciated. |
|
15th September 2015, 17:55 | #12 | Link |
Registered User
Join Date: Dec 2007
Location: Enschede, NL
Posts: 301
|
It would require some footwork, but you might try this: http://forum.doom9.org/showthread.php?t=170590
__________________
Roelofs Coaching |
15th September 2015, 20:01 | #13 | Link | |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
|
|
16th September 2015, 10:07 | #15 | Link | |
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
Quote:
|
|
16th September 2015, 10:51 | #16 | Link | |
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
Quote:
However, following an analysis of M2TS and FFV1 support in the tools concerned it appears that that approach has issues of its own which require work-arounds that at least cancel the benefits. Therefore, for this project I'll stick with Lagarith intermediate AVIs and concatenating those in VirtualDub. What I found when looking into M2TS and FFV1 support:
|
|
16th September 2015, 14:14 | #17 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
If these are camcorder files, you run a higher risk of "glitches" , or sometimes AV sync , or crackle issues at the seams when appending individual file spanned clips when using avisynth, or ffmpeg or tsmuxer. The most reliable way is to copy the entire folder structure over, because there is accessory meta data that some programs use to seamlessly join the the clips. Usually the camera comes with crappy (but reliable) software to do this, or look at the manufacturer website. Most decent NLE's also do it that way with the entire folder structure - but they decode the files , not concatenate or stream copy UT Video and x264 are other possibilities for lossless intermediates, that are also available in ffmpeg. You can adjust x264 parameters so it's has temporal compression like ffv1; you can tweak the parameters so it can decode faster or slower; higher or lower compression. UT usually is less compressed than lagarith, but decodes much faster. So if editing speed is a concern, it's probably the better choice. UT is also very compatible in NLE, x264 lossless isn't Be aware Lagarith can have it's own issues for some people with random corrupt frames. A few threads discuss this at doom9. I've never personally had it happen to me |
|
16th September 2015, 20:05 | #18 | Link |
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
Thanks for that advice. Fortunately the clips as input to this workflow have already been joined by the camera's export software .
As potential back-ups should I run into issues with Lagarith (which I've been using for a long time) I've been keeping UT Video and H.264 in mind; I appreciate your inputs on those too. |
20th September 2015, 19:10 | #19 | Link | |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
Code:
TCPSource("127.0.0.1", port=2000, compression="none") Last edited by Wilbert; 20th September 2015 at 19:24. |
|
|
|