rdp / screen-capture-recorder-to-video-windows-free

a free open source windows "screen capture" device and recorder (also allows VLC/ffmpeg and others to capture/stream desktop/audio)
https://github.com/rdp/screen-capture-recorder-to-video-windows-free/releases
Other
2.11k stars 462 forks source link

use FFmpeg+x264+SCR to record, why no video data can be read after 8 minutes ? #72

Closed luckywan closed 7 years ago

luckywan commented 8 years ago

hi,rdp: I have Encountered a problem, i use ffmpeg + x264 to encode the video data and aac-eld to encode the audio data,the beginning,it works normally,but about 8 minutes later,i use following : av_read_frame(pFormatContext_In, &pPacket) ,AVMEDIA_TYPE_VIDEO == pFormatContext_In->streams[pPacket.stream_index]->codec->codec_type , no video data to read ,only the audio data can be read.

the following is my program code: while (av_read_frame(pFormatContext_In, &pPacket) >= 0) {
if (pPacket.stream_index == videoStream) // after 8 minutes , no videoStream { ... } else if(pPacket.stream_index == audioStream) // audioStream works normally { ... } }

can you help me? Best Regards!

rdp commented 8 years ago

does ffmpeg record fine for more than 8min?

On Sun, Apr 17, 2016 at 12:04 AM, luckywan notifications@github.com wrote:

hi,rdp: I have Encountered a problem, i use ffmpeg + x264 to encode the video data and aac-eld to encode the audio data,the beginning,it works normally,but about 8 minutes later,i use following : av_read_frame(pFormatContext_In, &pPacket) ,AVMEDIA_TYPE_VIDEO == pFormatContext_In->streams[pPacket.stream_index]->codec->codec_type , no video data to read ,only the audio data can be read.

the following is my program code: while (av_read_frame(pFormatContext_In, &pPacket) >= 0) {

if (pPacket.stream_index == videoStream) // after 8 minutes , no videoStream { ... } else if(pPacket.stream_index == audioStream) // audioStream works normally { ... } }

can you help me? Best Regards!

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/rdp/screen-capture-recorder-to-video-windows-free/issues/72

luckywan commented 8 years ago

yes,audio data can be read fine,but video data is none.

luckywan commented 8 years ago

while(!exitcapturescreenthread){ if (av_read_frame(pFormatContext_In, &pPacket) >= 0) //read audio and video data {

if (pPacket.stream_index == videoStream) // after 8 minutes , video data is none { ... } else if(pPacket.stream_index == audioStream) // only audio data can be read fine { ... } } }

luckywan commented 8 years ago

The following is my log. V is video data ,the number is frame number. 17155 frame later, i can't read the video data.i think it is not fine from 17141 to 17155,it is only 15 frames,other second is about 30 frames. [17:49:51] V: 17111 [17:49:51] V: 17112 [17:49:51] V: 17113 [17:49:51] V: 17114 [17:49:51] V: 17115 [17:49:51] V: 17116 [17:49:51] V: 17117 [17:49:51] V: 17118 [17:49:51] V: 17119 [17:49:51] V: 17120 [17:49:51] V: 17121 [17:49:51] V: 17122 [17:49:51] V: 17123 [17:49:51] V: 17124 [17:49:51] V: 17125 [17:49:51] V: 17126 [17:49:51] V: 17127 [17:49:51] V: 17128 [17:49:51] V: 17129 [17:49:51] V: 17130 [17:49:51] V: 17131 [17:49:51] V: 17132 [17:49:51] V: 17133 [17:49:51] V: 17134 [17:49:51] V: 17135 [17:49:51] V: 17136 [17:49:51] V: 17137 [17:49:51] V: 17138 [17:49:51] V: 17139 [17:49:51] V: 17140 [17:49:52] V: 17141 [17:49:52] V: 17142 [17:49:52] V: 17143 [17:49:52] V: 17144 [17:49:52] V: 17145 [17:49:52] V: 17146 [17:49:52] V: 17147 [17:49:52] V: 17148 [17:49:52] V: 17149 [17:49:52] V: 17150 [17:49:52] V: 17151 [17:49:52] V: 17152 [17:49:52] V: 17153 [17:49:52] V: 17154 [17:49:52] V: 17155 17:49:53 ------> from here, no video data can be read . [17:51:10] V: 17156 [17:51:10] V: 17157 when i set exitcapturescreenthread= true to exit the while() statement ,i receive two frame video data. so, what is the cause of the problem? my code or ffmpeg or scr ? tks!

luckywan commented 8 years ago

my last_init_config_was is default/from reg read config as: 768x1366 -> 768x1366 (0 top 768 bottom 0 l 1366 r) 60fps, dedupe? 0, millis between dedupe polling 10, m_bReReadRegistry? 0 hwnd:0 my computer is thinkpad T440 ,i5 cpu ,8G RAM.

rdp commented 8 years ago

if you record with ffmpeg command line does it work ok?

On Sun, Apr 17, 2016 at 11:47 PM, luckywan notifications@github.com wrote:

my last_init_config_was is default/from reg read config as: 768x1366 -> 768x1366 (0 top 768 bottom 0 l 1366 r) 60fps, dedupe? 0, millis between dedupe polling 10, m_bReReadRegistry? 0 hwnd:0 my computer is thinkpad T440 ,i5 cpu ,8G RAM.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/rdp/screen-capture-recorder-to-video-windows-free/issues/72#issuecomment-211214345

luckywan commented 8 years ago

It's ok with ffmpeg command line.

rdp commented 8 years ago

what if you capture just video in your own project there? does it continue working?

On Mon, Apr 18, 2016 at 5:39 AM, luckywan notifications@github.com wrote:

It's ok with ffmpeg command line.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/rdp/screen-capture-recorder-to-video-windows-free/issues/72#issuecomment-211341683

luckywan commented 8 years ago

No, the result is the same, several minutes later, no video data can be read.

luckywan commented 8 years ago

is my program code ok in this way? while(!exitcapturescreenthread){ if (av_read_frame(pFormatContext_In, &pPacket) >= 0) //read audio and video data {

if (pPacket.stream_index == videoStream) // after 8 minutes , video data is none { ... } else if(pPacket.stream_index == audioStream) // only audio data can be read fine { ... } } }

rdp commented 8 years ago

I'm not sure about the code, if it starts working it's probably OK. Is the computer display going to sleep per chance? what about receiving from gdigrab instead?

On Mon, Apr 18, 2016 at 9:13 AM, luckywan notifications@github.com wrote:

No, the result is the same, several minutes later, the video data can't be read.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/rdp/screen-capture-recorder-to-video-windows-free/issues/72#issuecomment-211424076

luckywan commented 8 years ago

hi,rdp. a few days ago ,I have solved this problem,this is resource occupation problem. thank you very much.

rdp commented 8 years ago

OK what was the problem/fix, for followers here?

rdp commented 7 years ago

closing no response