qw | 29 Jun 04:58 2016

how to parse audio/video information for rtmp protocal

Hi,

FFmpeg has its native rtmp plugin, and also can use rtmpdump instead if enable-librtmp is chosen when building ffmpeg.

I have reviewed rtmp specification, where client and server can notify its peer of audio/video information via metadata message, and of audio/video codec via connect command.

For live-streamming application, what is the common way to get audio/video information, such as bit rate, audio channel number, sample rate, and frame rate? Are there some ffmpeg functions to get those information?

Thanks!

Regards

Andrew


 

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
David Harrison | 29 Jun 04:39 2016
Picon

Analyzing frames WITHOUT deinterlacing.

I have been handed a tool that analyzes frames along with its source code.  The tool uses libav.  

In some cases the video input to this tool is interlaced.   The tool operates just fine, but because my intent is not to render the video but to extract and analyze features from the video I would prefer to analyze the video in a lossless manner.  In other words, I DO NOT want to deinterlace the video.  I would rather operate on half fields.  How would I do this?

I don't see anything specific in the source code related to deinterlacing.

  bool VideoReader::getNextFrame(AVFrame *pFrame) {
    ...
    while( (ret = av_read_frame(pFormatCtx, &packet)) >=0) {
        if(packet.stream_index == videoStreamIndex) {
            // Decode video frame
            avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);
            
            // Did we get a video frame?
            if(frameFinished) {
                // no calls to av
                ...
                av_free_packet(&packet);
                return true;
            }
        }
        
        // Free the packet that was allocated by av_read_frame
        av_free_packet(&packet);
    }

It appears that the deinterlacing happens auto-magically.

--Dave

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
qw | 28 Jun 13:13 2016

how to use two rtmp plugins in ffmpeg

Hi,

ffmpeg has its own built-in rtmp plugin, and also support to use rtmpdump as another rtmp plugin.

How to use specified rtmp plugin, i.e. build-in rtmp plugin or rtmpdump plugin, if rtmpdump is enabled and built within ffmpeg?

Thanks!

Regards

Andrew


 

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Nicholas Stafie | 27 Jun 23:31 2016

Trying to decode, filter and resample audio, but I get more samples than expected

As the subject line says, I'm trying to decode, filter and resample audio. The resampled s16le output would then be used later on.

My problem is: the output I get contains the full song, correctly resampled, but it doesn't stop there and keeps outputting about a minute or so of extra frames. Those extra frames, when played back, sound like a sped up version of the song played in reverse.

Attached is a file with my code, and there will be a direct link to download an audio file for convenience, but this happened with any file I tried no matter the format: http://freepd.com/Electronic/Fall%20Falling.mp3

Compile the file with "gcc main.c -lavformat -lavcodec -lavutil -lavfilter -lswresample -o decoder" and run it like so "./decoder input-file.mp3 > output.bin", as it'll output the PCM frames it decodes to stdout.

This code is written with version 2.8.6 in mind, because that is what's available where I have to host this, but I've tried it on my machine with git version N-80780-gd693392 and I get the same result.

I've tried everything I could think of, but I'm not sure what I did wrong. Thanks in advance for any help!

Attachment (main.c): text/x-csrc, 12 KiB
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Sampsa Riikonen | 27 Jun 13:23 2016
Picon
Picon

hw acceleration api is broken

Hello,

The hw acceleration subsystem is controlled by
AVCodecContext->hwaccel
AVCodecContext->hwaccel_context

Unfortunately, calling

codec=avcodec_find_decoder_by_name("h264_vdpau")
avcodec_alloc_context3(codec)

Does not populate neither "AVCodecContext->hwaccel" nor 
"AVCodecContext->hwaccel_context".

Following these lines ..

http://stackoverflow.com/questions/5985273/using-ffmpeg-hwaccel-from-c

I could maybe use:

libavcodec/utils.c :
static int setup_hwaccel(AVCodecContext *avctx, const enum AVPixelFormat 
fmt, const char *name)

.. but that function is not part of the public api!

So, the questions are:

- Is there an api endpoint to set "AVCodecContext->hwaccel" and 
"AVCodecContext->hwaccel_context" ?
- Is the hw acceleration api just a "scam" and I am supposed to 
implement the calls to vdpau by myself ?
- .. in that case, it would be nice to use libav/ffmpeg for sps and pps 
parsing, but that is again, way out of the api..

Regards,

Sampsa

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Sampsa Riikonen | 25 Jun 15:32 2016
Picon
Picon

libswscale mystery (assertion desc failed)

Hello,

I am passing decoded H264 frames to

sws_getContext
sws_scale

If I use (A) the ffmpeg api as installed from ubuntu repositories (i.e. 
header files and .so files), everything works ok (it's a version from 
Feb.2016)

However, if I (B) install and compile ffmpeg myself (from the latest git 
version) and use my program with this version, then I get:

Assertion desc failed at libswscale/swscale_internal.h:679

I added some logging into the function ..

pixdesc.c: const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum 
AVPixelFormat pix_fmt)

.. to see the "pix_fmt" numerical the function is receiving, and got 
some absurd numbers like 0, 3 (i.e. corresponding to uv420p and RGBA, as 
expected), but also quite randomly
other numbers and finally a large 700+ number.  After this the program 
crashes.

This is a bit obscure, but in any case, any insight is highly appreciated..

Does this look like a memory overflow?
Why is the other library version prone to this error, while the other 
one is not? (the two library versions have different configure parameters)

Regards,

Sampsa

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Gonzalo | 24 Jun 17:29 2016
Picon

FPS incorrect (regression) with new codecpar api


Compiled from HEAD.  muxing example (only one that has been updated to 
new api) compiles and runs fine, but ffprobe returns the following for 
the resulting movie:

Duration: 00:00:10.03, start: 0.000000, bitrate: 289 kb/s
     Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 
352x288, 220 kb/s, 25.10 fps, 25 tbr, 12800 tbn, 50 tbc (default)

Notice it says 25.10 fps instead of just 25 fps as set in the code.

I am seeing the same behavior on my code, with fps that are 25.1603 for 
example.

--

-- 
Gonzalo Garramuño
ggarra13 <at> gmail.com

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
parth.pancholi | 23 Jun 08:21 2016

[livav-users] How to add pixel conversion in libswscale ?

Hi,
I am adding NV12 tiled format support in libswscale. On this 
link
<http://ffmpeg-users.933282.n4.nabble.com/Is-NV12-Tile-format-is-supported-by-ffmpeg-td4676352.html>

it is mentioned that NV12 tiled format is not supported yet. So my question
is,
Where can I add my conversion algorithm in libswscale ?

--
View this message in context: http://libav-users.943685.n4.nabble.com/livav-users-How-to-add-pixel-conversion-in-libswscale-tp4662290.html
Sent from the libav-users mailing list archive at Nabble.com.
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Massimo Battistel | 22 Jun 18:39 2016
Picon

libswscale speed regression

Hi all,
I've recently upgraded an application based on libav*/libsw* to lastest zeranoe builds.
Upgrade was fine, but I've experienced serious speed regressions at runtime (I mean 2x of cpu usage).

Original libs version (2015/02/03 build):

  libavutil      54. 18.100 / 54. 18.100
  libavcodec     56. 21.102 / 56. 21.102
  libavformat    56. 19.100 / 56. 19.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5.  9.103 /  5.  9.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100

Current libs version (2016/06/07 build):

  libavutil      55. 24.100 / 55. 24.100
  libavcodec     57. 45.100 / 57. 45.100
  libavformat    57. 37.101 / 57. 37.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 46.101 /  6. 46.101
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100

From what I can see, speed regression is in libswscale only.
Tipical libswscale usage I do is:
  1. Scaling to various sizes with SWS_BICUBIC enabled;
  2. Converting colorspaces from yuv420p to yuv422 and viceversa.
I've seen there has been a huge refactor in libswscale recently.
  1. Is the speed regression a known issue?
  2. Are there any workarounds available?
  3. Can I expect some optimizations in the near future?

Thanks,
MB

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Sreenath BH | 22 Jun 07:07 2016
Picon

Finding if a MP4 file has moov atom in beginning

Hi All,

We are building a streaming facility and need to check if a given mp4
file has the moov atom in the beginning. (Similar to a file generated
using -movflags +faststart  option in ffmpeg command line tool)

We are opening the media file using avformat_open_input, and get other
information using
avformat_find_stream_info.

But after that I don't know which elements of the input context will
provide information about the location of the moov atom.

Could someone on the list guide me in getting this information?

thanks for any help,
Sreenath
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Venkat | 20 Jun 19:07 2016
Picon

example code with amerge! want to merge two audio files into single file

Hi All,

 I am looking for example code for merging two (mono channel)audio pcm *.au
file into single *.mp3/*.wav (stereo)  file. Please help me example code. I
am facing problem in setting filtering not able to come out of issue. If any
one help with example code that will be great.

I looked for example code/logic in many forums but no luck please help me
here.

Thanks in advance. :)
Regards,
Venkat.

--
View this message in context: http://libav-users.943685.n4.nabble.com/example-code-with-amerge-want-to-merge-two-audio-files-into-single-file-tp4662282.html
Sent from the libav-users mailing list archive at Nabble.com.
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user

Gmane