seek

Seeking / start media at desired position on Chromecast from Android from my own webserver

时间秒杀一切 提交于 2019-12-10 11:54:46
问题 I am currently developing a media application for Android that can cast it's media to a Google Chromecast. This application is not meant to be published so some of the unorthodox choices I have made (web server, local files etc.) isn't part of the discussion. The problem is that when I load a media stream to the Chromecast, or seek in the stream, it doesn't change. The callback says it succeeds, but the movie keeps playing from scratch (when I load with initial position) and doesn't change

SEEK_HOLE and SEEK_DATA not working in Ubuntu 12.04.2 LTS

江枫思渺然 提交于 2019-12-10 11:36:13
问题 When compiling I get the error: cc holetest.c -o holetest holetest.c: In function ‘test_seek’: holetest.c:48:19: error: ‘SEEK_HOLE’ undeclared (first use in this function) holetest.c:48:19: note: each undeclared identifier is reported only once for each function it appears in holetest.c:51:19: error: ‘SEEK_DATA’ undeclared (first use in this function) make: *** [holetest] Error 1 If I remove SEEK_HOLE and SEEK_DATA I have no issues. Have I missed an include or a library? Makefile: all:

Android MediaCodec backward seeking

那年仲夏 提交于 2019-12-10 10:59:35
问题 I'm trying to implement precise seeking for video using MediaCodec and MediaExtractor . By following Grafika's MoviePlayer, I've managed to implement the forward seeking. However I'm still having problem with backward seeking. The relevant bit of code is here: public void seekBackward(long position){ final int TIMEOUT_USEC = 10000; int inputChunk = 0; long firstInputTimeNsec = -1; boolean outputDone = false; boolean inputDone = false; mExtractor.seekTo(position, MediaExtractor.SEEK_TO

FFMPEG Seeking brings audio artifacts

﹥>﹥吖頭↗ 提交于 2019-12-10 04:22:19
问题 I'm implementing a audio decoder using ffmpeg. While reading audio and even seeking already works, I can't figure out a way to clear the buffers after seeking so I have no artifacts when the app starts reading audio right after seeking. avcodec_flush_buffers doesn´t seem to have any effect on the internal buffers. This issue happens with all decoders (mp3, aac, wma, ...) but PCM/WAV (which doesn´t use internal buffers to hold data to decode since the audio is not compressed). The code snippet

Is using istream::seekg too much expensive?

佐手、 提交于 2019-12-10 03:37:55
问题 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

How in portable C to seek forward when reading from a pipe

三世轮回 提交于 2019-12-10 03:16:57
问题 Since fseek() does not work on pipes what methods exist for simulating seeking forward? The naive approach is to use fread() and throw away the contents read into the memory buffer. For huge seeks to avoid huge buffers you would use the same buffer over and over with the final read using just a part of the buffer. But is this the only approach? Is there another way which avoids the buffer and the potential multiple read? 回答1: Yes, it is the only way. I would use a buffer somewhere around 1k

How to flush gstreamer pipeline

二次信任 提交于 2019-12-08 04:19:55
问题 Case Reading from a file continuously and feeding to appsrc element. Source - appsrc I have a GStreamer pipeline in PLAYING state. Now would want the pipeline to flush / clean when I press a button that means appsrc queue should be cleared. The playback should start from whatever buffers are now added to / or were added after flush. Issue the APIs I used returned false. I am not able to flush. fprintf(stderr, "The flush event start was <%d>",gst_element_send_event(GST_ELEMENT (pipe), gst

C++. After writing into a relative file, I cannot display the content

流过昼夜 提交于 2019-12-08 03:49:33
问题 I can write into a relative file 1 , then when I try to read the content and display it on the screen (to check if data are actually into the file), I do not have the records which I believe are already present in the file. I am using Dev-C++. Any help will be appreciated. The code is below; #include <iostream> // cin, cout #include <iomanip> #include <fstream> #include <conio.h> using namespace std; #define SIZE 10 struct client // Client record { int account; // from 1 to SIZE char name[20]

Python regex search for hexadecimal bytes

陌路散爱 提交于 2019-12-08 02:20:41
问题 I'm trying to search a binary file for a series of hexadecimal values, however, I've run into a few issues that I can't quite solve. (1) I'm not sure how to search the entire file and return all the matches. Currently I have f.seek going only as far as I think the value might be, which is no good. (2) I'd like to return the offset in either decimal or hex where there might be a match, although I get 0 each time, so I'm not sure what I did wrong. example.bin AA BB CC DD EE FF AB AC AD AE AF BA

Search for a String (as an byte[]) in a binary stream

时光总嘲笑我的痴心妄想 提交于 2019-12-07 15:28:18
问题 Hi Team, I am trying to find a String "Henry" in a binary file and change the String to a different string. FYI the file is the output of serialisation of an object. Original Question here I am new to searching bytes and imagined this code would search for my byte[] and exchange it. But it doesn't come close to working it doesn't even find a match. { byte[] bytesHenry = new String("Henry").getBytes(); byte[] bytesSwap = new String("Zsswd").getBytes(); byte[] seekHenry = new byte[bytesHenry