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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd March 2012, 22:00   #1501  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,049
Quote:
Originally Posted by horrormaster34 View Post
Is it just me or do none of the FFIndex options work? I've tried to use "source", but it says that it can't open it. If I leave out "source" and call the file then it works. If I use "indexmask=-1" it uses that as the index file name. If I try to set the index file name using "cachefile" it again uses that as the index file name.

ex: ffmsindex64.exe D:\inputfile.mkv cachefile=D:\output.mkv.ffindex

that returns the index file as a literal cachefile=D:\output.mkv.ffindex instead of simply output.mkv.ffindex.

If I try to use any of the other options it just shows a message that it's unrecognized.
Looks like you're using the parameters intended for FFIndex() the avisynth function, not the commandline parameters to ffmsindex.exe. Those aren't in the documentation, by the way, so don't bother looking; just run ffmsindex.exe without any parameters at all and it'll tell you how to use it.

edit: like so:
Code:
C:\> ffmsindex
FFmpegSource2 indexing app
Usage: ffmsindex [options] inputfile [outputfile]
If no output filename is specified, inputfile.ffindex will be used.

Options:
-f        Force overwriting of existing index file, if any (default: no)
-v        Set FFmpeg verbosity level. Can be repeated for more verbosity. (default: no messages printed)
-p        Disable progress reporting. (default: progress reporting on)
-c        Write timecodes for all video tracks to outputfile_track00.tc.txt (default: no)
-k        Write keyframes for all video tracks to outputfile_track00.kf.txt (default: no)
-t N      Set the audio indexing mask to N (-1 means index all tracks, 0 means index none, default: 0)
-d N      Set the audio decoding mask to N (mask syntax same as -t, default: 0)
-a NAME   Set the audio output base filename to NAME (default: input filename)
-s N      Set audio decoding error handling. See the documentation for details. (default: 0)
-m NAME   Force the use of demuxer NAME (default, lavf, matroska, haalimpeg, haaliogg)
TheFluff is offline   Reply With Quote
Old 3rd March 2012, 22:24   #1502  |  Link
horrormaster34
Registered User
 
Join Date: May 2009
Posts: 32
Wow, don't I feel stupid. Thanks for that TheFluff
horrormaster34 is offline   Reply With Quote
Old 4th March 2012, 12:08   #1503  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,660
btw. would be nice to have something like -kc which would output the keyframe and the time belonging to it to an output file,..
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 4th March 2012, 12:14   #1504  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 6,630
Quote:
Originally Posted by Selur View Post
btw. would be nice to have something like -kc which would output the keyframe and the time belonging to it to an output file,..
key_frame_number/fps
Atak_Snajpera is offline   Reply With Quote
Old 4th March 2012, 16:58   #1505  |  Link
kemuri-_9
Compiling Encoder
 
kemuri-_9's Avatar
 
Join Date: Jan 2007
Posts: 1,348
Quote:
Originally Posted by Atak_Snajpera View Post
key_frame_number/fps
that isn't guaranteed to work when the content is VFR.
__________________
custom x264 builds & patches | F@H | My Specs
kemuri-_9 is offline   Reply With Quote
Old 4th March 2012, 19:47   #1506  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,049
Quote:
Originally Posted by Selur View Post
btw. would be nice to have something like -kc which would output the keyframe and the time belonging to it to an output file,..
You get both the keyframes and the timecodes for all frames, it should be trivial to combine them.
TheFluff is offline   Reply With Quote
Old 5th March 2012, 17:13   #1507  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,660
Can someone explain how to get the time codes (through the API) without having to write a timecode file to hdd (by using FFMS_WriteTimecodes) ?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 5th March 2012, 18:53   #1508  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,049
Assuming the video track has track number 0 (use FFMS_GetFirstIndexedTrackOfType if unsure), that you have indexed the file and have the index object handy (if you have already opened the video, just use FFMS_GetTrackFromVideo instead of FFMS_GetTrackFromIndex):
Code:
FFMS_Track *track = FFMS_GetTrackFromIndex(index, 0);
const FFMS_TrackTimeBase *timebase = FFMS_GetTimeBase(track);
const FFMS_FrameInfo *current_frame;
std::vector<int> timecodes;
int num_frames = FFMS_GetNumFrames(track);

for (int i = 0; i < num_frames; i++) {
	current_frame = FFMS_GetFrameInfo(track, i);
	if (current_frame->KeyFrame) {
		// true if frame is a keyframe.
		// do something?
	}
	int timestamp = (int)((current_frame->PTS * timebase->Num) / timebase->Den); // wallclock milliseconds
	timecodes.push_back(timestamp);
}
Naturally you should always check the return value of all functions against NULL to see if they failed. I skipped that here, for brevity. Note that FFMS_GetNumFrames will return 0 for an unindexed track. That should probably never happen with a video track, but I'm just sayin'.

Of course you can use any data structure of your liking to store the list of integer timestamps, I just used a std::vector for this example. You could also store the timestamps as floats or doubles if you wanted to.

Last edited by TheFluff; 5th March 2012 at 19:01.
TheFluff is offline   Reply With Quote
Old 5th March 2012, 19:49   #1509  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,660
Nice thanks !
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 5th March 2012, 20:47   #1510  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,660
while at it is there a way to get the frame type this way too or does it require a GetFrame (GetFrameInfo is way faster ) ?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 5th March 2012, 21:03   #1511  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,870
Quote:
Originally Posted by Selur View Post
while at it is there a way to get the frame type this way too or does it require a GetFrame (GetFrameInfo is way faster ) ?
GetFrame() is the only way to get that. Containers only contain keyframe flags and nothing else so full decoding is always needed.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 5th March 2012, 22:52   #1512  |  Link
bencahill
Registered User
 
Join Date: Oct 2009
Posts: 10
Quote:
Originally Posted by TheFluff View Post
But I figured out why it works for Yellow_ but not for me or bencahill; it turns out it's lavc's multithreaded decoding that's broken on this file (what a surprise). ffvideosource("derp.mov",threads=1) works fine.
Thank you, this fixed it for me. I know I haven't posted in a while, just busy with school. :-)

The only problem with this is that my computer can play 1080p through FFVideoSource, but not with threads=1 (it gets probably 15-20fps), which means I'll still have to switch back and forth to have realtime playback during editing and quality video during encoding. This is still much better than the alternative, using FFMS for editing and MPEGAutoIndex for encoding (it also is not fast enough for realtime on my computer), and therefore index/whatever files specific to both, and more script lines.

Thanks again. :-)
bencahill is offline   Reply With Quote
Old 15th March 2012, 13:05   #1513  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 6,630
again i would like to ask someone to compile r666 for me (nice number btw
TGOYNE seems to fixed corrupted frames in mkv with vc1.
Atak_Snajpera is offline   Reply With Quote
Old 16th March 2012, 06:55   #1514  |  Link
burfadel
Registered User
 
Join Date: Aug 2006
Posts: 2,235
Yes, a new build would be good!
burfadel is offline   Reply With Quote
Old 16th March 2012, 13:25   #1515  |  Link
JEEB
もこたんインしたお!
 
JEEB's Avatar
 
Join Date: Jan 2008
Location: Finland / Japan
Posts: 514
Built a standard ffms2 with Release configuration. Available here.
Quote:
ffms2: r666, libav: git-90e5b58

libav configuration:
--prefix=/ffms --enable-gpl --disable-network --disable-encoders --disable-muxers --disable-hwaccels --disable-indevs --disable-outdevs --extra-cflags='-U__STRICT_ANSI__' --extra-cflags='-DPTW32_STATIC_LIB' --disable-debug --enable-runtime-cpudetect
Works fine with Aegisub for me after testing it with a couple of files

Edit: iFail -- I had two ffms source code folders and I had run svn up on the wrong one >_> Compiling anew.
Edit2: File replaced, now this should really be r666.
__________________
[I'm human, no debug]

Last edited by JEEB; 16th March 2012 at 14:03.
JEEB is offline   Reply With Quote
Old 16th March 2012, 16:45   #1516  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 6,630
Thanks JEEB!!!
Atak_Snajpera is offline   Reply With Quote
Old 16th March 2012, 17:57   #1517  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,120
The following interlaced H.264 sample will not work correctly in ffms2 (tested 2.17, r644, r666):
http://www.mediafire.com/?ubxfydr4owr2rmo

Multi-threaded: insanity, decoder delivers empty frame after first(?) frame
1 thread: jumping back and forth
sneaker_ger is offline   Reply With Quote
Old 16th March 2012, 18:04   #1518  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,862
I have that same problem, apparently ffms doesn't work on interlaced h264 at all. It's a bug still in libav I think.
jmac698 is offline   Reply With Quote
Old 16th March 2012, 18:11   #1519  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,120
Yes, you're probably correct:
http://forum.doom9.org/showthread.ph...12#post1558212

So I presume the problem is already known and we have to be patient.
sneaker_ger is offline   Reply With Quote
Old 16th March 2012, 19:30   #1520  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,862
The only solution now is to buy dgnv or whatever it's called.
jmac698 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.