smem doesn't work with vcodec=I420

This forum is about all development around libVLC.
xylosper
New Cone
New Cone
Posts: 8
Joined: 20 Jul 2009 21:48

smem doesn't work with vcodec=I420

Postby xylosper » 06 Mar 2011 18:49

I'm testing some idea with smem, and noticed a weired thing.
See the next code.

Code: Select all

#include <vlc/vlc.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> typedef unsigned int uint; void cbVideoPrerender(void *p_video_data, uint8_t **pp_pixel_buffer, int size) { printf("video-prerender-callback function works.\n"); fflush(stdout); // Locking *pp_pixel_buffer = (uint8_t*)malloc(size); } void cbVideoPostrender(void *p_video_data, uint8_t *p_pixel_buffer , int width, int height, int pixel_pitch, int size, int64_t pts) { // Unlocking } void cbAudioPrerender(void *p_audio_data, uint8_t** pp_pcm_buffer , uint size) { // Locking *pp_pcm_buffer = (uint8_t*)malloc(size); } void cbAudioPostrender(void* p_audio_data, uint8_t* p_pcm_buffer , uint channels, uint rate, uint nb_samples, uint bits_per_sample, uint size, int64_t pts) { // Unlocking } int main(int argc, char **argv) { if (argc < 2) { printf("Usage: test-smem <file>\n"); return -1; } char smem_options[1000]; sprintf(smem_options , "#transcode{vcodec=I444,acodec=s16l}:smem{" "video-prerender-callback=%lld," "video-postrender-callback=%lld," "audio-prerender-callback=%lld," "audio-postrender-callback=%lld}," , (long long int)(intptr_t)(void*)&cbVideoPrerender , (long long int)(intptr_t)(void*)&cbVideoPostrender , (long long int)(intptr_t)(void*)&cbAudioPrerender , (long long int)(intptr_t)(void*)&cbAudioPostrender); const char *const vlc_args[] = { "-I", "dummy", "--ignore-config", "--extraintf=logger", "--verbose=2", "--sout", smem_options // Stream to memory }; libvlc_instance_t *vlc = libvlc_new(sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args); libvlc_media_player_t *mp = libvlc_media_player_new(vlc); libvlc_media_t *m = libvlc_media_new_path(vlc, argv[1]); libvlc_media_player_set_media(mp, m); libvlc_media_release(m); libvlc_media_player_play(mp); sleep(5); libvlc_media_player_stop (mp); libvlc_media_player_release (mp); libvlc_release (vlc); return 0; }
I tested this code in my MacBook Pro(OSX Snow Leopard).
The above code prints out ""video-prerender-callback function works." in some lines.
However, when I changed the vcodec=I444 to vcodec=I420, it does not output my debugging message in the callback function 'cbVideoPrerender'.
I checked the debugging message from vlc with verbose option, but there's no notable error.
AFAIK, both of I444 and I420 are raw video format. and smem should work with them.
Why is not the callback function called with I420, and how can I make it work?



FYI, I checked the source code of smem.c, and I found like

Code: Select all

switch( p_fmt->i_codec ) { case VLC_CODEC_RGB32: case VLC_CODEC_RGBA: i_bits_per_pixel = 32; break; case VLC_CODEC_I444: case VLC_CODEC_RGB24: i_bits_per_pixel = 24; break; case VLC_CODEC_RGB16: case VLC_CODEC_RGB15: case VLC_CODEC_RGB8: case VLC_CODEC_I422: i_bits_per_pixel = 16; break; case VLC_CODEC_YV12: case VLC_CODEC_I420: i_bits_per_pixel = 12; break; case VLC_CODEC_RGBP: i_bits_per_pixel = 8; break; default: msg_Err( p_stream, "Smem does only support raw video format" ); return NULL; }
so, I think I420 is definitely compitible format.

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: smem doesn't work with vcodec=I420

Postby Rémi Denis-Courmont » 07 Mar 2011 18:42

I'm not sure smem supports planar video chromas.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: smem doesn't work with vcodec=I420

Postby Jean-Baptiste Kempf » 13 Mar 2011 11:57

I am afraid you need to add verbose debug in the code to see where it fails.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

wetneb
Blank Cone
Blank Cone
Posts: 16
Joined: 07 Apr 2010 09:35

Re: smem doesn't work with vcodec=I420

Postby wetneb » 16 Mar 2011 22:25

What would you use in this case ? GDB ?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: smem doesn't work with vcodec=I420

Postby Jean-Baptiste Kempf » 17 Mar 2011 09:16

Or just printfs
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

xylosper
New Cone
New Cone
Posts: 8
Joined: 20 Jul 2009 21:48

Re: smem doesn't work with vcodec=I420

Postby xylosper » 20 Mar 2011 16:48

Thanks for your replys.
I just gave up to using smem.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 6 guests