liuzhe02 / bigbluebutton

Automatically exported from code.google.com/p/bigbluebutton
0 stars 0 forks source link

Some webcams are missing from recording #1858

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Occasionally, red5 will not covert over the temporary file (ending in .ser) to 
the final .flv file when a session is finished.  For example:

-rw-rw-r-- 1 red5 red5        0 Dec 14 19:58 640x480-xyz-1418583518222.flv
-rw-rw-r-- 1 red5 red5       32 Dec 14 20:17 640x480-xyz-1418583518222.flv.info
-rw-rw-r-- 1 red5 red5 16198319 Dec 14 20:17 640x480-xyz-1418583518222.flv.ser

What happens next is the record and playback scripts attempt to process the 0 
length .flv file and, as there is no video present, discard it.

The video is in the .ser file.  Ideally, red5 would always create the final 
.flv file.  It's sometimes possible to repair the video file (see attached 
script).

Thanks to Oliver for the sample code.

We want to extend the record and playback scripts to try and repair a partially 
written video file according to the logic before.

#!/bin/bash
FILE=$1
if [ ! -z "$FILE" ] &&  [ -f $FILE ];
then
   if [[ "$FILE" == *.ser ]];
   then
      export RH=/usr/share/red5
      FFMPEGFILENAME=${FILE%.ser}
      cp $FILE $FFMPEGFILENAME-"prered5repair"
      java -cp $RH/red5-server.jar:$RH/lib/red5-io-1.0.4-SNAPSHOT.jar:$RH/lib/slf4j-api-1.7.7.jar:$RH/lib/logback-core-1.1.2.jar:$RH/lib/logback-classic-1.1.2.jar:$RH/lib/mina-core-2.0.8.jar:$RH/lib/ehcache-core-2.5.0.jar org.red5.io.flv.impl.FLVWriter $FILE 0 7
      echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      echo Removing audio stream with ffmpeg
      echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      mv $FFMPEGFILENAME  $FFMPEGFILENAME-"preffmpegrepair"
      ffmpeg -i $FFMPEGFILENAME-"preffmpegrepair" -an -vcodec copy $FFMPEGFILENAME
      echo
      echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      echo Repair process was SUCCESSFUL
      echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      echo You can delete the two backup files ending with -preffmpegrepair and -prered5repair if you want
      echo
   else
      echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      echo ERROR - Filename does not end with .ser !!!
      echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   fi
else
   if [ -z "$FILE" ];
   then
      echo Filename missing ! Format is:  bbbrepair filename  e.g.   bbbrepair broken.flv.ser
   else
      echo ERROR - Filename not found
   fi
fi

Original issue reported on code.google.com by ffdixon@gmail.com on 31 Dec 2014 at 3:06

GoogleCodeExporter commented 8 years ago
We believe this is now fixed with upgrading BigBlueButton's red5 to red5 1.0.4. 

Since the issue was intermittent, we'll close this and re-open if we get 
further reports of webcams not fully written.

Original comment by ffdixon@gmail.com on 5 Jan 2015 at 8:15

GoogleCodeExporter commented 8 years ago
Marking this as accepted again as we going to add this above code to repair 
recordings for greater certainty.  

Original comment by ffdixon@gmail.com on 27 Jan 2015 at 3:32

GoogleCodeExporter commented 8 years ago
Fixed.  See

   https://github.com/bigbluebutton/bigbluebutton/pull/495

This fix will be in the next update to 0.9.0-beta.

Original comment by ffdixon@gmail.com on 27 Jan 2015 at 9:06