Re: [Libav-user] Scale filter converting to grayscale

2018-04-30 Thread Philippe Gorley

On 2018-04-30 03:44 PM, Carl Eugen Hoyos wrote:

2018-04-30 21:10 GMT+02:00, Philippe Gorley
:


It segfaults when writing the frame. I'm expecting a yuv420p frame


But you are asking the filter chain to output gray.


enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
if ((ret = av_opt_set_int_list(buffersink_ctx, "pix_fmts", pix_fmts,


I guess I should've looked more carefully. Thank you.




Confidentiality Message: This communication (including any files
transmitted with it) is intended solely for the person or entity to
whom it is addressed, and may contain confidential or privileged
information.


Please remove this from mails sent to a public mailing list.

Carl Eugen
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user



Cheers,

--
Philippe Gorley
Free Software Consultant | Montréal, Qc
Savoir-faire Linux
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Scale filter converting to grayscale

2018-04-30 Thread Carl Eugen Hoyos
2018-04-30 21:10 GMT+02:00, Philippe Gorley
:

> It segfaults when writing the frame. I'm expecting a yuv420p frame

But you are asking the filter chain to output gray.

> enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
>if ((ret = av_opt_set_int_list(buffersink_ctx, "pix_fmts", pix_fmts,

> Confidentiality Message: This communication (including any files
> transmitted with it) is intended solely for the person or entity to
> whom it is addressed, and may contain confidential or privileged
> information.

Please remove this from mails sent to a public mailing list.

Carl Eugen
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


[Libav-user] Scale filter converting to grayscale

2018-04-30 Thread Philippe Gorley

Hi,

I'm having trouble getting filters to work correctly. It creates dummy 
YUV frames, scales them using libavfilter, and saves the raw data to 
disk (heavily based on filtering_video.c). The end goal is to use 
libavfilter instead of implementing such things ourselves.


It segfaults when writing the frame. I'm expecting a yuv420p frame, but 
the filtered frame is in grayscale (AV_PIX_FMT_GRAY8), even though I 
specify yuv420p in the filter string (scale=w=200:h=100:dst_format=0).


Here is the code: https://pastebin.com/rNegZcng
I'm on FFmpeg master (commit cae6f806a6367c7760ab6ed059d343d4a8eebd56).

And here are the logs I'm getting:
detected 4 logical cores
[in @ 0x1e41200] Setting 'video_size' to value '320x240'
[in @ 0x1e41200] Setting 'pix_fmt' to value '0'
[in @ 0x1e41200] Setting 'time_base' to value '1/1'
[in @ 0x1e41200] Setting 'pixel_aspect' to value '1/1'
[in @ 0x1e41200] w:320 h:240 pixfmt:yuv420p tb:1/1 fr:0/1 sar:1/1 sws_param:
[Parsed_scale_0 @ 0x1e42280] Setting 'w' to value '200'
[Parsed_scale_0 @ 0x1e42280] Setting 'h' to value '100'
[Parsed_scale_0 @ 0x1e42280] Setting 'dst_format' to value '0'
[Parsed_scale_0 @ 0x1e42280] w:200 h:100 flags:'bilinear' interl:0
[AVFilterGraph @ 0x1e407c0] query_formats: 3 queried, 2 merged, 0 
already done, 0 delayed
[Parsed_scale_0 @ 0x1e42280] w:320 h:240 fmt:yuv420p sar:1/1 -> w:200 
h:100 fmt:gray sar:2/3 flags:0x2
[Parsed_scale_0 @ 0x1e42280] w:320 h:240 fmt:yuv420p sar:0/1 -> w:200 
h:100 fmt:gray sar:0/1 flags:0x2

[swscaler @ 0x1e42f80] bad dst image pointers
Frame scaled from 320x240 to 200x100
Segmentation fault

Backtrace:
#0  __mempcpy_sse2 () at ../sysdeps/x86_64/memcpy.S:196
#1  0x77364242 in _IO_new_file_xsputn (f=0x635430, data=0x0, 
n=0x64) at fileops.c:1319
#2  0x773597bb in __GI__IO_fwrite (buf=0x0, size=0x64, 
count=0x1, fp=0x635430) at iofwrite.c:39
#3  0x0040114b in save_yuv_frame (frame=0x604040, 
frame_number=0x0) at video_filter.c:52
#4  0x00401a4f in main (argc=0x1, argv=0x7fffda48) at 
video_filter.c:203


Any tips on what I'm doing wrong and why libavfilter is converting my 
frame to AV_PIX_FMT_GRAY8?


Cheers,

--
Philippe Gorley
Free Software Consultant | Montréal, Qc
Savoir-faire Linux

Confidentiality Message: This communication (including any files
transmitted with it) is intended solely for the person or entity to
whom it is addressed, and may contain confidential or privileged
information.
The disclosure, distribution or copying of this message is strictly
forbidden. Should you have received this communication in error,
kindly contact the sender promptly, destroy any copies and delete
this message from your computer system.
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Setting up ffmpeg avcodec wiht Qt Linux undefined reference

2018-04-30 Thread Carl Eugen Hoyos
2018-04-30 16:47 GMT+02:00, buff...@mailbox.org :

> im trying to get the example from
> https://www.ffmpeg.org/doxygen/trunk/decode_video_8c-example.html
> running.

Did you test the following?
$ make doc/examples/decode_video

Carl Eugen
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


[Libav-user] Setting up ffmpeg avcodec wiht Qt Linux undefined reference

2018-04-30 Thread buffgix
Hi,

im trying to get the example from 
https://www.ffmpeg.org/doxygen/trunk/decode_video_8c-example.html running.

Im using Qt Creator (C++) with Widgets and compiled ffmpeg manually (Kubuntu 
18.04.0 64 bit).

Unfortunately im getting "undefined reference" errors for every avcodec 
function (e.g. avcodec_send_packet 
https://www.ffmpeg.org/doxygen/trunk/group__lavc__decoding.html#ga58bc4bf1e0ac59e27362597e467efff3
 (dec_ctx, pkt) ...)

I added headers and libs in the qmake file with:

INCLUDEPATH += /home/user/ffmpeg_build/include

LIBS += /home/user/ffmpeg_build/lib/libavcodec.a


I have tried:

extern "C" {
#include 
}

without success.


I attached a file with the "undefined reference" errors.


Kind Regards



undefined_ref_log
Description: Binary data
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user