[Libav-user] avcodec_open2 error when running encoding_decodingexample

francesco at bltitalia.com francesco at bltitalia.com
Tue Apr 26 15:06:27 CEST 2016


Hi
I solved setting a flag "Treat enum types as ints" in compiler settings.
I hope this help.
regards

At 12.56 26/04/2016 +0000, you wrote:
>Content-Language: en-US
>Content-Type: multipart/alternative;
>	boundary="_000_CB7EE9D2A0EC8547AA5983AD458E2A671CE64D37umexcdaga05umgw_"
>
>Hi
>
>I was trying to update my application to FFmpeg 3.0 but I couldn't get it work.
>
>To see what was going on I was trying to run the decoding_encoding.c
example, and I keep getting an error, even though I don't change anything
meaningful.
>
>The function returning an error is
>avcodec_open2(c, codec, NULL);
>
>with returned value -22.
>
>On the console I receive the following message:
>Could not open codec
>[libx264 @ 0000000000597180] Specified pixel format -1 is invalid or not
supported
>
>c->pix_fmt is AV_PIX_FMT_YUV420P;
>
>I tried it as well with the latest snapshot, but the error remains. I am
using windows 7 64 bit, the libraries I am using are the ones retrieved from
zeranoe.
>
>Any idea of what am I doing wrong?
>Best,
>
>
>
>
>__________ Informazioni da ESET NOD32 Antivirus, versione del database
delle firme digitali 9892 (20140604) __________
>
>Il messaggio è stato controllato da ESET NOD32 Antivirus.
>
>www.nod32.it
>
><html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">
><head>
><meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
><meta name="Generator" content="Microsoft Word 14 (filtered medium)">
><style><!--
>/* Font Definitions */
>@font-face
>	{font-family:"Cambria Math";
>	panose-1:2 4 5 3 5 4 6 3 2 4;}
>@font-face
>	{font-family:Calibri;
>	panose-1:2 15 5 2 2 2 4 3 2 4;}
>@font-face
>	{font-family:Consolas;
>	panose-1:2 11 6 9 2 2 4 3 2 4;}
>/* Style Definitions */
>p.MsoNormal, li.MsoNormal, div.MsoNormal
>	{margin:0cm;
>	margin-bottom:.0001pt;
>	font-size:11.0pt;
>	font-family:"Calibri","sans-serif";}
>a:link, span.MsoHyperlink
>	{mso-style-priority:99;
>	color:blue;
>	text-decoration:underline;}
>a:visited, span.MsoHyperlinkFollowed
>	{mso-style-priority:99;
>	color:purple;
>	text-decoration:underline;}
>span.EmailStyle17
>	{mso-style-type:personal-compose;
>	font-family:"Calibri","sans-serif";
>	color:windowtext;}
>.MsoChpDefault
>	{mso-style-type:export-only;
>	font-family:"Calibri","sans-serif";}
>@page WordSection1
>	{size:612.0pt 792.0pt;
>	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
>div.WordSection1
>	{page:WordSection1;}
>--></style><!--[if gte mso 9]><xml>
><o:shapedefaults v:ext="edit" spidmax="1026" />
></xml><![endif]--><!--[if gte mso 9]><xml>
><o:shapelayout v:ext="edit">
><o:idmap v:ext="edit" data="1" />
></o:shapelayout></xml><![endif]-->
></head>
><body lang="EN-US" link="blue" vlink="purple">
><div class="WordSection1">
><p class="MsoNormal">Hi<o:p></o:p></p>
><p class="MsoNormal"><o:p> </o:p></p>
><p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas">I
was trying to update my application to FFmpeg 3.0 but I couldn’t get
it work.<o:p></o:p></span></p>
><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
><p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas">To
see what was going on I was trying to run the decoding_encoding.c example,
and I keep getting an error, even though I don’t change anything
meaningful.<o:p></o:p></span></p>
><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:Consolas">The function returning an
error is<o:p></o:p></span></p>
><p class="MsoNormal"><span
style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso
-highlight:white">avcodec_open2(c, codec,
></span><span
style="font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;m
so-highlight:white">NULL</span><span
style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso
-highlight:white">);</span><span
style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
><p class="MsoNormal"><span
style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></
span></p>
><p class="MsoNormal"><span
style="font-size:9.5pt;font-family:Consolas;color:black">with returned value
-22.<o:p></o:p></span></p>
><p class="MsoNormal"><span
style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></
span></p>
><p class="MsoNormal"><span
style="font-size:9.5pt;font-family:Consolas;color:black">On the console I
receive the following message:<o:p></o:p></span></p>
><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:Consolas">Could not open
codec<o:p></o:p></span></p>
><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:Consolas">[libx264 @ 0000000000597180]
Specified pixel format -1 is invalid or not supported<o:p></o:p></span></p>
><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:Consolas">c->pix_fmt is
></span><span
style="font-size:9.5pt;font-family:Consolas;color:darkslategray;background:w
hite;mso-highlight:white">AV_PIX_FMT_YUV420P</span><span
style="font-size:9.5pt;font-family:Consolas;color:darkslategray">;<o:p></o:p
></span></p>
><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:Consolas;color:darkslategray"><o:p>&nbsp
;</o:p></span></p>
><p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas">I
tried it as well with the latest snapshot, but the error remains. I am using
windows 7 64 bit, the libraries I am using are the ones retrieved from
zeranoe.<o:p></o:p></span></p>
><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:Consolas">Any idea of what am I doing
wrong?<o:p></o:p></span></p>
><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:Consolas">Best,<o:p></o:p></span></p>
><p class="MsoNormal"><span
style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
></div>
><BR>
><BR>
>__________ Informazioni da ESET NOD32 Antivirus, versione del database
delle firme digitali 9892 (20140604) __________<BR>
><BR>
>Il messaggio è stato controllato da ESET NOD32 Antivirus.<BR>
><BR>
><A HREF="http://www.nod32.it">www.nod32.it</A><BR>
>
>
></body>
></html>
>_______________________________________________
>Libav-user mailing list
>Libav-user at ffmpeg.org
>http://ffmpeg.org/mailman/listinfo/libav-use
/*******************************************************************\
*    Ing. Francesco  Cuzzocrea
*    company:    BLT Italia srl        web:  http://www.blt.it
*    address:    via Rosselli, 91     city:  Lido di CAMAIORE
*    country:    ITALY                 zip:  55043-i
*      Tel. :    +39 0584 904788       Fax:  +39 0584 904789  
*     e-mail:   francesco at bltitalia.com
\*******************************************************************/


 



More information about the Libav-user mailing list