Problem with X264 encoding buffer

This forum is about all development around libVLC.
freesunshine
Blank Cone
Blank Cone
Posts: 32
Joined: 18 Mar 2012 13:37

Problem with X264 encoding buffer

Postby freesunshine » 05 Apr 2012 17:09

I'd like to encode a HD camera(720p) to local file with x264(bitrate = 3000kb,keyint=25,mux=ts), and play it seconds later while still encoding. but i found that the file always 0 kb long until I stopped recording. it seems that the x264 encoder buffered all the encoded frame in memory and wrote to disk until i stopped recording.

when i set x264 profile=high, the situation changed some time but still unstable.

how can I modify the disk writing period?

Any help is much appreciated.

my code:

Code: Select all

vdev_name.Format(":dshow-vdev=%s",v_opt.device_name); opt_out_str.Format(":sout=#transcode{width=%d,height=%d,vcodec=%s,vb=%d,scale=1,fps=%.1f,acodec=%s,ab=%d,channels=2,samplerate=44100}:std{access=file,mux=ts,dst=%s}}", v_opt.input_width,v_opt. input_height, v_opt.vcodec,v_opt.bit_rate,v_opt.fps,a_opt.acodec,a_opt.bit_rate,v_opt.mux_format,opt_tmpfile_str); const char * const vlc_args[] = { "-I", "dumy", // No special interface "--ignore-config", // Don't use VLC's config "--plugin-path=./plugins", "--live-caching=50" }; inst = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args); m = libvlc_media_new_location (inst, "dshow://"); libvlc_media_add_option(m,vdev_name.GetString()); libvlc_media_add_option(m,":sout-x264-keyint=25"); libvlc_media_add_option(m,opt_out_str.GetString()); mp = libvlc_media_player_new_from_media (m); libvlc_media_player_play (mp)

freesunshine
Blank Cone
Blank Cone
Posts: 32
Joined: 18 Mar 2012 13:37

Re: Problem with X264 encoding buffer

Postby freesunshine » 07 Apr 2012 18:41

can somebody help?

freesunshine
Blank Cone
Blank Cone
Posts: 32
Joined: 18 Mar 2012 13:37

Re: Problem with X264 encoding buffer

Postby freesunshine » 08 Apr 2012 10:29

please help!

freesunshine
Blank Cone
Blank Cone
Posts: 32
Joined: 18 Mar 2012 13:37

Re: Problem with X264 encoding buffer

Postby freesunshine » 08 Apr 2012 19:25

solved.audio input error.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 12 guests