FlvCheck - 检查 Video 文件

Third-party tools are available to create and modify FLV files, but some of the tools create files that do not comply with the FLV standard. Common problems include bad timestamps in the FLV file, invalid onMetaData messages, bad message headers, and corrupted audio and video. The FLVCheck tool can be used to analyze FLV files before they are deployed on Flash Media Server. In addition, the tool can also add or update metadata to reflect file duration correctly. The tool verifies that metadata is readable, specifies an accurate duration, and checks that the FLV file is seekable by Flash Media Server. The tool supports unicode filenames.

Note: The FLVCheck tool does not correct FLV file content corruption. The tool does fix metadata by scanning the Duration and Can Seek To End metadata fields. The tool can then merge the server metadata with the data present in the file.

Checking other video files

Flash Media Server supports playback and recording of H.264-encoded video and HE-AAC-encoded audio within an MPEG-4–based container format. A subset of the MPEG-4 standards are supported. All MP4 files and Adobe F4V files are part of the supported subset.

For MPEG-4–based container formats, use the FLVCheck tool to verify that the server can play back your files.

Note: The FLVCheck tool does not correct corrupted H.264-encoded files or make any other fixes to MP4/F4V files.

Check a video file with the FLVCheck tool

The FLVCheck tool is a command line program; the executable is named flvcheck.

  1. Open your operating system’s command prompt and change directories to RootInstall/tools.
  2. Use the following syntax to run the FLVCheck tool:
    flvcheck [-option] <file ...>

    For example, to check two files:

    flvcheck -f abc.flv ../test/123.flv

    The following table describes the command line options available.

    Option Description
    -f [ --file ] file … Specifies the path to the video file(s) being checked. Relative paths may be used. (Avoid using the “\\xd3 character; try the “/” character instead.)
    -v [--verbose] Sets the verbose flag.
    -V [ --version ] Prints version information.
    -n [ --nobanner ] Turns off header.
    -h [ --help ] Provides a description of options and an example.
    -d [ --duration ] Specifies the margin of error, in seconds, that FLVCheck reports. (The default is 2 seconds.)

    When validating metadata, the absolute difference between metadata_duration and actual_duration is calculated and compared against the margin specified in this command. If the margin is exceeded, the server logs a warning that the metadata duration is incorrect. If the margin has not been exceeded, nothing will be logged.

    To get the exact duration, specify -d 0.

    -q [ --quiet ] Specifies that only the status code, not the text output, be returned. The –help option overrides this option.
    -w [ --warnings] Display warnings.
    -W [--warnings_as_errors] Treat warnings as errors.
    -s [ --fixvideostall ] Fix a stall in video playback (FLV only).
    -u [ --usage ] Displays an example and information about command-line parameters.
    -m [ --fixmeta ] (FLV files only) If a metadata tag is corrupted, creates a new copy of the original FLV file in the same directory as the original, with corrected metadata. (If the file contains no errors, a backup file is not created.) Only the Duration and Can Seek To End metadata fields are corrected.
  3. If the FLVCheck tool finds no errors in the FLV file, the status code returned is 0. If there are one or more errors, a positive number indicating the total number of invalid files found is returned. If a return code of -1 is returned, an invalid command-line parameter was specified.

    Errors and warnings are logged in a log file (stdout).

  4. (FLV files only) If an error is returned from an FLV file due to a metadata error, you can use the tool to try to correct the problem. Try the following:
    1. Use the -m option to try to fix the metadata in the file:
      flvcheck -m <file> [-quiet] [-help]
    2. Use the -d option to change the duration field margin of error. The duration field in the metadata may be inaccurate by a few seconds. For example, flvcheck -f abc.flv -d 5 would allow the metadata duration to be inaccurate +/- 5 seconds.

      Other types of errors cannot be fixed using the FLVCheck tool. MP4/F4V files cannot be fixed using the FLVCheck tool.

FLVCheck errors

If an error is found, the error is logged to the stdout file in the following format: Date, Time, ErrorNumber, ErrorMessage, and FileName. The possible error numbers, types of errors, and messages are as follows.

Error numbers Error type Error messages
-2 General Invalid file system path specified.
-3 General File not found.
-4 General Cannot open file.
-5 General File read error.

Flash Media Server cannot read the file, indicating that the encoding of part or all of the file is not compatible with the codecs that are supported.

-6 General Cannot create corrected file.

This error occurs if you run the tool with the -m option set, but the tool cannot create a file with corrected metadata.

-7 FLV Invalid FLV signature.
-8 FLV Invalid FLV data offset.
-9 FLV Invalid FLV message footer.
-10 FLV Unrecognized message type.
-11 FLV Found backward timestamp.
-12 FLV Unparsable data message.
-13 MP4 File does not contain a movie box.

This error occurs if the MP4 file is empty.

-14 MP4 File does not contain any valid tracks.

This error could occur if the MP4 file contains audio or video encoded with unsupported codecs.

-15 MP4 Too many tracks. Maximum allowed is 64.
-16 MP4 Only one sample type allowed per track.
-17 MP4 Box is too large.
-18 MP4 Truncated box.
-19 MP4 Duplicate box.
-20 MP4 Invalid box version.
-21 MP4 Invalid movie time scale.
-22 MP4 Invalid number of data entries in box.
-23 MP4 Invalid sample size.
-24 MP4 Invalid chapter time.
-25 MP4 Too many tag boxes. Max is 64.
-26 General File appears to be FLV with wrong extension.
-27 MP4 Unsupported DRM scheme.
-28 MP4 Error reading MP4 tables.
-29 MP4 File contains unexpected movie fragments.
-30 MP4 File contains out-of-order movie fragments.

FLVCheck warnings

Generally, warnings are informative and are not fatal errors; Flash Media Server will ignore the error that caused the warning and continue to load and play back the video or audio file, but you may experience problems with playback. Warnings are logged to the stdout file in the following format: Date, Time, Warning Number, Warning Message, and File Name.

Warning number Warning type Message
-100 General Metadata duration is missing or is incorrect.
-101 FLV canSeekToEnd is false.
-102 MP4 Unrecognized box.
-103 MP4 Found incomplete track.
-104 MP4 Found duplicate video track. Ignoring…
-105 MP4 Found duplicate audio track. Ignoring…
-106 MP4 Found duplicate data track. Ignoring…
-107 MP4 Track has unsupported sample type.

Flash Media Server ignores (will not play back) tracks that are encoded with unsupported codecs.

-108 MP4 Invalid video codec.

This warning indicates that a track has an invalid video codec. Flash Media Server cannot play back the track.

-109 MP4 Invalid audio codec.

This warning indicates that a track has an invalid audio codec. Flash Media Server cannot play back the track.

-110 FLV Video may appear stalled due to lack of audio data.
-111 MP4 File has unsupported metadata format.
-112 MP4 Box has extraneous bytes at end.
-113 FLV Video messages found but video flag not set.
-114 FLV Audio messages found but audio flag not set.
-115 FLV Video flag set but no video messages found.
-116 FLV Audio flag set but no audio messages found.
-117 MP4 File is truncated. Will only be partially playable.
-118 MP4 Track contains unsupported edit list.
-119 FLV Missing FLV metadata.
-120 MP4 Bad NellyMoser Frequency. Sample(s) skipped.
-121 MP4 Invalid Track Extends Box.
-122 MP4 Track contains unsupported sample flags.

你可能感兴趣的:(video)