0
votes

My problem:

I captured some flv videos with rtmpdump, an example command is this:

rtmpdump -v -r rtmp://aljazeeraflashlivefs.fplive.net/aljazeeraflashlive-live/aljazeera_ara_high -p http://www.elahmad.com/tv/Webtv/Arabian.htm -B 15 -o foo.flv

I realized that not only this command's capture, but all the captures with rtmpdump fails to show the duration when I play the video on a website with flowplayer. This eventually results on failing of streaming, I can not change the playing time.

I did: I tried to open it with Movie Player in Linux and the duration is seen in there.

I also put the video with flvtool2, it failed: flvtool2 -U foo.flv

ERROR: undefined local variable or method 'level' for # ERROR: /usr/lib/ruby/1.8/flv/amf_string_buffer.rb:102:in read__AMF_object' ERROR: /usr/lib/ruby/1.8/flv/amf_string_buffer.rb:132:ineval' ERROR: /usr/lib/ruby/1.8/flv/amf_string_buffer.rb:102:in read__AMF_object' ERROR: /usr/lib/ruby/1.8/flv/amf_string_buffer.rb:132:inread__AMF_data' ERROR: /usr/lib/ruby/1.8/flv/amf_string_buffer.rb:112:in read__AMF_array' ERROR: /usr/lib/ruby/1.8/flv/amf_string_buffer.rb:110:instep' ERROR: /usr/lib/ruby/1.8/flv/amf_string_buffer.rb:110:in read__AMF_array' ERROR: /usr/lib/ruby/1.8/flv/amf_string_buffer.rb:136:inread__AMF_data' ERROR: /usr/lib/ruby/1.8/flv/amf_string_buffer.rb:102:in read__AMF_object' ERROR: /usr/lib/ruby/1.8/flv/amf_string_buffer.rb:132:inread__AMF_data' ERROR: /usr/lib/ruby/1.8/flv/meta_tag.rb:40:in after_initialize' ERROR: /usr/lib/ruby/1.8/flv/tag.rb:56:ininitialize' ERROR: /usr/lib/ruby/1.8/flv/stream.rb:451:in new' ERROR: /usr/lib/ruby/1.8/flv/stream.rb:451:inread_tags' ERROR: /usr/lib/ruby/1.8/flv/stream.rb:58:in initialize' ERROR: /usr/lib/ruby/1.8/flvtool2/base.rb:272:innew' ERROR: /usr/lib/ruby/1.8/flvtool2/base.rb:272:in open_stream' ERROR: /usr/lib/ruby/1.8/flvtool2/base.rb:238:inprocess_files' ERROR: /usr/lib/ruby/1.8/flvtool2/base.rb:225:in each' ERROR: /usr/lib/ruby/1.8/flvtool2/base.rb:225:inprocess_files' ERROR: /usr/lib/ruby/1.8/flvtool2/base.rb:44:in execute!' ERROR: /usr/lib/ruby/1.8/flvtool2.rb:168:inexecute!' ERROR: /usr/lib/ruby/1.8/flvtool2.rb:228 ERROR: /usr/bin/flvtool2:2:in `require' ERROR: /usr/bin/flvtool2:2

Even the metadata seems corrupt. What should I do to fix this duration?

Thanks.

EDIT:

I gave the video to ffmpeg and it recovered:

ffmpeg -i foo.flv bar.flv

However this is only a workaround and i dont get my real answer.

1

1 Answers

0
votes

With the inclusion of librtmpdump into FFMPEG, this function can be done directly in ffmpeg. for the specific file you listed above. You could simply call the URL and pass the stream to a file without re-encoding it. An example would be:

ffmpeg -i rtmp://aljazeeraflashlivefs.fplive.net/aljazeeraflashlive-live/aljazeera_ara_high -vcodec copy -acodec copy ./foo.flv

this is muxing it into .flv container. if you run ffmpeg -i rtmp://aljazeeraflashlivefs.fplive.net/aljazeeraflashlive-live/aljazeera_ara_high you will see that the video has the following:

Stream #0:0: Video: h264 (Main), yuv420p(tv), 640x360 [SAR 1:1 DAR 16:9], 819 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc

Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp, 65 kb/s

So the file is an h264/AAC stream.

That should provide a compliant stream with proper timestamps.