streamio/streamio-ffmpeg — pull request #48 by vitalis (2013-01-17 09:34:47+00:00)
Title: adds spec for audio only transcoding with ffmpeg 1.0.1

Hi @dbackeus

Using ffmpeg 1.0 and up introduces bug when transcoding to an mp3 output file.

In new versions output log doesn't print ```frame=``` for audio only transcoding.

ffmpeg 0.11.2:
```
frame= 60 fps=9.4 q=0.0 Lsize= 1316kB time=00:00:02.40 bitrate=4493.4kbits/s dup=2 drop=0
```

ffmpeg 1.0:
```
size= 445kB time=00:01:15.84 bitrate= 48.0kbits/s
```

https://github.com/streamio/streamio-ffmpeg/blob/master/lib/ffmpeg/transcoder.rb#L57
each_with_timeout expects ```frame=``` and throws "Process hung" error

This pull request is adding a failing test that reproduces this bug.
I have a solution in mind and would like to hear your opinion.

Instead of using ```frame=``` as a separator the right this is to check for new line, but it can be /r and it can be /n, we not really sure.
So it will be a good idea to use regex as separator.

Unfortunately IO.each doesn't support regex, so we can try and implement our own method that will look something like:
```ruby
buffer = ""
while (byte = io.getbyte) do
buffer << byte
if (buffer =~ sep_string)
last_update = Time.now
yield buffer
buffer = ""
end
end
```