YIRAN LI | 23 Apr 14:21 2014
Picon

how to delay load external dlls

Hi,

I'm building ffmpeg for Windows under MinGW. What I want to achieve is build ffmpeg with some dynamic external libraries so that only when a specific dll is needed will be be downloaded and run.

I was able to build ffmpeg with dynamic external libraries, but by default, libavcodec.dll can't be loaded if external libraries are not present. 

So I'd like to know if there's any workaround so that libavcodec.dll can be loaded even when external libraries are not available.

Thanks
_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user
Chris Garry | 20 Apr 15:13 2014
Picon

Convert frame data from AV_PIX_FMT_BGR24 to AV_PIX_FMT_PAL8

My application needs to convert frame data from its internal format of BGR24
to palletized 8-bit data so that it can generate a colour animated GIF.  Is
there a function in the FFmpeg libraries to do this?

I tried creating an SwsContext and using sws_scale(), but an output format
of AV_PIX_FMT_PAL8 is not by sws_getCachedContext().

I understand that creating a suitable optimised palette for a frame is
non-trivial but would have thought that this must have been done many times
before.  Therefore I just wanted to check it if a function to do this
already exists before I bite the bullet and write my own version.

Thanks and regards,
Chris Garry
Harald Schlangmann | 20 Apr 15:57 2014
Picon

How to set bit_rate for MPEG4/2

Hi,

processing a video stream reported with

	Stream #0:0(eng), 0, 1/25000: Video: h264 (avc1 / 0x31637661), 1920x1080, 0/1, 31992 kb/s, 25 fps, 25
tbr, 25k tbn (default)

setting the bit_rate for a MPEG4/2 encoder seems to have effect for me: 

When initializing bit_rate in AVCodecContext with 7257 kb/s (i.e. 7257000) dumping the output format shows:

	Stream #0:0, 0, 1/90000: Video: mpeg4, yuv420p, 1920x1080, 1/25, q=2-31, 7257 kb/s, 90k tbn, 25 tbc

but results in a file with size 501MB for 88.24 seconds which means a bit rate of 47628 kb/s (video + audio)…

When not initializing bit_rate in AVCodecContext dumping the output format shows:

	Stream #0:0, 0, 1/90000: Video: mpeg4, yuv420p, 1920x1080, 1/25, q=2-31, 200 kb/s, 90k tbn, 25 tbc

and results in a file with size 498 MB for 88.24 seconds which means a bit rate of 47342 kb/s (video + audio)…

When initializing bit_rate in AVCodecContext with an obviously invalid value of 1, dumping the output
format shows:

	Bitrate 1 is extremely low, maybe you mean 1k (warning issued)
	Stream #0:0, 0, 1/90000: Video: mpeg4, yuv420p, 1920x1080, 1/25, q=2-31, 0 kb/s, 90k tbn, 25 tbc

and results in a file with size 35.89 MB for 88.24 seconds which means a bit rate of 3412 kb/s (video + audio)…

So to make it easier to compare:

	set bit_rate = 7257 kb/s -> dumped bit_rate = 7257 kb/s -> result bit_rate = 47628 kb/s (including audio)
	set bit_rate = 0 kb/s -> dumped bit_rate = 200 kb/s -> result bit_rate = 47342 kb/s (including audio)	
	set bit_rate = 1 b/s -> dumped bit_rate = 0 kb/s -> result bit_rate = 3412 kb/s (including audio)

Looks I’m doing something fundamentally wrong here. Any hint on how to influence result file size for mpeg4?
The only other fields I initialize for AVCodecContext are width, height, time_base, pix_fmt,  

Greetings Harald

-
Harald Schlangmann
Antwerpener Str. 52, 50672 Köln, Germany
+49 151 2265 4439
Harry@...
www.gps-laptimer.de

Attachment (smime.p7s): application/pkcs7-signature, 5601 bytes
_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user
Ken Bass | 19 Apr 17:39 2014
Picon

PTS for basic stream encoding and muxing

I have looked at several (up-to-date) examples, and am still confused about how/when to set PTS.

My app is fairly simple: I am capturing audio and video in real time. Each stream - audio and video - are from separate threads, fed through a queue to another thread that encodes and writes them out to a file. Each acquired "frame" (one video frame, or a block of audio samples) is timestamped at capture time, before being queued for encoding/writing. (NOTE: these timestamps are based on the system nanosecond clock).

For each audio block, the timestamps are fairly consistent - previous timestamp + (num_sumples * sample rate), albeit perhaps with some latency; for video, frames are acquired asynchrounously (not at a fixed frame rate) due to the hardware - but again, each frame is still timestamped at acquire time.

My confusion is partly when  to write out each frame/block, and also what to set the PTS for each.

In the muxing example (https://www.ffmpeg.org/doxygen/1.2/doc_2examples_2muxing_8c-example.html), each frame is generated on the fly, with the PTS set to the last PTS plus a fixed value (the expected time between each video frame, based on a defined fixed frame rate).

So what should I set the PTS to for each stream? And do I just encode and write each frame as I get them?

TIA

ken





_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user
Harald Schlangmann | 19 Apr 11:42 2014
Picon

Reasons for "moov atom not found"

HI,

I’m referring to my functions reading in a video, decoding it, applying some manipulations to the
frames, encoding it and writing it to a changed video. Depending on the video length or size or other
factors I’m not yet clear on, the result written is sometimes reported as corrupted. Applying ffprobe,
the message is

	[mov,mp4,m4a,3gp,3g2,mj2  <at>  0x10280a200] moov atom not found
	<some video path>.mp4: Invalid data found when processing input

My observation is the risk this corruption occurs increases with video size (FullHD <at> 1080 in particular)
and video length. 

From reading various threads I understand the “moov atom not found" is an indication the video’s
trailer is not written completely. The sequence I use to close the finished result is:

        int     ret = av_write_trailer (assetWriter->oc);

        if (assetWriter->video_st)
            close_video (assetWriter);

        if (assetWriter->audio_st)
            close_audio (assetWriter);

        if (!(assetWriter->fmt->flags&AVFMT_NOFILE))
            ret = avio_close (assetWriter->oc->pb);

Not shown in the code fragment, I have verified all calls to the av* functions in this sequence are executed
and return zero = Success.

Any idea what the reason for the corruption might be and how to work around? Thanks for your ideas.

Greetings Harald

-
Harald Schlangmann
Antwerpener Str. 52, 50672 Köln, Germany
+49 151 2265 4439
Harry@...
www.gps-laptimer.de

Attachment (smime.p7s): application/pkcs7-signature, 5601 bytes
_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user
Picon

libxvid question

Hello, 
There is an example of use of Interface to xvidcore for encoding MPEG-4 
compliant developed by Adam Thayer?

Regards

Matteo
Picon

Xvid encoding

Hi, 
I am using the ffmpeg libraries to encode a series of images. I started from 
the example provided, but I would encode with XVid codec. 
Can you help me?

Regards

Matteo
Alexander Strasser | 18 Apr 19:46 2014
Picon
Picon

OpenSSL Heartbeat bug


Our server hosting the Trac issue tracker was vulnerable to the attack
against OpenSSL known as "heartbleed". The OpenSSL software library was
updated on 7th of April, shortly after the vulnerability was publicly
disclosed. We have changed the private keys (and certificates) for all
FFmpeg servers. The new SHA1 fingerprints are:

ffmpeg.org:      d0 4c 1f d0 08 f6 e0 24 f0 2c 31 de 4d 01 45 04 32 2e 36 29
trac.ffmpeg.org: 2a 1c d7 a5 7e 39 6a bc c3 55 22 88 ba 2a cd e0 1f c1 9f 6e

We encourage you to read up on "OpenSSL heartbleed"[1]. It is possible
that login data for the issue tracker was exposed to people exploiting
this security hole. You might want to change your password in the tracker
and everywhere else you used that same password.

[1] For example here: https://www.schneier.com/blog/archives/2014/04/heartbleed.html
J Decker | 18 Apr 09:56 2014
Picon

Reading from a stream

I'm attempting to use custom IO.  I have successfully used it to remap fopen, fread, fseek etc.  I have mostly successfully done the same for this network stream...

Question is... It looks like if I supply no seek routine, the custom IO should set a characteristics sort of flag indicating no seek... but without the seek it fails to read the stream; is there a suggested codec/container format to use that doesn't seek to the end or near the end first?

Also, it is given that I should 
avio_alloc_context
foramt_alloc_context
(do something to start opening the file)

use some of the file and call  av_probe_input_format... and finally avformat_open_input with a blank filename....

I notice that open_input with a filename must not do this same step... because, with this sample movie I have, with the probe, the open_input seeks to read the last 8 bytes and then fails indicating a bad format.  If I bypass the probe, or pass it a 0 size, then the avformat_open_input is able to read, but it seeks to the end minus 18k(something)  and reads to the end in 2k blocks... and I'm subsequently able to get audio and sound streams to play... but not if I call the probe_infput_format first...

I'm not sure what the return of the original probe is; but it's 0 when the video loads.

I see that the command line tool is supposed to support pipes (at least on some platforms), so I assume it does a similar thing to build a IO context that doesnt' have seek?

_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user

Best strategy to playback movies that cannot be played back in realtime

Hey there,

so I now wrote my own playback engine using FFMS and it works like a charm.
I was now wondering what would be the best strategy when I want to playback movies that cannot be played back
in realtime?

I have a couple of 4K test clips here which also don’t play properly in ffplay. ffplay hangs on the first
frame and doesn’t advance any further …
VLC and QuickTime however play the movie just fine. 
I don’t know what they do under the hood. All I can think of is that they scale down the movie (I’m not using
a 4K monitor).

I was thinking about skipping frames but if I understood that correctly, that is not the best thing to do as
seeking is rather.
What’s the best strategy when using libav?

Best regards,

Flo
Peter Stevens | 17 Apr 16:50 2014

avcodec_decode_video2

When video is decoded using avcodec_decode_video2 is there an intermediate/internal pixel format that is converted to by default? or is it kept in the original source pixel format? I ask as I need transcode to one raw format as fast as possible and the overhead of sws_scale is becoming a problem.

Thanks,

Peter

 

_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user

Gmane