seek

Using Boost Spirit to parse a text file while skipping large parts of it

廉价感情. 提交于 2019-12-05 21:40:32
I have the following std::string : <lots of text not including "label A" or "label B"> label A: 34 <lots of text not including "label A" or "label B"> label B: 45 <lots of text not including "label A" or "label B"> ... I want extract single integral numbers following all occurrences of label A or label B and place them in corresponding vector<int> a, b . A simple, but not elegant way of doing it is using find("label A") and find("label B") and parsing whichever is first. Is there a succinct way of expressing it using Spirit? How do you skip everything but label A or label B ? You can just omit

AVPlayer seekToTime not working properly

。_饼干妹妹 提交于 2019-12-05 18:05:29
Im having a problem with seeking with AVPlayer.seekToTime, I have the time index that I want to seek to inside a scrollViewDidScroll method like this: func scrollViewDidScroll(scrollView: UIScrollView) { let offsetTime = scrollView.contentOffset.y * 0.1 self.playerController.player?.seekToTime(CMTime(seconds: Double(offsetTime), preferredTimescale: 10), toleranceBefore: kCMTimePositiveInfinity, toleranceAfter: kCMTimeZero) } But the video does not flow nice. For example, when you scroll I want the video to only to move forward like 0.01 of a second (the video I have is real short only about 2

How to seek() then pause() with JWPlayer 5.4

人走茶凉 提交于 2019-12-05 09:26:12
Does anyone know how to get JW PLayer v5.4 (either the Flash rendering or the HTML5 rendering) to pause after a seek() command? I'm trying to get the video to step 0.01 seconds forward or backward when a user clicks the fine-grain control buttons (or uses the left or right arrow keys). This is so they can snap a framegrab with better precision. I'm not sure if this is even possible but I've tried a few things with no luck. Such as the following: var stepTo = jwplayer("video_player").getPosition() + 0.01; jwplayer("video_player").seek(stepTo).onComplete(function(){ jwplayer('video_player')

Is using istream::seekg too much expensive?

余生颓废 提交于 2019-12-05 03:35:45
In c++, how expensive is it to use the istream::seekg operation? EDIT: How much can I get away with seeking around a file and reading bytes? What about frequency versus magnitude of offset? I have a large file (4GB) that I am parsing, and I want to know if it's necessary to try to consolidate some of my seekg calls. I would assume that the magnitude of differences in file location play a role--like if you seek more than a page in memory away, it will impact performance--but small seeking is of no consequence. Is this correct? This question is heavily dependent on your operating system and disk

Does FileInputStream.skip() do a seek?

a 夏天 提交于 2019-12-04 23:53:30
I want to copy the last 10MB of a possibly large file into another file. Ideally I would use FileInputStream, skip() and then read(). However I'm unsure if the performance of skip() will be bad. Is skip() typically implemented using a file seek underneath or does it actually read and discard data? I know about RandomAccessFile but I'm interested in whether I could use FileInputStream in place of that (RandomAccessFile is annoying as the API is non-standard). Depends on your JVM, but here's the source for FileInputStream.skip() for a recent openjdk: JNIEXPORT jlong JNICALL Java_java_io

ffmpeg av_seek_frame with AVSEEK_FLAG_ANY causes grey screen

穿精又带淫゛_ 提交于 2019-12-04 13:02:22
Problem: omxplayer's source code calls the ffmpeg av_seek_frame() method using the AVSEEK_FLAG_BACKWARD flag. Although not 100% sure, I believe this seeks to the closest i-frame. Instead, I want to seek to exact locations, so I modified the source code such that the av_seek_frame() method now uses the AVSEEK_FLAG_ANY flag. Now, when the movie loads, I get a grey screen, generally for 1 second, during which I can hear the audio. I have tried this on multiple computers (I am actually synchronizing them, therefore, at the same time too) so it is not a n isolated incident. My guess is that seeking

How do I do random access reads from (large) files using node.js?

徘徊边缘 提交于 2019-12-04 07:32:18
Am I missing something or does node.js's standard file I/O module lack analogs of the usual file random access methods? seek() / fseek() tell() / ftell() How does one read random fixed-size records from large files in node without these? tell is not, but it is pretty rare to not already know the position you are at in a file, or to not have a way to keep track yourself. seek is exposed indirectly via the position argument of fs.read and fs.write . When given, the argument will seek to that location before performing its operation, and if null , it will use whatever previous position it had.

seekTo in VideoView

江枫思渺然 提交于 2019-12-04 07:09:37
I'm having problems with seeking video. My application should resume video from place where it was stopped last time. So I do this: videoView.seekTo(bookmark); videoView.start(); However when it plays I hear sounds form beginning of video for about 1-2 sec. And only after that video seeks to the right position. This behavior is reproducible on HTC Nexus One, HTC G1, HTC evo. But on Samsung galaxy tab all plays normally. Anybody had similar problems? Is this bug HTC-specific? Thanks in advance. I guess that can be a reason: from api doc Although the asynchronuous seekTo(int) call returns right

Android Precise seeking of video

陌路散爱 提交于 2019-12-03 08:17:42
I'm struggling with precise seeking using MediaExtractor's seekTo() . While I can seek to sync frames without problems, I would like to seek to specific time. This question led me to some ideas how to do this, but I'm not sure if they are valid. Basicly, I would have to seek to closest previous sync frame and then advance() the extractor until target time is reached. Every frame in the process would be fed to the decoder, i.e the first I-frame and the rest P-frames. This is related code snippet (based on google/grafika 's MoviePlayer): extractor.seekTo((long) seekTarget[threadNr],

How to use z3 split clauses of unsat cores & try to find out unsat core again

霸气de小男生 提交于 2019-12-02 14:22:57
问题 Could you like to tell how to split clauses of unsat cores? And here is question 2 regarding after found out unsat cores, I will try to seek again. Would you like to tell how to do this? Thank you very much. How to split the clauses as below `and` (`or` (`<=_int` 1002 x1) (`<=_int` 1000 x1)) (`and` (`or` (`<=_int` 0 (`+_int` x2 (`*_int` -1003 x1))) (`<=_int` 0 (`+_int` x2 (`*_int` -1230 x1)))) (`and` (`or` (`<=_int` 0 (`+_int` x3 (`*_int` -1999 x2))) Regarding to the question 2, cout<<s.check