[Libav-user] seeking related questions

2017-02-18 Thread Anton Shekhovtsov
Hope someone can clarify these, thanks. 1) In order to call av_seek_frame, I have to give it a "dts" of the desired frame. The problem is, assuming even framerate I can compute "pts". Is there a consistent way to derive "dts" from "pts", or its lower/upper bounds? 2) The meaning of

Re: [Libav-user] Seeking MPEG-DASH video using Custom I/O

2016-12-12 Thread Pt Romac
There is an example within the FFmpeg examples, IIRC. I used this example, however: https://www.codeproject.com/Tips/489450/Creating-Custom-FFmpeg-IO-Context And cross referenced it with multiple other implementations I found on Google, and they all seemed to do the same things. I had a

[Libav-user] Seeking MPEG-DASH video using Custom I/O

2016-12-12 Thread Sida Li
Hi everyone, I've been trying to stream MPEG-DASH videos using libdash and decode using ffmpeg. I got the sample player from libdash working. It can do playback but not seeking. The sample uses a custom AVIOContext

Re: [Libav-user] Seeking into an mxf file

2016-03-20 Thread Patrick Cusack
That didn’t work, but I tried the following which initially works: if(av_seek_frame(pFormatCtx, videoStream, frame, AVSEEK_FLAG_FRAME) < 0){ status = K_SEEK_FAILED; return; } And If I seek with this method with mxf files it works at first, but if I seek again,

Re: [Libav-user] Seeking into an mxf file

2016-03-19 Thread Gonzalo
Try the following: int seek_ts = frame * av_q2d( vStream->time_base ); -- Gonzalo Garramuño ggarr...@gmail.com ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user

Re: [Libav-user] Seeking into an mxf file

2016-03-19 Thread Patrick Cusack
My time_base is 1001/24000 which is 23.976. On Mar 18, 2016, at 2:58 PM, Gonzalo wrote: > > El 18/03/16 a las 16:57, Patrick Cusack escribió: >> I am trying to seek into an mxf file and am not having any success. I know >> that my timebase numerator is 1001 and my

[Libav-user] Seeking into an mxf file

2016-03-18 Thread Patrick Cusack
I am trying to seek into an mxf file and am not having any success. I know that my timebase numerator is 1001 and my duration is 10808.I should be able to seek to frame 5 with the following: int frame = 5; int flgs = AVSEEK_FLAG_ANY; int seek_ts = frame *

Re: [Libav-user] Seeking into an mxf file

2016-03-18 Thread Gonzalo
El 18/03/16 a las 16:57, Patrick Cusack escribió: I am trying to seek into an mxf file and am not having any success. I know that my timebase numerator is 1001 and my duration is 10808.I should be able to seek to frame 5 with the following: What is your timebase denominator? You need to take

[Libav-user] Seeking

2014-10-30 Thread Marcus Johnson
I need to seek X bytes into a file, and I'm not sure which function will do that? I found a function called bytestream2_seek() but that only works with GetByteContext, and obviously the file is using GetBitContext, so I'm not really sure what to do. ___

Re: [Libav-user] Seeking

2014-10-30 Thread Carl Eugen Hoyos
Marcus Johnson bumblebritches57@... writes: I need to seek X bytes into a file, and I'm not sure which function will do that? What kind of file? (For many file types, seeking X bytes makes not much sense.) You can try -skip_initial_bytes but you are probably searching for AVSEEK_FLAG_BYTE.

Re: [Libav-user] Seeking

2014-10-30 Thread Marcus Johnson
I'm working on adding support for verifying the CRC in DTS files currently, I could possibly add together all the extracted values from the header, but that would be extremely prone to errors, the code would be very long and just a PITA all around. I found a function called avio_seek(), but

Re: [Libav-user] Seeking

2014-10-30 Thread wm4
On Thu, 30 Oct 2014 04:58:28 -0400 Marcus Johnson bumblebritche...@gmail.com wrote: I need to seek X bytes into a file, and I'm not sure which function will do that? I found a function called bytestream2_seek() but that only works with GetByteContext, and obviously the file is using

Re: [Libav-user] Seeking in VBR MP3 file

2013-10-29 Thread Tuukka Pasanen
On 28.10.2013 19:40, Carl Eugen Hoyos wrote: Tuukka Pasanen pasanen.tuukka@... writes: I pulled down version 2.1 from git version and there is no change. Commit 'e096283' seems to fix MP3 CBR like it says. Some VBR level 1 files works also sounds pretty good. One starts to hear more errors

Re: [Libav-user] Seeking in VBR MP3 file

2013-10-29 Thread Clément Bœsch
On Tue, Oct 29, 2013 at 09:25:23AM +0200, Tuukka Pasanen wrote: [...] or you can use my small example app to debug this.. it would be nice to ffprobe to have -ss also you could debug stuff like this! Can you look at -read_intervals option in ffprobe (recently added)? It performs a seek. If

Re: [Libav-user] Seeking in VBR MP3 file

2013-10-29 Thread Tuukka Pasanen
On 29.10.2013 10:58, Clément Bœsch wrote: On Tue, Oct 29, 2013 at 09:25:23AM +0200, Tuukka Pasanen wrote: [...] or you can use my small example app to debug this.. it would be nice to ffprobe to have -ss also you could debug stuff like this! Can you look at -read_intervals option in ffprobe

Re: [Libav-user] Seeking in VBR MP3 file

2013-10-29 Thread Clément Bœsch
On Tue, Oct 29, 2013 at 03:34:46PM +0200, Tuukka Pasanen wrote: On 29.10.2013 10:58, Clément Bœsch wrote: On Tue, Oct 29, 2013 at 09:25:23AM +0200, Tuukka Pasanen wrote: [...] or you can use my small example app to debug this.. it would be nice to ffprobe to have -ss also you could debug

Re: [Libav-user] Seeking in VBR MP3 file

2013-10-29 Thread Tuukka Pasanen
On 29.10.2013 15:39, Clément Bœsch wrote: On Tue, Oct 29, 2013 at 03:34:46PM +0200, Tuukka Pasanen wrote: On 29.10.2013 10:58, Clément Bœsch wrote: On Tue, Oct 29, 2013 at 09:25:23AM +0200, Tuukka Pasanen wrote: [...] or you can use my small example app to debug this.. it would be nice to

Re: [Libav-user] Seeking in VBR MP3 file

2013-10-28 Thread Tuukka Pasanen
Hello, Okay I suck in GIT but at last I managed to find commit is: '5864ce13d188260998bbf49a2a774fa9bd445c10'. Everything before that works and if you apply that patch it appears. Sincerly, Tuukka On 27.10.2013 20:55, Carl Eugen Hoyos wrote: Tuukka Pasanen pasanen.tuukka@... writes: Now it

Re: [Libav-user] Seeking in VBR MP3 file

2013-10-28 Thread Carl Eugen Hoyos
Tuukka Pasanen pasanen.tuukka@... writes: Okay I suck in GIT but at last I managed to find commit is: '5864ce13d188260998bbf49a2a774fa9bd445c10'. Everything before that works and if you apply that patch it appears. Wasn't this fixed in e096283 ? Please avoid top-posting here. Carl Eugen

Re: [Libav-user] Seeking in VBR MP3 file

2013-10-28 Thread Tuukka Pasanen
On 28.10.2013 16:39, Carl Eugen Hoyos wrote: Tuukka Pasanen pasanen.tuukka@... writes: Okay I suck in GIT but at last I managed to find commit is: '5864ce13d188260998bbf49a2a774fa9bd445c10'. Everything before that works and if you apply that patch it appears. Wasn't this fixed in e096283 ?

Re: [Libav-user] Seeking in VBR MP3 file

2013-10-28 Thread Carl Eugen Hoyos
Tuukka Pasanen pasanen.tuukka@... writes: I pulled down version 2.1 from git version and there is no change. Commit 'e096283' seems to fix MP3 CBR like it says. Some VBR level 1 files works also sounds pretty good. One starts to hear more errors from VBR level 2 and above. I made some

[Libav-user] Seeking in VBR MP3 file

2013-10-27 Thread Tuukka Pasanen
Hello, I'm trying to make Mixxx (http://mixxx.org) input FFmpeg plugin to function again. Now it works with Libav 0.8/9 (they work perfectly) and FFmpeg 0.11 but version above that (like 1.0-2.0/Git) doesn't work as they should with MP3 (Ogg/Vorbis, MP4 works like a charm). Problem is that Mixxx

Re: [Libav-user] Seeking in VBR MP3 file

2013-10-27 Thread Carl Eugen Hoyos
Tuukka Pasanen pasanen.tuukka@... writes: Now it works with [...] FFmpeg 0.11 but version above that (like 1.0-2.0/Git) doesn't work as they should with MP3 Which commit introduced the regression? Carl Eugen ___ Libav-user mailing list

[Libav-user] Seeking backward to a key frame within transport stream

2013-09-27 Thread rolaoo Gazeta.pl
Hello, few days ago I met a problem with av_seek_frame with AVSEEK_FLAG_BACKWARD. In case of transport stream and mpeg2 or avc and others it seeks exactly to a specified time stamp and not to a previous key frame, so the first decoded frame is past desired time stamp, of course if I am unlucky to

Re: [Libav-user] Seeking, timestamps, AVFrame, AVStream

2013-09-17 Thread Robert Krüger
On Mon, Sep 16, 2013 at 9:49 PM, James Board jpboa...@yahoo.com wrote: Anyway, it sounds like pts and best_effort_timestamp are really frame numbers No, they are not. It is the case if timebase = 1/framerate but that is not guaranteed at all and should be seen as a special case, unless for some

Re: [Libav-user] Seeking, timestamps, AVFrame, AVStream

2013-09-17 Thread James Board
Timebase simply defines the maximum granularity of your timestamps. If for some reason (e.g. to synchronize frames with content from other tracks in the same file) there can be cases where it needs to be finer than 1/frame rate. If you just learn how to calculate with it (see the formula in my

Re: [Libav-user] Seeking, timestamps, AVFrame, AVStream

2013-09-17 Thread James Board
Okay, that's helpful. But then how and where and by what program is timebase calculated?  Do the ffmpeg tools calculate it?  I don't see how they can.  They'd have to look at every frame in the video and that could take a very long time. You should know that video formats reserve some space for

Re: [Libav-user] Seeking, timestamps, AVFrame, AVStream

2013-09-16 Thread Robert Krüger
On Sun, Sep 15, 2013 at 11:37 PM, James Board jpboa...@yahoo.com wrote: I'm writing a libAV application in C, and I'm trying to use the av_seek_frame() or avformatseek_file() to move within the video stream. Ideally, I'd like to seek to frame number N. I'd like a subroutine that seeks to

Re: [Libav-user] Seeking, timestamps, AVFrame, AVStream

2013-09-16 Thread mikeversteeg
to the preceding key frame and then decode some frames until you hit the right one. Ugh. -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Seeking-timestamps-AVFrame-AVStream-tp4658516p4658518.html Sent from the libav-users mailing list archive at Nabble.com

Re: [Libav-user] Seeking, timestamps, AVFrame, AVStream

2013-09-16 Thread Alex Cohn
On Sep 16, 2013 10:52 AM, mikeversteeg m...@mikeversteeg.com wrote: How to seek is actually quite easy so I won't explain that (google it and you find it easily), but keep in mind that you must seek to key frames. How to (fast) seek to any frame is something I haven't figured out myself, it's

Re: [Libav-user] Seeking, timestamps, AVFrame, AVStream

2013-09-16 Thread James Board
How to seek is actually quite easy so I won't explain that (google it and you find it easily), but keep in mind that you must seek to key frames. How to (fast) seek to any frame is something I haven't figured out myself, it's not something ffmpeg seems to support so I fear you'd have to seek to

Re: [Libav-user] Seeking, timestamps, AVFrame, AVStream

2013-09-16 Thread Robert Krüger
On Mon, Sep 16, 2013 at 4:19 PM, James Board jpboa...@yahoo.com wrote: Try looking at the documentation in the header files, in this case avcodec.h. It should help you quite a bit. Yes, I looked at avcodec.h and could not find what I wanted. When I was You wrote: pts pkt_pts

Re: [Libav-user] Seeking, timestamps, AVFrame, AVStream

2013-09-16 Thread Don Moir
Yes, I looked at avcodec.h and could not find what I wanted. When I was You wrote: pts pkt_pts pkt_dts coded_picture_number display_picture_number best_effort_timestamp (the name of this one really worries me) pkt_pos pkt_duration What do those all mean? Can I use

[Libav-user] Seeking, timestamps, AVFrame, AVStream

2013-09-15 Thread James Board
I'm writing a libAV application in C, and I'm trying to use the av_seek_frame() or avformatseek_file() to move within the video stream. Ideally, I'd like to seek to frame number N.  I'd like a subroutine that seeks to frame number N, but I think from previous discussions, that isn't the way things

[Libav-user] Seeking by microseconds in FFmpeg

2013-08-20 Thread William Seemann
Hello, Is it possible to seek by microseconds using FFmpeg. All of the examples I've seen rely on milliseconds an I'm unsure how to perform the conversion. Can someone provide an example? Thanks in advance.* * ___ Libav-user mailing list

Re: [Libav-user] Seeking for libavfilter functionality: overlay of grid over image, invert colors

2013-05-05 Thread Carl Eugen Hoyos
Andrey Utkin andrey.krieger.utkin at gmail.com writes: But i am also interested, is there any libraries rich for such and similar functionality, which are pluggable to libavfilter? Some external libraries are supported, please see the fine documentation. (Adding more is probably welcome,

[Libav-user] Seeking for libavfilter functionality: overlay of grid over image, invert colors

2013-05-04 Thread Andrey Utkin
As letter subject says, i seek for such pieces of functionality. Looking at filters list in docs i see there are no such filters. But i am also interested, is there any libraries rich for such and similar functionality, which are pluggable to libavfilter? Secondly, will libavfilter major

[Libav-user] Seeking encoded video (.avi)

2013-04-11 Thread praks411
Hi, I'm writing a small application to convert between container formats for video files. My input is a video file (.flv, .mp4, .mov) and output is exactly same video in .avi container. I'm using muxing.c example for my reference. I'm just copying both input and output stream as it is, except that

Re: [Libav-user] Seeking encoded video (.avi)

2013-04-11 Thread Carl Eugen Hoyos
praks411 praks411@... writes: 1. If I play the output (.avi) file in vlc then I'm just able to play video there is no audio. How does ffmpeg -i output.avi look like? (This sounds like a well-known bug in vlc.) Carl Eugen ___ Libav-user mailing

Re: [Libav-user] Seeking encoded video (.avi)

2013-04-11 Thread praks411
Hi Carl, Thanks for the reply, I'll check and let you know. Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Seeking-encoded-video-avi-tp4657245p4657247.html Sent from the libav-users mailing list archive at Nabble.com.

Re: [Libav-user] Seeking encoded video (.avi)

2013-04-11 Thread praks411
Please the output of ffmpeg -i The output file is perfect. It is working in both windows and vlc and seeking is also fixed. So is this related to pts and dts setting? I still don't get what I'm missing in my code. inffmpeg.exe -i output.avi new_output.avi ffmpeg version N-51511-g599866f

Re: [Libav-user] Seeking encoded video (.avi)

2013-04-11 Thread Carl Eugen Hoyos
praks411 praks411@... writes: The output file is perfect. It is working in both windows and vlc It appears I misunderstood, I thought the file does not work with vlc. Sorry for the noise, Carl Eugen ___ Libav-user mailing list

Re: [Libav-user] Seeking encoded video (.avi)

2013-04-11 Thread praks411
No, the output file which i'm generating is not working. However it works when I again encode it with ffmpeg. So I'm looking for some help what I'm doing wrong. Please find below the snippet of code which I'm using av_register_all(); //if ( av_open_input_file( m_data-formatCtx,

[Libav-user] Seeking causes the demuxer to skip some packets (after the seek)... why? Bug?

2012-10-25 Thread Michael Bradshaw
I have a weird issue that I'm trying to figure out, and I'm not sure if I'm doing something wrong or if it's a bug in FFmpeg's code, and I'm hoping someone can help me determine which. If I demux a file by simply repeatedly calling av_read_frame(), I get the same output packets as ffprobe

[Libav-user] Seeking and Frame Timestamps

2012-03-30 Thread Michael Bradshaw
I have a couple questions regarding seeking and timestamps. 1) If seeking in a video is a possible, will avformat_seek_file(formatContext, -1, 0, timestamp, timestamp, 0) ever fail? If this does fail and seeking is still possible, what can be done to seek? 2) If I call

Re: [Libav-user] Seeking during trimming command takes quite a while

2012-01-30 Thread Carl Eugen Hoyos
Simon Daniels simondaniels23@... writes: I'm using the -ss and -t flags to trim a section of video out of a longer original one. As an example, if the video is 60 minutes long, and I want minutes 50-52, ffmpeg takes quite a while to get to that point. I'll see something like the following (I

[Libav-user] Seeking problem with avformat_seek_file

2011-09-13 Thread Benjamin Gretsch
Good afternoon, After days of searching and trying, I still have a problem: When I use avformat_seek_file() to go back to the very beginning of a file and then av_read_frame(), I still don't get the first frames again. The goal is to extract multiple chunks of audio from a stream. My approach

Re: [Libav-user] Seeking problem with avformat_seek_file

2011-09-13 Thread Matthew Einhorn
On Tue, Sep 13, 2011 at 12:42 PM, Benjamin Gretsch li...@dndrunde.dewrote: Good afternoon, After days of searching and trying, I still have a problem: When I use avformat_seek_file() to go back to the very beginning of a file and then av_read_frame(), I still don't get the first frames

[Libav-user] Seeking by byte position in H.264 video

2011-08-06 Thread Дмитрий Дороговцев
Hello. I am trying to implement some kind of seeking mechanism in H.264 files without any container, just raw H.264 stream. I have some troubles with it. 1) Problem #1. I am using ffmpeg to cut let's say 143 frames from video in this way: ffmpeg -i source.h264 -vcodec libx264 -b 1200k -r 30

Re: [Libav-user] Seeking in a video with interframes

2011-06-02 Thread Alex Cohn
IIRC, some decoders may accept request_sample_format field or other hints in AVCodecContext (see libavcodec/avcodec.h). Alex On Thu, Jun 2, 2011 at 1:33 AM, Jaymie Strecker jstrec...@kosada.com wrote: Alex, thanks for your reply. I'm not sure what you mean by color conversion or filtering.