[Libav-user] avcodec_open2() sets frame_size to zero

2015-11-03 Thread James Board
I'm writing a simple C program to read an AVI file as input (it contains an uncompressed video and audio stream) and produces an AVI file as output. In both input and output files, the audio is not compressed and the codec is AV_CODEC_ID_PCM_S16LE. In my simple program, I call avcodec_open2()

Re: [Libav-user] Best File Container Format for editing Video/Audio?

2014-05-15 Thread James Board
> > With AVI files, this seems complicated since the > > number of audio frames does not always equal the > > number of video frames. > > This has absolutely nothing to do with the container. Okay. Well I was previously told that mxf containers will store all the audio packets that correspond

[Libav-user] HELP: Mailing List Not Working

2014-05-15 Thread James Board
Hi. When I send messages to libav-user@ffmpeg.org that message gets added to the libav-user archive, but the message never gets sent to the mailing list. Nobody can see my messages unless they read the archive. Can someone look into what is broken? ___

Re: [Libav-user] Best File Container Format for editing Video/Audio? (2nd try)

2014-05-15 Thread James Board
Sorry if this email gets sent twice.  It never showed in the archive.  Yahoo mail sux: I wrote a libAV-based application which edits a video file.  It takes a video file as input, along with the Edit List.  The input video file is an AVI container and was created by ffmpeg or mencoder

[Libav-user] Best File Container Format for editing Video/Audio? (2nd try)

2014-05-15 Thread James Board
Sorry if this email gets sent twice. It never showed in the archive. Yahoo mail sux: I wrote a libAV-based application which edits a video file.  It takes a video file as input, along with the Edit List.  The input video file is an AVI container and was created by ffmpeg or mencoder during

[Libav-user] Best File Container Format for editing Video/Audio?

2014-05-14 Thread James Board
I wrote a libAV-based application which edits a video file. It takes a video file as input, along with the Edit List. The input video file is an AVI container and was created by ffmpeg or mencoder during the inverse-telecine step. The Edit list contains a list of Start/Stop PTS pairs. The outp

[Libav-user] Blue-ish tint to pixels when using raw uncompressed output codec

2013-12-08 Thread James Board
I wrote a libAV-based C program for video editing.  It takes a video file as input and produces a video file as output.  The input file is AVI container, yuv422p pixels, and is ffvhuff compressed.  I want the output file to also be AVI, yuv422p pixels, but uncompressed video (not ffvhuff).  What sh

Re: [Libav-user] Problems with ffvhuff and huvvyuv

2013-10-17 Thread James Board
>What you're describing sounds like the multithreading approach that ffmpeg uses. My >understanding: The first decode call starts a decode action which spawns a >thread to >decode that frame. Each subsequent decode call starts a new >action/thread, until you run >out of threads, at which point

Re: [Libav-user] Problems with ffvhuff and huvvyuv

2013-10-17 Thread James Board
>And issue is probably withing avi container as it >may not add every frame into index table. >And when seeking you never check if returned packet actually is right >one that you need. > >Or it could be bug in your code how you seek in file, etc... Sorry for the top post (again).  The problem is Y

Re: [Libav-user] Problems with ffvhuff and huvvyuv

2013-10-17 Thread James Board
what 'cached frames' are but nobody answered.  Does anyone understand this? Also, none of the above oddness happens if I use AVI files encoded with no codec or with lossless JPEG, or a few other codecs. On Wednesday, October 16, 2013 3:48 PM, Paul B Mahol wrote: On 10/16/13, Paul

Re: [Libav-user] Problems with ffvhuff and huvvyuv

2013-10-17 Thread James Board
>On 10/17/13, James Board wrote: >>>You noted it wrong. Huffyuv does use SIMD. >> >> Where?  I didn't see any SIMD instructions in huffyuvenc.c or >> huffyuvdec.c. Am I looking in the wrong place? > >It is not in huffyuvdec.c > >I will give more i

Re: [Libav-user] Problems with ffvhuff and huvvyuv

2013-10-17 Thread James Board
>You noted it wrong. Huffyuv does use SIMD. Where?  I didn't see any SIMD instructions in huffyuvenc.c or huffyuvdec.c. Am I looking in the wrong place? On Wednesday, October 16, 2013 4:45 PM, Paul B Mahol wrote: On 10/16/13, James Board wrote: >>And issue is probab

Re: [Libav-user] Problems with ffvhuff and huvvyuv

2013-10-16 Thread James Board
>And issue is probably withing avi container as it >may not add every frame into index table. >And when seeking you never check if returned packet actually is right >one that you need. > >Or it could be bug in your code how you seek in file, etc... I do check the results of the seek and I do check

Re: [Libav-user] Problems with ffvhuff and huvvyuv

2013-10-16 Thread James Board
fort can't possibly work.  If the answer is 'no, then I'll press on. On Wednesday, October 16, 2013 12:56 PM, Carl Eugen Hoyos wrote: James Board writes: > It would be nice if someone told me beforehand whether > or not this is a problem that can be fixed.

Re: [Libav-user] Problems with ffvhuff and huvvyuv

2013-10-16 Thread James Board
>> I don't know that codec. I just knew it was lossless. So I guess >> (unless there's a bug) the rule has an exception. Maybe the >> 'adaptive tables' that google says it has adapt every 24 or so >> frames. Don't have the source in front of me right now. >> >> But it's an FOSS project - anyon

Re: [Libav-user] Problems with ffvhuff and huvvyuv

2013-10-16 Thread James Board
>I have an libAV program that decodes every 24-th frame.  This is for >a video editor so I can easily seek forward in the video, rather than >play all frames. >If the input file is uncompressed AVI, then this works well. >However, if I compress the video with ffvhuff or huffvuy, then whenever I >s

Re: [Libav-user] How to determine the largest best_effort_timestamp?

2013-10-15 Thread James Board
with a file container other than AVI? On Sunday, October 13, 2013 2:20 PM, Andy Shaules wrote: On 10/12/2013 12:52 PM, James Board wrote: In a C program with libav, how can I determine what is the largest best_effort_timestamp >for my input video file, which is AVI container and compresse

[Libav-user] Problems with ffvhuff and huvvyuv

2013-10-15 Thread James Board
I have an libAV program that decodes every 24-th frame.  This is for a video editor so I can easily seek forward in the video, rather than play all frames. The high-level psuedo-code looks like this     for (int f = 0 ; f < LargeNumber; f+= 24) {     avformat_seek_file(ctx, 0, f, f, f, AVSEEK_

[Libav-user] How to determine the largest best_effort_timestamp?

2013-10-12 Thread James Board
In a C program with libav, how can I determine what is the largest best_effort_timestamp for my input video file, which is AVI container and compressed with ffvhuff? ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/lib

[Libav-user] Decode every 24-th frame. Cached decoded frames?

2013-10-12 Thread James Board
I have a C program that is using libav in a video editor.  I want to decode every 24th frame of the video (and nothing else).  I wrote a loop which uses avformat_seek_file() to seek to frame 0, then frame24, then frame 48, then frame 72, etc.  My input file is AVI container with the ffvhuff codec.

Re: [Libav-user] Compile with g++

2013-10-09 Thread James Board
>This is a mailing list about FFmpeg (that is why >it is hosted on the FFmpeg server). Questions >about how to convert a C program (that allows >implicit type conversions which is why FFmpeg >- and demuxing.c - does not contain explicit >type conversions) into a C++ program (which >needs exp

Re: [Libav-user] Compile with g++

2013-10-09 Thread James Board
program. >Carl Eugen On , James Board wrote: >That's an example program written in C. There's nothing in the actual codebase (as opposed to the >examples) that doesn't work in C++. Yes, I know it's a program written in C.  As I stated before, I only used that

Re: [Libav-user] Compile with g++

2013-10-09 Thread James Board
So, if we can figure out why demuxing.c won't compile with g++, then we will probably figure out why my C++ app won't compile with g++.  On Tuesday, October 8, 2013 9:25 PM, Bruce Wheaton wrote: On Oct 8, 2013, at 11:12 AM, James Board wrote: > >I tried exactly that w

Re: [Libav-user] Is libav thread-safe?

2013-10-09 Thread James Board
esn't do what I want.  I'll just choose another route. On , Bruce Wheaton wrote: On Oct 8, 2013, at 12:05 PM, James Board wrote: I want to create several pthreads in a C++ program (assuming you can call >libav routines from a C++ program) that each call libav subroutines.  &

[Libav-user] Is libav thread-safe?

2013-10-08 Thread James Board
I want to create several pthreads in a C++ program (assuming you can call libav routines from a C++ program) that each call libav subroutines.  Are the libav subroutines  thread-safe?  Specifically, can several pthreads open the same AVI file and decode different video frames concurrently? I'm d

Re: [Libav-user] Compile with g++

2013-10-08 Thread James Board
>"How difficult would it be to compile the examples in the doc/examples >directory with a C++ compiler?" > >Those are C programs, so just use a C compiler for them.  That's all I >meant. Okay, I understand.  Yes they are just C programs, so I can compile with the C compiler.  But my C++ programs

Re: [Libav-user] Compile with g++

2013-10-08 Thread James Board
sholm wrote: On 10/7/2013 5:31 PM, James Board wrote: > I'm trying to incorporate the libav subroutines into a C++ program.  Has this > been > done?  When I try to compile, I get lots of errors like UINT64_c undefined and > many others.  How difficult would it be to compile

Re: [Libav-user] Compile with g++

2013-10-08 Thread James Board
On Monday, October 7, 2013 5:39 PM, Michael Chisholm wrote: On 10/7/2013 5:31 PM, James Board wrote: > I'm trying to incorporate the libav subroutines into a C++ program.  Has this > been > done?  When I try to compile, I get lots of errors like UINT64_c undefined and >

Re: [Libav-user] Compile with g++

2013-10-07 Thread James Board
>But if you're compiling pure C code, why not use a C compiler? I'm not compiling pure C code.  I'm compiling C++ code and I want to call the libav surboutines from C++ code.  How do I do this?___ Libav-user mailing list Libav-user@ffmpeg.org http://ffm

[Libav-user] Compile with g++

2013-10-07 Thread James Board
I'm trying to incorporate the libav subroutines into a C++ program.  Has this been done?  When I try to compile, I get lots of errors like UINT64_c undefined and many others.  How difficult would it be to compile the examples in the doc/examples directory with a C++ compiler?

[Libav-user] Cached Frames

2013-09-17 Thread James Board
In the libAV examples distributed with ffmpeg, I see the following code:     // Flush cache frames     do {     decode_packet(&got_frame, 1);     } while (got_frame); What are cached frames and what does the above do?  Is this explained anywhere? In my libav app, I'm trying to do simple edit

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

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 m

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

2013-09-16 Thread James Board
>> 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 reason you know all your files are that way (and they typicall

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

2013-09-16 Thread James Board
>> 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

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

2013-09-16 Thread James Board
>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 previously discussing the inaccuracy of floating-point numbers and how I wanted to use frame numbers in editing,

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 t

[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

Re: [Libav-user] Copy Image Data from Decode Frame To Encode Frame

2013-09-15 Thread James Board
>> However, what if I only copy a subset of the input frames to the output >> file?  Can I still copy the packet?  If the answer is no, can I do something >> simple to allow me to copy the packet (like modify a timestamp?). > >The best advice again would be to try and see if there is some >problem

[Libav-user] What are Cached Frames?

2013-09-15 Thread James Board
In the libAV examples distributed with ffmpeg, I see the following code:     // Flush cache frames     do {     decode_packet(&got_frame, 1);     } while (got_frame); What are cached frames and what does the above do?  Is tis explained anywhere? In my libav app, I'm trying to do simple edit

Re: [Libav-user] Copy Image Data from Decode Frame To Encode Frame

2013-09-15 Thread James Board
>> In between the two calls above, I have to convert the image data from >> myFrameDecode to image data in myFrameEncode.  That's what I'm having >> trouble >> with.  Right now I have lots of row/col loops and they do things differently >> for different pixel formats.  Is there a single subroutin

Re: [Libav-user] Copy Image Data from Decode Frame To Encode Frame

2013-09-15 Thread James Board
>Generally speaking, the answer is yes, you can simply copy encoded >packets from demuxer to muxer, if you don't change them. I am sure AVI >container will not be upset, but out in the wild, there could be some >containers for which this trick may be less straightforward to >implement. > >General

Re: [Libav-user] Copy Image Data from Decode Frame To Encode Frame

2013-09-14 Thread James Board
>> Also, if the input and output file have the same pixel format, is there a >> simple way to copy the data from one to the other? >> >> Thanks >You don't need to copy data between frames, you can reuse the decoder frame as >input for encoder. Okay.  I will try this  (actually, I tried it and it

[Libav-user] Copy Image Data from Decode Frame To Encode Frame

2013-09-14 Thread James Board
I'm writing a simple libAV program that reads an AVI file, decodes each frame, then writes that frame data to another AVI file as output.  The output file should be pretty much the same as the input file. I'm using the examples in the ffmpeg source as a start.  This is how each frame from the inpu

Re: [Libav-user] VFR and CFR and libav

2013-09-08 Thread James Board
>> Also, and this probably isn't a libav question, but how can I tell >> if my input AVI file is vfr or cfr? > >By looking at frame timestamps. I tried this:     ffmprobe IN.avi -show_frames | grep pkt_pts_time Is that the correct way to look t time stamps?  Are those the real timestamps, or ar

[Libav-user] VFR and CFR and libav

2013-09-06 Thread James Board
Let's say I have an input video (AVI format) that is vfr, and I write a libav application that steps through each frame in the video and does something: maybe I write that frame to a file on disk.  Will I have vfr-problems where the libav is duplicating frames, or removing frames (behind the scenes

Re: [Libav-user] VFR and CFR and libav

2013-09-06 Thread James Board
> >When using libs you are on your own. The VFR/CFR comes with ffmpeg tool. So it sounds like what yo're saying is that with the libs, I won't have the same issues with the ffmpeg feature where it duplicated input frames in order to meet some unspecified constant frame rate?  With the libs, when

[Libav-user] Encoding and Decoding Single Frames with libAV

2013-09-05 Thread James Board
Is there a way to use libav to encode and decode a single frame of image data with a lossless codec such as ffvhuff?  I know this can be done with video.  But if I have a single frame of image data stored in a ppm or pnm file, can I read it into my libAV program, compress with the ffvhuff codec, an

Re: [Libav-user] Encoding and Decoding Single Frames with libAV

2013-09-05 Thread James Board
>>On 9/5/13, James Board wrote: >> Is there a way to use libav to encode and decode a single frame of >> image data with a lossless codec such as ffvhuff?  I know this can >> be done with video.  But if I have a single frame of image data stored >> in a ppm or p

Re: [Libav-user] How to decode arbitrary frame

2013-07-18 Thread James Board
From: Thomas To: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." Sent: Thursday, July 18, 2013 8:55 AM Subject: Re: [Libav-user] How to decode arbitrary frame >You can use avformat_seek_file() followed by avco

[Libav-user] How to decode arbitrary frame

2013-07-18 Thread James Board
I have the doc/examples programs compiled and running.  I use the program demuxing.c to decode an AVI file.  From the source code, it looks it calls its own subroutine decode_packet() to decode the next video or audio packet, and that subroutine calls avcodec_ecode_video2()to decode the next fram

Re: [Libav-user] libavcodec documentation and usage

2013-07-16 Thread James Board
>I don't know how to fix that.  Do you know what I must do to get >the examples in doc/examples in the ffmpeg source code to compile? Never mind.  I did the following and then the examples compiled:     setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig _

Re: [Libav-user] libavcodec documentation and usage

2013-07-16 Thread James Board
>You need updated headers and pkg-config installed in your system. Also >read the README file for further instructions. I did a 'make install' of ffmpeg, and after that, I tried to build the libavcodec examples in doc/examples.  I received lots of 'undefined reference' errors after running 'make'

Re: [Libav-user] libavcodec documentation and usage

2013-07-16 Thread James Board
>On date Tuesday 2013-07-16 09:11:53 -0700, James Board encoded: >> I'd like to write a C or C++ program which uses libavcodec to retrieve >> individual frames of an AVI file.  I can't find much documentation on >> the WWW.  But there are examples in the ffmpeg sour

[Libav-user] libavcodec documentation and usage

2013-07-16 Thread James Board
I'd like to write a C or C++ program which uses libavcodec to retrieve individual frames of an AVI file.  I can't find much documentation on the WWW.  But there are examples in the ffmpeg source distribution.  I tried to compile them, but that failed because there is no file: channel_layout.h. Any