ivanich has quit [Read error: Connection reset by peer]
Tinos has quit [Quit: Client closed]
Vonter has joined #ffmpeg
gchound has quit [Quit: WeeChat 4.1.2]
ivanich has joined #ffmpeg
ivanich has quit [Remote host closed the connection]
kurosu has quit [Quit: Connection closed for inactivity]
poorboy has quit [Read error: Connection reset by peer]
poorboy has joined #ffmpeg
bitbinge has quit [Ping timeout: 240 seconds]
Ogobaga has quit [Quit: Konversation terminated!]
bitbinge has joined #ffmpeg
Ogobaga has joined #ffmpeg
navi has quit [Quit: WeeChat 4.0.4]
lavaball has quit [Remote host closed the connection]
thilo has quit [Ping timeout: 246 seconds]
thilo has joined #ffmpeg
madwoota has quit [Ping timeout: 244 seconds]
madwoota has joined #ffmpeg
Ogobaga has quit [Quit: Konversation terminated!]
Ogobaga has joined #ffmpeg
gvg has quit [Read error: Connection reset by peer]
LionEagle has joined #ffmpeg
gvg has joined #ffmpeg
LionEagle has quit [Ping timeout: 252 seconds]
minimal has quit [Quit: Leaving]
bitbinge has quit [Ping timeout: 240 seconds]
lemourin has quit [Read error: Connection reset by peer]
lemourin has joined #ffmpeg
FH_thecat has joined #ffmpeg
YuGiOhJCJ has joined #ffmpeg
Vonter has quit [Ping timeout: 260 seconds]
Vonter has joined #ffmpeg
jarthur has joined #ffmpeg
FH_thecat has quit [Remote host closed the connection]
bitbinge has joined #ffmpeg
emmanuelux has quit [Quit: au revoir]
tm512 has quit [Ping timeout: 252 seconds]
FH_thecat has joined #ffmpeg
ishan has quit [Ping timeout: 246 seconds]
atrius has joined #ffmpeg
Sakura`Kinomoto has quit [Read error: Connection reset by peer]
Sakura`Kinomoto has joined #ffmpeg
<atrius>
Hi! I'm trying to live encode a numpy array to a compressed format (h264) to send down the wire. I opened ffmpeg as a subprocess with input/output piped, but I'm having a hang when trying to read stdout. Here's the code: https://gist.github.com/mjlbach/a4cbd2e5d2e08fec9962aa5052328fa9
AbleBacon has quit [Read error: Connection reset by peer]
<aaabbb>
atrius: is the hanging the read() blocking?
<atrius>
Yes
<atrius>
aaabbb: yes*
ishan has joined #ffmpeg
\\Mr_C\\ has joined #ffmpeg
<aaabbb>
atrius: if you have ffmpeg write to stdout with a redirect like >file does it still block? if the read is blocking it means that ffmpeg is not writing anything to stdout
<atrius>
Didn't have a raw video stream laying around but I assume that would be mostly equivalent?
<aaabbb>
i don't think you can use faststart when writing to stdout
waleee has quit [Ping timeout: 245 seconds]
<aaabbb>
because ffmpeg has to do a second pass and re-read the file to move the moov atom to the start
<atrius>
Ah got it, I can remove that one. It seems like it is blocking until stdin closes
<aaabbb>
probably because it's trying to read from stdin and isn't able to, and when it closes it gives up (leaving the moov at the end)
<atrius>
Why wouldn't it be able to read from stdin? I removed faststart
<aaabbb>
because stdin is write only, like imagine a situation where it's piping to another process that only does read()
<atrius>
I'm confused, because I can write to stdin and have it output an mp4. Why would changing the output to stdout affect the writeability of stdin?
<aaabbb>
i meant stdout not stdin
<aaabbb>
i meant that it's trying to read from stdout (because it has to read the file it just wrote in order to move the moov atom)
<atrius>
Is there a way to tell it not to do that? Alternatively is there some solution everyone else is doing for encoding renderer outputs to a compressed video format before webrtc?
<aaabbb>
by not using faststart, it won't have to do a second pass
<atrius>
Right, I removed faststart and it's still hanging
<aaabbb>
does it do that when you aren't using python, when you're just reading and writing to the fs?
<aaabbb>
what you'll want to do is remove as many variables as you can to see if it's actually an ffmpeg issue
<atrius>
No, it's just with python. It didn't hang with faststart on the command line but I assume that's because it first pipes to stdin, closes stdin (which also works in python
<aaabbb>
if doing "cat file | ffmpeg $commands > output" works but the python equivalent doesn't, then i don't think i know how to help because i don't know much python
<atrius>
No worries, I just wanted to better understand piping/ffmpeg to see if there was something unique about using named pipes in python that was causing the trip up
<atrius>
pipes* not named pipes
Sakura`Kinomoto has quit [Ping timeout: 260 seconds]
Sakura`Kinomoto has joined #ffmpeg
emanuele6 has quit [Ping timeout: 245 seconds]
epony has quit [Remote host closed the connection]
bitoff has quit [Ping timeout: 245 seconds]
<atrius>
aaabbb: I didn't solve it but I did figure out the issue
<atrius>
read on python reads until EOF, there's no EOF until stdin is closed so it just tries to read indefinitely
bitbinge has quit [Ping timeout: 240 seconds]
bitoff has joined #ffmpeg
emanuele6 has joined #ffmpeg
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ffmpeg
Vonter has quit [Ping timeout: 245 seconds]
Vonter has joined #ffmpeg
jarthur has quit [Quit: jarthur]
chymera has quit [Remote host closed the connection]
jagannatharjun has joined #ffmpeg
deetwelve has quit [Quit: null]
junaid_ has joined #ffmpeg
markizano has quit [Quit: Poweroff]
lusciouslover has quit [Ping timeout: 260 seconds]