Questions tagged [seek]

Seeking is the act of moving around a file or file-like object.

Seeking is the act of moving around a file or file-like object.

ANSI C in section 2.3.12.10 specifies thatfseek has the argument structure:

int fseek(FILE *stream, long offset, int whence);

Where:

  • stream is the FILE object to seek (note that this does not have to physically be a file)
  • offset is how much, relative to the whence argument
  • whence is one of
    • SEEK_SET (offset is computed relative to the start of the file)
    • SEEK_CUR (offset is computed relative to the current position)
    • SEEK_END (offset is computed relative to the end of the file)

The majority of languages based upon C, and even many that aren't, have inherited something similar to fseek, but have probably put it somewhere else (ex. Python's file.seek). Check your language of choice's documentation for details.

537 questions
0
votes
1 answer

C , inserting an external text into a text file ,

Is there any simple way to insert an external text to some place within a text file ? I mean , suppose I have a file which has the following line Hello world ! and I want to add, say, "_, _" between 'Hello' and 'world'. What I used to do is to…
0
votes
0 answers

Seeking is not smooth

Situation: I've created a seek bar for my video. Issue: Seeking is not as smooth as I would like. I've implemented seeking using IMediaPosition instead of IMediaSeek. public virtual double Position { get { if (mediaPosition !=…
Michael Chi Lam
  • 390
  • 1
  • 13
0
votes
1 answer

Getting wrong output using seekg and seekp

I have created a class Student. The Student class: class Student { friend ostream& operator<<(ostream& os, const Student& s) { return os << "Roll no.: " << s.roll_no << '\n' << "Name: " << s.name << '\n' << …
In78
  • 440
  • 4
  • 17
0
votes
0 answers

Unable to understand Javax Clip setMicrosecondPosition. What am I missing?

I am adding a minute (60*1000*1000 microseconds) to the audio clip and starting it and I achieve the desired result only the first time i.e, I'm reaching the correct point in audio file. Next time I call getMicrosecondPosition on the Clip object, I…
Srinivas
  • 332
  • 4
  • 18
0
votes
2 answers

Playing an MPEG movie, starting and ending in specific places?

I've compiled an MTS video into MP4 format using FFMPEG. The video is 2 minutes long. I want to be able to play the video back but start at 0:15 seconds and end at 0:45 seconds. Effectively I want the playback software to only show 30 seconds of…
Reado
  • 1,412
  • 5
  • 21
  • 51
0
votes
1 answer

how to delete some characters from string php

A string contains some characters that needs to be deleted. $a = "abcdefghijlkmnopqrstuvwxyz"; I want to delete 5,6,7,8th character from the text. every time characters are shuffled. and i want to delete those characters which are placed at 5th to…
Abdur Rehman
  • 41
  • 11
0
votes
1 answer

LibXML2 + pull parser (stax) : stream position (ftell) of the event ?

I'd like to create an index and later, access some specific parts of a huge xml file, so I need to get the offset ( ftell ... ) for some 'startElement' Events. Using the pull parser (stax) interface of libxml2 (…
Pierre
  • 34,472
  • 31
  • 113
  • 192
0
votes
1 answer

Seeking a particular value when using BinaryWriter

I find it difficult to express myself so I'll jump right into the code FileStream stream = new FileStream("//ignoreThis//demo.bin", FileMode.Append, FileAccess.Write, FileShare.Write)); BinaryWriter writer = new…
Gabriel Stellini
  • 426
  • 4
  • 13
0
votes
0 answers

Seeked not working on flash source video.js

I have integrated video.js player and i have mp4 and flv videos in mp4 tracks seeking is working well but seeking is not working on flv source. When i forward seek the pointer seek move forward but video still playing from old time duration. please…
Sufyan
  • 506
  • 2
  • 6
  • 18
0
votes
0 answers

Seek and ReadLine in c#

I'm trying to Seek to a Position in a File and want to go with ReadLine after that. FPosition is stored before and matches the beginning of a specific line in the file. Maybe useful: my file has a size of 20gB and is a textfile. private List
Greaka
  • 735
  • 7
  • 16
0
votes
1 answer

html5 video buffering failed part way

Using Visual Studio as my local server while I'm trying to learn to manage html5 video with video.js. My thing is I can get video playing very easily, but I can't seek or pause without breaking the video. If I click play and just let it play all the…
Chase Lewis
  • 163
  • 6
0
votes
2 answers

Reading last error message in log file

In Python 2.7 I have the following code inside certain loop file = open("log.txt", 'a+') last_position = file.tell() subprocess.Popen(["os_command_producing_error"], stderr = file) file.seek(last_position) error = file.read() print(error) # example…
0
votes
0 answers

I don't want to request media data when seeking under Flash Player Environment if i has put meida data put Netstream using appendBytes()

Hello friends, I have some problems as following: Problem 1: I use appendBytes() to add FLV tags(about 60 seconds flv tags) to netstream, when I seek (seek targe is in 60s), I found the video cannot be played. Problem 2: I use…
tomas
  • 1
  • 2
0
votes
1 answer

Why seek on ts file is so slow?

I am dealing with a ts file, following is ffprobe output: ffprobe version N-45589-gb6a0b8b- http://johnvansickle.com/ffmpeg/ Copyright (c) 2007-2014 the FFmpeg developers built on Aug 28 2014 02:30:32 with gcc 4.8 (Debian 4.8.3-9) …
skipper
  • 245
  • 5
  • 15
0
votes
3 answers

Python seek() followed by a readline() gives empty string

I am using something similar to the question here: Python: Undo a Python file readline() operation so file pointer is back in original state but seems to be misbehaving. My code: (values at runtime shown as comments) def parse_shell(self,…
user916499
  • 85
  • 1
  • 1
  • 7