bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.41k stars 1.57k forks source link

how can i insert file stream on the fly use ffmpegFrameRecord #2098

Open xiezichao opened 9 months ago

xiezichao commented 9 months ago

the background is i use javacv ffmpeg to push some file to rtmp address, after i start a FFmpegFrameRecord record loop, i need insert one file when the previous file is push over, how can i do this use javacv; in ffmpeg command, i try "ffmpeg -re -f concat -i "list1.txt" -c:v libx264 -c:a aac -f flv "rtmp://***" and in "list1.txt",i write ffconcat、 file list and another file "list2.txt", and in file list2.txt ,i list some file and "list1.txt"

saudet commented 9 months ago

We don't need to do anything special, just keep calling record(), it should work.

xiezichao commented 9 months ago

thanks to reply. how can i solve the time gap between two file record, the time gap may call disconnect from rtmp server, finally make video pause at rtmp puller.

saudet commented 9 months ago

We can call setTimestamp() to whatever it needs it to be for that.

xiezichao commented 9 months ago

record.setTimestamp()? it means if i calculate timestamp in every frame by frame rate , the stream will be fluency?