Jump to content


Photo

GStreamer 1.0

gstreamer 1.0 openpli

  • Please log in to reply
2520 replies to this topic

Re: GStreamer 1.0 #1841 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 28 October 2015 - 23:17

Yes that's also option and probably better for consistency

Shurely , but why there is no fourcc value by caps made by ffmpeg ?

 

Why does ffmpeg leave the caps into media at the original HD setting for example 1280 x 720 with HD flag, while it well converts the media to MPEG4 with a 800 x 450 value ?

 

And a lot off media has been converted that way (even official media)


Edited by christophecvr, 28 October 2015 - 23:18.


Re: GStreamer 1.0 #1842 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 28 October 2015 - 23:47

Shurely , but why there is no fourcc value by caps made by ffmpeg ?

Look in riff-media.c, also in snippet which I posted, you can see that they are there, but fourcc is not added to caps.

It was already discussed with gstreamer devs, basically they told us, you don't need fourcc, everything is mpeg4-part2, get neccessary info for your decoder from provided caps.

 

It would be sufficient if avidemux would set correctly pts timestamps, and mpeg4parser would after unpacking packed xvid/divx removed dummy frames. There is already solution on the way in our dvbmediasink.

Until then we are adding fourcc caps manually by patching riff-media.c, so we know what is xvid and now also fmp4.


Edited by mx3L, 28 October 2015 - 23:48.


Re: GStreamer 1.0 #1843 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 29 October 2015 - 00:54

 

Shurely , but why there is no fourcc value by caps made by ffmpeg ?

Look in riff-media.c, also in snippet which I posted, you can see that they are there, but fourcc is not added to caps.

It was already discussed with gstreamer devs, basically they told us, you don't need fourcc, everything is mpeg4-part2, get neccessary info for your decoder from provided caps.

 

It would be sufficient if avidemux would set correctly pts timestamps, and mpeg4parser would after unpacking packed xvid/divx removed dummy frames. There is already solution on the way in our dvbmediasink.

Until then we are adding fourcc caps manually by patching riff-media.c, so we know what is xvid and now also fmp4.

 

Ok but at this time what I did (work's fine on vuduo2 and I gues all vu series, pretty shure it will be ok for dm800se also but not on dm8000)

 

Just when then the media comes from ffmpeg there is no fourcc. and if its type FFmpeg MPEG-4  I set media to STREAMTYPE_XVID and it works.

 

On stb You still see the 1280x720 and HD flag. But the video is trully at 800x450 and this is obviousely visible on the video


Edited by christophecvr, 29 October 2015 - 00:56.


Re: GStreamer 1.0 #1844 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 29 October 2015 - 21:16

Shurely , but why there is no fourcc value by caps made by ffmpeg ?

Look in riff-media.c, also in snippet which I posted, you can see that they are there, but fourcc is not added to caps.


@mx3L, this should be ok...

diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c
index 8c01892..74c7706 100644
--- a/gst-libs/gst/riff/riff-media.c
+++ b/gst-libs/gst/riff/riff-media.c
@@ -456,12 +456,18 @@ gst_riff_create_video_caps (guint32 codec_fcc,
     case GST_MAKE_FOURCC ('F', 'M', 'P', '4'):
     case GST_MAKE_FOURCC ('U', 'M', 'P', '4'):
     case GST_MAKE_FOURCC ('F', 'F', 'D', 'S'):
+    {
       caps = gst_caps_new_simple ("video/mpeg",
           "mpegversion", G_TYPE_INT, 4,
           "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
+      gchar *fstr = g_strdup_printf ("%" GST_FOURCC_FORMAT,
+          GST_FOURCC_ARGS (codec_fcc));
+      gst_caps_set_simple (caps, "fourcc", G_TYPE_STRING, fstr, NULL);
+      g_free (fstr);
       if (codec_name)
         *codec_name = g_strdup ("FFmpeg MPEG-4");
       break;
+    }

     case GST_MAKE_FOURCC ('3', 'I', 'V', '1'):
     case GST_MAKE_FOURCC ('3', 'I', 'V', '2'):
@@ -484,12 +490,18 @@ gst_riff_create_video_caps (guint32 codec_fcc,
     case GST_MAKE_FOURCC ('M', 'P', '4', 'V'):
     case GST_MAKE_FOURCC ('m', 'p', '4', 'v'):
     case GST_MAKE_FOURCC ('R', 'M', 'P', '4'):
+    {
       caps = gst_caps_new_simple ("video/mpeg",
           "mpegversion", G_TYPE_INT, 4,
           "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
+      gchar *fstr = g_strdup_printf ("%" GST_FOURCC_FORMAT,
+          GST_FOURCC_ARGS (codec_fcc));
+      gst_caps_set_simple (caps, "fourcc", G_TYPE_STRING, fstr, NULL);
+      g_free (fstr);
       if (codec_name)
         *codec_name = g_strdup ("MPEG-4");
       break;
+    }

     case GST_MAKE_FOURCC ('3', 'i', 'v', 'd'):
     case GST_MAKE_FOURCC ('3', 'I', 'V', 'D'):
---
2.1.0
I'll send a pull request updating 0001-riff-media-added-fourcc-to-all-mpeg4-video-caps.patch in OE soon.
Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: GStreamer 1.0 #1845 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 29 October 2015 - 21:39

@athoik , yes it looks ok



Re: GStreamer 1.0 #1846 MastaG

  • Senior Member
  • 1,531 posts

+118
Excellent

Posted 29 October 2015 - 22:28

So to get this clear in my head :P

 

With the updated patch for riff-media.c above.

Will fix all the issues I was having with low/strange resolution mpeg4 streams?

 

 

So I don't need Christophecvr's latest change: https://github.com/c...aab8f3cc13fdad6

And also I don't need this workaround anymore for the caps which are sent twice (causing black screens on my Zgemma Star)?

--- gstreamer1.0-plugin-multibox-dvbmediasink/gstdvbvideosink.c.orig    2015-09-21 14:14:13.477819103 +0200
+++ gstreamer1.0-plugin-multibox-dvbmediasink/gstdvbvideosink.c 2015-09-21 14:15:24.249857811 +0200
@@ -183,8 +183,7 @@
                "mpegversion = (int) { 1, 2 }, "
                VIDEO_CAPS "; "
 #ifdef HAVE_H264
-       "video/x-h264, "
-               VIDEO_CAPS "; "
+       "video/x-h264; "
 #endif
 #ifdef HAVE_H263
        "video/x-h263, "


Re: GStreamer 1.0 #1847 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 30 October 2015 - 08:51

@athoik & mx3L

 

concerning :

diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c
index 8c01892..74c7706 100644
--- a/gst-libs/gst/riff/riff-media.c
+++ b/gst-libs/gst/riff/riff-media.c
@@ -456,12 +456,18 @@ gst_riff_create_video_caps (guint32 codec_fcc,
     case GST_MAKE_FOURCC ('F', 'M', 'P', '4'):
     case GST_MAKE_FOURCC ('U', 'M', 'P', '4'):
     case GST_MAKE_FOURCC ('F', 'F', 'D', 'S'):
+    {
       caps = gst_caps_new_simple ("video/mpeg",
           "mpegversion", G_TYPE_INT, 4,
           "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
+      gchar *fstr = g_strdup_printf ("%" GST_FOURCC_FORMAT,
+          GST_FOURCC_ARGS (codec_fcc));
+      gst_caps_set_simple (caps, "fourcc", G_TYPE_STRING, fstr, NULL);
+      g_free (fstr);
       if (codec_name)
         *codec_name = g_strdup ("FFmpeg MPEG-4");
       break;
+    }

it's by a switch(value).  But in case off case GST_MAKE_FOURCC ('F', 'M', 'P', '4'):

Nothing will be done, looks like only in case GST_MAKE_FOURCC ('F', 'F', 'D', 'S'): caps are created.

 

Anyway the base media created by ffmpeg does not contain fourcc but well do have the caps in with wrong value for size (with and height) looks like ffmpeg just keeps the caps from the original media in. Converts the video to sd.

for example 1280x720 HD flag.

produces media (avi) 800x450 which is not hd anymore. But leave a cap in media video/mpeg type 4 with 1280 height 720 HD flag. (if default settings off ffmpeg are used)



Re: GStreamer 1.0 #1848 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 30 October 2015 - 09:18

@athoik & mx3L

 

concerning :

diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c
index 8c01892..74c7706 100644
--- a/gst-libs/gst/riff/riff-media.c
+++ b/gst-libs/gst/riff/riff-media.c
@@ -456,12 +456,18 @@ gst_riff_create_video_caps (guint32 codec_fcc,
     case GST_MAKE_FOURCC ('F', 'M', 'P', '4'):
     case GST_MAKE_FOURCC ('U', 'M', 'P', '4'):
     case GST_MAKE_FOURCC ('F', 'F', 'D', 'S'):
+    {
       caps = gst_caps_new_simple ("video/mpeg",
           "mpegversion", G_TYPE_INT, 4,
           "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
+      gchar *fstr = g_strdup_printf ("%" GST_FOURCC_FORMAT,
+          GST_FOURCC_ARGS (codec_fcc));
+      gst_caps_set_simple (caps, "fourcc", G_TYPE_STRING, fstr, NULL);
+      g_free (fstr);
       if (codec_name)
         *codec_name = g_strdup ("FFmpeg MPEG-4");
       break;
+    }

it's by a switch(value).  But in case off case GST_MAKE_FOURCC ('F', 'M', 'P', '4'):

Nothing will be done, looks like only in case GST_MAKE_FOURCC ('F', 'F', 'D', 'S'): caps are created.

 

Why?

 

> cat test.c
#include <stdio.h>
#include <stdlib.h>


int main()
{
   int i = 0;

   while(i<10)
   {
       switch(i)
        case 1:
        case 2:
        case 3:
        {
            printf("i=%i\n",i);
        }
        i++;
   }

}
> gcc test.c && ./a.out
i=1
i=2
i=3

Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: GStreamer 1.0 #1849 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 30 October 2015 - 10:25

Ok now I see wth I missed with the switch as test I did

#include <stdio.h>
#include <stdlib.h>


int main()
{
	int i = 0;

	while(i<10)
	{
		switch(i) {
			case 3:
				printf("i=%i\n",i);
			break;
			case 2:
			case 1:
				printf("i=%i\n",i);
		}
		i++;
	}

}

gcc test.c && ./a.out
i=1
i=2
i=3

As long there is no break it will execute anyway the function if it was a possible case in the switch.

 

So for my temporary work-around due to missing fourcc in media I will add the break as the case 0 is a special case only to be applied if there is a FFmpeg MPEG-4" tag. For the rest it may not be a divx if case is 0.

 

will change that now



Re: GStreamer 1.0 #1850 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 30 October 2015 - 11:45

the dvbmediasink :

 

https://github.com/c...c07b12965eb87a4

 

is adapted.

 

special note off g_free :

 

if

gst_tag_list_get_string(.....);

is used the memory created for the value should be freed after use , but ..

If there is no tag no memory is created , however there still be a string value since it's garanteed not to be NULL or 0.

 

This means : that if i do :

gchar *vcodec_value;
gst_tag_list_get_string (taglist, "video-codec", &vcodec_value);
if(vcodec_value)
{
......;
g_free(vcodec_value);
}

If there was no vide-codec no memory is created but the vcodec_value is not a NULL or 0 string anymore.

Result is a double free or corruption segfault error.

 

 

The boolean must be really used for that. example.

gchar *vcodec_value;
gboolean have_vcodec_value = FALSE;
have_vcodec_value = gst_tag_list_get_string (taglist, "video-codec", &vcodec_value);
if(have_vcode_value)
{
......;
g_free(vcodec_value);
}

Then the memory is freed when not needed anymore whitout the risk of a double free or corruption segfault.


Edited by christophecvr, 30 October 2015 - 11:47.


Re: GStreamer 1.0 #1851 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 30 October 2015 - 12:02

small typo correction in ok example

gchar *vcodec_value;
gboolean have_vcodec_value = FALSE;
have_vcodec_value = gst_tag_list_get_string (taglist, "video-codec", &vcodec_value);
if(have_vcodec_value)
{
......;
g_free(vcodec_value);
}

I noticed that there are other places where this double free correction could occur. But just doesn't by pure cheer luck (cause the case where there is no tag does not occur)



Re: GStreamer 1.0 #1852 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 30 October 2015 - 13:03

special note off g_free :


g_free says there no need to check against NULL.

void g_free (gpointer mem);
Frees the memory pointed to by mem .
If mem is NULL it simply returns, so there is no need to check mem against NULL before calling this function.
 
So multiple calls of g_free will cause no error, right? Can you explain how double free occurs?
Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: GStreamer 1.0 #1853 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 30 October 2015 - 13:15

 

special note off g_free :


g_free says there no need to check against NULL.

void g_free (gpointer mem);
Frees the memory pointed to by mem .
If mem is NULL it simply returns, so there is no need to check mem against NULL before calling this function.
 
So multiple calls of g_free will cause no error, right? Can you explain how double free occurs?

 

If you use:

gchar *vcodec_value;
gst_tag_list_get_string (taglist, "video-codec", &vcodec_value);
if(vcodec_value)
{
......;
g_free(vcodec_value);
}

segfault occurs with thye double free or coruption error message.

 

if I use

 

the gboolean no segfault.

 

Note the segfaults occurs by the second tag event for the media. That one which contain the title.

segafult when playing the media


Edited by christophecvr, 30 October 2015 - 13:20.


Re: GStreamer 1.0 #1854 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 30 October 2015 - 13:21

I will later on create the error again with the logs and code and post it here.



Re: GStreamer 1.0 #1855 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 30 October 2015 - 14:32

Here the result

 

code modified for test to show the segfault:

Test performed on :

vuduo2 with gst-1.6.0 branch gst-1.0 latest enigma2.

	case GST_EVENT_TAG:
	{
		GstTagList *taglist;
		gst_event_parse_tag(event, &taglist);
		gchar *vcodec_value;
		GST_INFO_OBJECT(self,"TAG %"GST_PTR_FORMAT, taglist);
		gboolean have_vcodec_value = FALSE;
		have_vcodec_value = gst_tag_list_get_string (taglist, "video-codec", &vcodec_value);
		if (vcodec_value) // THIS CHANGED FOR TEST
		{
			if(!strncmp(vcodec_value,"FFmpeg MPEG-4", 13) && self->mpeg4_no_fourcc);
			{
				self->stream_type = STREAMTYPE_XVID;
				self->use_dts = TRUE;
#ifdef PACK_UNPACKED_XVID_DIVX5_BITSTREAM
				self->must_pack_bitstream = TRUE;
#endif
				GST_INFO_OBJECT (self, "VIDEO_CODEC = %s set STREAMTYPE_XVID", vcodec_value);
			}
			g_free(vcodec_value);
		}
		ret = GST_BASE_SINK_CLASS(parent_class)->event(sink, event);
		break;
	}

The resulting segfault :

<  4518.686413> [eServiceMP3] state transition NULL -> READY
0:01:10.837839031  5827 0x73a9b660 INFO            dvbvideosink gstdvbvideosink.c:1849:gst_dvbvideosink_change_state:<dvbvideosink0> GST_STATE_CHANGE_NULL_TO_READY
0:01:10.884932438  5827  0x1c32180 INFO            dvbaudiosink gstdvbaudiosink.c:1469:gst_dvbaudiosink_change_state:<dvbaudiosink0> GST_STATE_CHANGE_NULL_TO_READY
0:01:10.907319253  5827  0x1c32180 INFO            dvbvideosink gstdvbvideosink.c:1853:gst_dvbvideosink_change_state:<dvbvideosink0> GST_STATE_CHANGE_READY_TO_PAUSED
0:01:10.951028883  5827  0x1c32180 INFO            dvbaudiosink gstdvbaudiosink.c:1474:gst_dvbaudiosink_change_state:<dvbaudiosink0> GST_STATE_CHANGE_READY_TO_PAUSED
0:01:10.963872142  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:425:gst_dvbvideosink_event:<dvbvideosink0> EVENT stream-start
0:01:10.965223031  5827 0x74554800 INFO            dvbaudiosink gstdvbaudiosink.c:739:gst_dvbaudiosink_event:<dvbaudiosink0> EVENT stream-start
0:01:10.970250105  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:425:gst_dvbvideosink_event:<dvbvideosink0> EVENT caps
0:01:10.970413031  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:1307:gst_dvbvideosink_set_caps:<dvbvideosink0> caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, framerate=(fraction)30000/1001, width=(int)1280, height=(int)720
0:01:10.970581105  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:1365:gst_dvbvideosink_set_caps:<dvbvideosink0> MIMETYPE video/mpeg4 -> STREAMTYPE_MPEG4_Part2
0:01:10.982927809  5827 0x74554800 INFO            dvbaudiosink gstdvbaudiosink.c:739:gst_dvbaudiosink_event:<dvbaudiosink0> EVENT caps
0:01:10.983094994  5827 0x74554800 INFO            dvbaudiosink gstdvbaudiosink.c:453:gst_dvbaudiosink_set_caps:<dvbaudiosink0> MIMETYPE audio/mpeg version 1 layer 3
0:01:10.983185735  5827 0x74554800 INFO            dvbaudiosink gstdvbaudiosink.c:717:gst_dvbaudiosink_set_caps:<dvbaudiosink0> setting dvb mode 0x0a

0:01:10.986781957  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:425:gst_dvbvideosink_event:<dvbvideosink0> EVENT segment
0:01:10.986876364  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:519:gst_dvbvideosink_event:<dvbvideosink0> SEGMENT rate=1.000000 format=3 start=0 pos=0
0:01:10.986948846  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:520:gst_dvbvideosink_event:<dvbvideosink0> SEGMENT DVB TIMESTAMP=0 HEXFORMAT 0x0
0:01:10.987045846  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:425:gst_dvbvideosink_event:<dvbvideosink0> EVENT tag
0:01:10.987101438  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:549:gst_dvbvideosink_event:<dvbvideosink0> TAG taglist, video-codec=(string)"FFmpeg\ MPEG-4";
0:01:10.987202031  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:561:gst_dvbvideosink_event:<dvbvideosink0> VIDEO_CODEC = FFmpeg MPEG-4 set STREAMTYPE_XVID
0:01:10.987477216  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:425:gst_dvbvideosink_event:<dvbvideosink0> EVENT tag
0:01:10.987551920  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:549:gst_dvbvideosink_event:<dvbvideosink0> TAG taglist, comment=(string)"Footage:\ Small\ World\ Productions\,\ Inc\;\ Tourism\ New\ Zealand\ \|\ Producer:\ Gary\ F.\ Spradling\ \|\ Music:\ Steve\ Ball", copyright=(string)"\302\251\ 2008\ Microsoft\ Corporation", title=(string)"Wildlife\ in\ HD", encoder=(string)Lavf57.11.100, container-format=(string)AVI;
0:01:10.987687290  5827 0x74554690 INFO            dvbvideosink gstdvbvideosink.c:561:gst_dvbvideosink_event:<dvbvideosink0> VIDEO_CODEC = FFmpeg MPEG-4 set STREAMTYPE_XVID
0:01:10.999209068  5827 0x74554800 INFO            dvbaudiosink gstdvbaudiosink.c:739:gst_dvbaudiosink_event:<dvbaudiosink0> EVENT segment
0:01:10.999598327  5827 0x74554800 INFO            dvbaudiosink gstdvbaudiosink.c:838:gst_dvbaudiosink_event:<dvbaudiosink0> GST_EVENT_SEGMENT rate=1.000000 format=3 start=0 position=0
0:01:11.000057809  5827 0x74554800 INFO            dvbaudiosink gstdvbaudiosink.c:839:gst_dvbaudiosink_event:<dvbaudiosink0> SEGMENT DVB TIMESTAMP=0 HEX=0x0
0:01:11.000554698  5827 0x74554800 INFO            dvbaudiosink gstdvbaudiosink.c:739:gst_dvbaudiosink_event:<dvbaudiosink0> EVENT tag
0:01:11.000866994  5827 0x74554800 INFO            dvbaudiosink gstdvbaudiosink.c:883:gst_dvbaudiosink_event:<dvbaudiosink0> TAG taglist, audio-codec=(string)"MPEG-1\ layer\ 3";
0:01:11.002023957  5827 0x74554800 INFO            dvbaudiosink gstdvbaudiosink.c:739:gst_dvbaudiosink_event:<dvbaudiosink0> EVENT tag
0:01:11.002270624  5827 0x74554800 INFO            dvbaudiosink gstdvbaudiosink.c:883:gst_dvbaudiosink_event:<dvbaudiosink0> TAG taglist, comment=(string)"Footage:\ Small\ World\ Productions\,\ Inc\;\ Tourism\ New\ Zealand\ \|\ Producer:\ Gary\ F.\ Spradling\ \|\ Music:\ Steve\ Ball", copyright=(string)"\302\251\ 2008\ Microsoft\ Corporation", title=(string)"Wildlife\ in\ HD", encoder=(string)Lavf57.11.100, container-format=(string)AVI;

(enigma2:5827): GStreamer-WARNING **: Trying to set string on taglist field 'title', but string is not valid UTF-8. Please file a bug.
*** Error in `/usr/bin/enigma2': double free or corruption (fasttop): 0x7490b5a8 ***
<  4518.947309> PC: 76dca3ac
<  4518.947430>     00000000 77adb000 00000000 76aac6b0
<  4518.947508>     000016c3 000016c3 00000006 00000000
<  4518.947576>     00000000 76f67000 76d9a000 00000001
<  4518.947636>     76f6cb94 76ef3b48 00000000 00000000
<  4518.947694>     76aac6b0 76f0a000 76f0a000 7fbd77d8
<  4518.947752>     7fbd78c0 00000001 7536c000 76e20080
<  4518.947813>     00000018 76dca340 00000000 00000000
<  4518.947863>     76f0fe30 7fbd7728 7fbd7958 76dcf0ac
<  4518.947910> -------FATAL SIGNAL
<  4522.924456> [gRC] main thread is non-idle! display spinner!
Killed


Re: GStreamer 1.0 #1856 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 30 October 2015 - 14:43

Here the right code same media

	case GST_EVENT_TAG:
	{
		GstTagList *taglist;
		gst_event_parse_tag(event, &taglist);
		gchar *vcodec_value;
		GST_INFO_OBJECT(self,"TAG %"GST_PTR_FORMAT, taglist);
		gboolean have_vcodec_value = FALSE;
		have_vcodec_value = gst_tag_list_get_string (taglist, "video-codec", &vcodec_value);
		if (have_vcodec_value)
		{
			if(!strncmp(vcodec_value,"FFmpeg MPEG-4", 13) && self->mpeg4_no_fourcc);
			{
				self->stream_type = STREAMTYPE_XVID;
				self->use_dts = TRUE;
#ifdef PACK_UNPACKED_XVID_DIVX5_BITSTREAM
				self->must_pack_bitstream = TRUE;
#endif
				GST_INFO_OBJECT (self, "VIDEO_CODEC = %s set STREAMTYPE_XVID", vcodec_value);
			}
			g_free(vcodec_value);
		}
		ret = GST_BASE_SINK_CLASS(parent_class)->event(sink, event);
		break;
	}

The resulting log media plays ok.

<  5726.406240> [eServiceMP3] state transition NULL -> READY
0:01:48.219412490  7162 0x7369b860 INFO            dvbvideosink gstdvbvideosink.c:1849:gst_dvbvideosink_change_state:<dvbvideosink0> GST_STATE_CHANGE_NULL_TO_READY
0:01:48.241314194  7162  0x1c32180 INFO            dvbaudiosink gstdvbaudiosink.c:1469:gst_dvbaudiosink_change_state:<dvbaudiosink0> GST_STATE_CHANGE_NULL_TO_READY
0:01:48.257874194  7162  0x1c32180 INFO            dvbvideosink gstdvbvideosink.c:1853:gst_dvbvideosink_change_state:<dvbvideosink0> GST_STATE_CHANGE_READY_TO_PAUSED
0:01:48.295738268  7162  0x1c32180 INFO            dvbaudiosink gstdvbaudiosink.c:1474:gst_dvbaudiosink_change_state:<dvbaudiosink0> GST_STATE_CHANGE_READY_TO_PAUSED
0:01:48.306200231  7162 0x74153290 INFO            dvbvideosink gstdvbvideosink.c:425:gst_dvbvideosink_event:<dvbvideosink0> EVENT stream-start
0:01:48.306817083  7162 0x74153290 INFO            dvbvideosink gstdvbvideosink.c:425:gst_dvbvideosink_event:<dvbvideosink0> EVENT caps
0:01:48.306972564  7162 0x74153290 INFO            dvbvideosink gstdvbvideosink.c:1307:gst_dvbvideosink_set_caps:<dvbvideosink0> caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, framerate=(fraction)30000/1001, width=(int)1280, height=(int)720
0:01:48.307188046  7162 0x74153290 INFO            dvbvideosink gstdvbvideosink.c:1365:gst_dvbvideosink_set_caps:<dvbvideosink0> MIMETYPE video/mpeg4 -> STREAMTYPE_MPEG4_Part2
0:01:48.314189750  7162 0x74153400 INFO            dvbaudiosink gstdvbaudiosink.c:739:gst_dvbaudiosink_event:<dvbaudiosink0> EVENT stream-start
0:01:48.319090009  7162 0x74153290 INFO            dvbvideosink gstdvbvideosink.c:425:gst_dvbvideosink_event:<dvbvideosink0> EVENT segment
0:01:48.319262972  7162 0x74153290 INFO            dvbvideosink gstdvbvideosink.c:519:gst_dvbvideosink_event:<dvbvideosink0> SEGMENT rate=1.000000 format=3 start=0 pos=0
0:01:48.319421379  7162 0x74153290 INFO            dvbvideosink gstdvbvideosink.c:520:gst_dvbvideosink_event:<dvbvideosink0> SEGMENT DVB TIMESTAMP=0 HEXFORMAT 0x0
0:01:48.319643231  7162 0x74153290 INFO            dvbvideosink gstdvbvideosink.c:425:gst_dvbvideosink_event:<dvbvideosink0> EVENT tag
0:01:48.319794787  7162 0x74153290 INFO            dvbvideosink gstdvbvideosink.c:549:gst_dvbvideosink_event:<dvbvideosink0> TAG taglist, video-codec=(string)"FFmpeg\ MPEG-4";
0:01:48.320100083  7162 0x74153290 INFO            dvbvideosink gstdvbvideosink.c:561:gst_dvbvideosink_event:<dvbvideosink0> VIDEO_CODEC = FFmpeg MPEG-4 set STREAMTYPE_XVID
0:01:48.320448046  7162 0x74153290 INFO            dvbvideosink gstdvbvideosink.c:425:gst_dvbvideosink_event:<dvbvideosink0> EVENT tag
0:01:48.320555157  7162 0x74153290 INFO            dvbvideosink gstdvbvideosink.c:549:gst_dvbvideosink_event:<dvbvideosink0> TAG taglist, comment=(string)"Footage:\ Small\ World\ Productions\,\ Inc\;\ Tourism\ New\ Zealand\ \|\ Producer:\ Gary\ F.\ Spradling\ \|\ Music:\ Steve\ Ball", copyright=(string)"\302\251\ 2008\ Microsoft\ Corporation", title=(string)"Wildlife\ in\ HD", encoder=(string)Lavf57.11.100, container-format=(string)AVI;
0:01:48.321766305  7162 0x74153400 INFO            dvbaudiosink gstdvbaudiosink.c:739:gst_dvbaudiosink_event:<dvbaudiosink0> EVENT caps
0:01:48.322013824  7162 0x74153400 INFO            dvbaudiosink gstdvbaudiosink.c:453:gst_dvbaudiosink_set_caps:<dvbaudiosink0> MIMETYPE audio/mpeg version 1 layer 3
0:01:48.322158416  7162 0x74153400 INFO            dvbaudiosink gstdvbaudiosink.c:717:gst_dvbaudiosink_set_caps:<dvbaudiosink0> setting dvb mode 0x0a

0:01:48.337059601  7162 0x74153400 INFO            dvbaudiosink gstdvbaudiosink.c:739:gst_dvbaudiosink_event:<dvbaudiosink0> EVENT segment
0:01:48.337199749  7162 0x74153400 INFO            dvbaudiosink gstdvbaudiosink.c:838:gst_dvbaudiosink_event:<dvbaudiosink0> GST_EVENT_SEGMENT rate=1.000000 format=3 start=0 position=0
0:01:48.337354379  7162 0x74153400 INFO            dvbaudiosink gstdvbaudiosink.c:839:gst_dvbaudiosink_event:<dvbaudiosink0> SEGMENT DVB TIMESTAMP=0 HEX=0x0
0:01:48.337717342  7162 0x74153400 INFO            dvbaudiosink gstdvbaudiosink.c:739:gst_dvbaudiosink_event:<dvbaudiosink0> EVENT tag
0:01:48.337860046  7162 0x74153400 INFO            dvbaudiosink gstdvbaudiosink.c:883:gst_dvbaudiosink_event:<dvbaudiosink0> TAG taglist, audio-codec=(string)"MPEG-1\ layer\ 3";
0:01:48.338420749  7162 0x74153400 INFO            dvbaudiosink gstdvbaudiosink.c:739:gst_dvbaudiosink_event:<dvbaudiosink0> EVENT tag
0:01:48.338547268  7162 0x74153400 INFO            dvbaudiosink gstdvbaudiosink.c:883:gst_dvbaudiosink_event:<dvbaudiosink0> TAG taglist, comment=(string)"Footage:\ Small\ World\ Productions\,\ Inc\;\ Tourism\ New\ Zealand\ \|\ Producer:\ Gary\ F.\ Spradling\ \|\ Music:\ Steve\ Ball", copyright=(string)"\302\251\ 2008\ Microsoft\ Corporation", title=(string)"Wildlife\ in\ HD", encoder=(string)Lavf57.11.100, container-format=(string)AVI;
<  5726.616349> [eServiceMP3] state transition READY -> PAUSED
<  5726.617925> [eServiceMP3] loading cuesheet
<  5726.618191> [eServiceMP3] cutfile not found!
<  5726.631922> [eServiceMP3] async-done - 1 video, 1 audio, 0 subtitle
<  5726.632215> [eServiceMP3] AUDIO STRUCT=audio/mpeg
<  5726.632506> [eServiceMP3] audio stream=0 codec=MPEG-1 Layer 3 (MP3) language=und

Note the original media was wmv HD 1280x720 .

 

Converted using ffmpeg default settings :

 

ffmpeg -i hdin.wmv out.avi

 

Resulting in a media with resolution 800x450 FFmpeg MPEG-4  codec. (note the caps still has the HD flag and same with as original video)

audio is by me converted by default to mp3.



Re: GStreamer 1.0 #1857 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 30 October 2015 - 16:07

sorry for double post

 

@christophecvr

Maybe I'm wrong but shouldn't you try to first initialize vcodec_value pointer to NULL? Or is it auto-initialized to NULL? I don't see any reason why should "gst_tag_list_get_string" function change where vcode_value points to in case "video-codec" entry is not present in tags.



Re: GStreamer 1.0 #1858 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 30 October 2015 - 16:50

sorry for double post

 

@christophecvr

Maybe I'm wrong but shouldn't you try to first initialize vcodec_value pointer to NULL? Or is it auto-initialized to NULL? I don't see any reason why should "gst_tag_list_get_string" function change where vcode_value points to in case "video-codec" entry is not present in tags.

I did not follow what is the question you mean. But I guess ....

 

Perhaps inititing the pointer always ,... so initiate to NULL. may help , but see manual gst :

http://gstreamer.fre...list-get-string

 

It will be anyway set to a value even if there is no video_codec. However when there is no video-codec the mem alloc is not done. That can be checked by the gboolean off the function.

 

At this time this is needed since there is no fourcc info off the media self. If there would have been fourcc info with

 

FMP4 the fact that's a divx would have been set automatically. (I well already added this option in latest multibox commit for the day that oe core is adapted)

 

But now I just first check the cap

 

If its a cap whitout fourcc :

caps = video/mpeg, mpegversion=(int)4

 

Then the stream type = STREAMTYPE_MPEG4_Part2

Then video_codec is normally also "MPEG-4"

 

The widely used ffmpeg does not set a fourcc well ads video_codec. If the video_codec = "FFmpeg MPEG-4" then it's a divx video-type.

 

That's why I

 

1) check the cap and leave it proceeding normally in case there is no fourcc i just add gboolean TRUE for this media. mpeg4_no_fourcc

 

2) In a later stage we will have the tags. If the no fourcc is trough and there is a video_codec tag FFmpeg MPEG-4 then its a divx media. and I set STREAMTYPE_XVID

    + the xtra's.

 

For the check off the video_codec tag the use off  gst_tag_list_get_string() is needed and so is the g_free after the info has been used and is not needed anymore.


Edited by christophecvr, 30 October 2015 - 16:52.


Re: GStreamer 1.0 #1859 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 30 October 2015 - 17:15

You have this behaviour because the pointer is initialized...
 
#include <stdio.h>
#include <stdlib.h>

void test();

int main()
{
   test();
}
void test(){

   char * a_pointer_not_initialized;

   if (a_pointer_not_initialized)
       printf("A pointer not initialized at %p\n", a_pointer_not_initialized);
   else
      printf("A pointer not initialized that points to NULL!\n");
}

> gcc test.c  && ./a.out
A pointer not initialized at 0x400450
Here is an explanation why this happens: http://stackoverflow...null-by-default

So before we use gst_tag_list_get_string we need to initialize value parameter to NULL.

PS. eServiceMP3::getInfoString has this issue most probably.

Edited by athoik, 30 October 2015 - 17:17.

Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: GStreamer 1.0 #1860 peti

  • Senior Member
  • 115 posts

+1
Neutral

Posted 30 October 2015 - 17:16

guys, a small clarification, where I'm experiencing black screen with resolutions like 720x1280 are h264 files, with fourcc set to avc1. 

 

mediainfo:

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 30s 40ms
Bit rate                                 : 2 000 Kbps
Width                                    : 720 pixels
Height                                   : 1 270 pixels
Display aspect ratio                     : 0.567
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.087
Stream size                              : 7.05 MiB (90%)
Writing library                          : x264 core 142 r2479 dd79a61
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=2000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=62500 / vbv_bufsize=78125 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Encoded date                             : UTC 2036-02-06 06:28:16
Tagged date                              : UTC 2036-02-06 06:28:16
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

   


Edited by petike, 30 October 2015 - 17:16.

T90 | 28.2E-23.5E-19.2E-13E-9E-4.8E-0.8W-4W

Zgemma H7S | OpenPLI develop branch




33 user(s) are reading this topic

0 members, 33 guests, 0 anonymous users