[vlc-devel] Video format settings
Francois Cartegnie
fcvlcdev at free.fr
Tue Jun 6 18:28:03 CEST 2017
Le 06/06/2017 à 18:10, Francesco, Cuzzocrea a écrit :
> tkv->b_eof = false;
> tkv->b_activated = true;
> tkv->i_rate = 25; // 25 frames per seconds
> tkv->i_scale = 1;
> tkv->i_samplesize = -1;
> tkv->cframe = 0;
> tkv->i_cat = VIDEO_ES;
> tkv->i_codec = VLC_CODEC_UYVY;
> es_format_Init( &fmtv, VIDEO_ES, tkv->i_codec );
No. Once you format_Init(), you erase previous values.
> tkv->i_width_bytes = 1920*2;
> fmtv.i_original_fourcc = VLC_CODEC_JPEG2000; // Original video is JPEG2000
Do not set. That's not supposed for this.
> fmtv.i_id = 0;
Do not set.
> tkv->i_samplesize = 1920*1080*2;
> fmtv.video.i_chroma = vlc_fourcc_GetCodec( VIDEO_ES,tkv->i_codec );
Do not set.
> fmtv.video.i_width = 1920;
> fmtv.video.i_height = 1080;
> fmtv.video.i_visible_width = 1920;
> fmtv.video.i_visible_height = 1080;
> fmtv.video.i_bits_per_pixel = 16; // 8 bits for Luma and 8 for Chroma
Do not set. Check usages of VLC_CODEC_UYVY
> fmtv.video.i_frame_rate =25;
> fmtv.video.i_frame_rate_base = tkv->i_scale;
> fmtv.video.i_sar_num = 1;
> fmtv.video.i_sar_den = 1;
> tkv->i_dv_audio_rate = 0;
???
> fmtv.psz_description = strdup("it");
> tkv->p_es = es_out_Add( dm->out, &fmtv );
> TAB_APPEND( sys->i_track, sys->track, tkv );
> msg_Dbg(obj,"############## Appended video track");
> /* Allocate audio track */
> blt_track_t *tka = calloc( 1, sizeof( blt_track_t ) );
> if( unlikely( !tka ) )
> goto _demux_error;
>
> msg_Dbg(obj,"############## Allocated audio track");
> es_format_t fmta;
>
> tka->b_eof = false;
> tka->b_activated = true;
> tka->i_rate = 48000;
> tka->i_scale =1;
> tka->i_samplesize = 4*2*1920; // 4 channels, 2 Bytes per channel (16
> bit), 1920 sample per frame
> tka->i_codec = WAVE_FORMAT_PCM;
> tka->cframe = 0;
>
> tka->i_cat = AUDIO_ES;
Set below.
See first comment.
> es_format_Init( &fmta, AUDIO_ES, tka->i_codec );
> fmta.i_id = 1;
Do not set.
Francois
More information about the vlc-devel
mailing list