JP2004007075A - Video image recording apparatus and video image recording method - Google Patents

Video image recording apparatus and video image recording method Download PDF

Info

Publication number
JP2004007075A
JP2004007075A JP2002157993A JP2002157993A JP2004007075A JP 2004007075 A JP2004007075 A JP 2004007075A JP 2002157993 A JP2002157993 A JP 2002157993A JP 2002157993 A JP2002157993 A JP 2002157993A JP 2004007075 A JP2004007075 A JP 2004007075A
Authority
JP
Japan
Prior art keywords
file
recording
video
index
restoration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2002157993A
Other languages
Japanese (ja)
Other versions
JP3984100B2 (en
Inventor
Tatsuya Hayama
羽山 達也
Hideyuki Tsutsumitake
堤竹 秀行
Shigeru Maeda
前田 茂
Takeyuki Kobayashi
小林 丈之
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2002157993A priority Critical patent/JP3984100B2/en
Publication of JP2004007075A publication Critical patent/JP2004007075A/en
Application granted granted Critical
Publication of JP3984100B2 publication Critical patent/JP3984100B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a video image recording device capable of preventing the wasteful consumption of the recording capacity of a video image file and the index file of the video image file and the reproduction error of those files. <P>SOLUTION: The video image recording apparatus is provided with a video image file inspecting and repairing means (115) for inspecting and repairing a video image file, an index file inspecting and repairing means (113) for inspecting and repairing the index file including the index information of the video file, and a recording means (111) for recording the video image file and the index file. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
この発明は、映像記録装置及び映像記録方法に関し、特にMPEG2エンコードされた映像をハードディスクなどの記録媒体に記録する映像記録装置及び映像記録方法に関する。
【0002】
【従来の技術】
近年、地上波TV放送をMPEG2エンコードし、ハードディスクやDVD−RAMディスクへ記録する装置が注目を浴びている。これらの機器に映像を記録する場合、ファイルとして記録されるのが一般的であり、OS(Operating System)としてLinuxなどの汎用のOSを使用した場合には、ファイルシステム(ファイルの管理や書込み、読み込みの制御を行なう部分)もOS付属のファイルシステムを用いることになる。
【0003】
この場合、録画中に停電が発生したりユーザが誤ってACプラグを抜いてしまい強制電源断が発生した場合には、次回の電源投入、OS起動時に、OSのファイルシステムが持つファイル修復機能が働きファイル修復が行われるが、最悪の場合はファイルシステム自体が破壊される場合もありうる。近年のLinuxには、突然の電源断からファイルシステムの不整合や破壊を防ぐ機能を持ったジャーナリングファイルシステムも採用され始めている。
【0004】
【発明が解決しようとする課題】
しかしながら、上記従来技術においてファイルシステムとして修復機能を持ったジャーナリングファイルシステムを用いた場合でも、保証されるのはファイル管理領域(I−node)の整合性のみであり、ファイルに書き込まれるデータ自体は保証されていない。これは、データそのものまで保証するとファイルシステムの書込み速度などの効率が落ちるためである。
【0005】
録画中に電源断が発生した場合の録画対象ファイルのデータの概略を図7に示す。図7に示すように、録画開始から電源断発生までに録画された映像データ長、つまり管理領域が示すファイル長のうち、ファイル途中までは正常なデータであるが、ファイル末尾付近にはランダムなデータが書き込まれてしまう。この現象は、ファイルの長さなどを管理している管理領域部分は2重化などを行なうことにより不整合が発生しないようにしているが、ファイルのデータ自体はOSの書込みバッファおよびハードディスクのライトキャッシュ中に含まれるデータの吐き出しは管理領域の書込みより遅延して行われるためである。
【0006】
また、映像記録装置では、入力映像をMPEG2圧縮した映像ファイルと映像ファイル中のGOP(Group of picture)位置などを保存しているインデックスファイルを同時に書き込んでいる場合が多い。この場合、映像ファイルおよびインデックスファイルの両方のファイル末尾に無意味なデータが存在してしまうことになる。これらのファイルをそのまま再生に用いると、映像ファイルの無意味なデータ部分のデコードは行なえず、記録媒体上の無駄な領域を消費するという問題がある。また、インデックスファイル末尾に無意味なデータが存在すると、ありえないGOP位置を示すことになり再生が全く行なえない可能性もあるなどの問題があった。
【0007】
本発明は、これらの問題点を解決するものであり、映像ファイル及びこの映像ファイルのインデックスファイルによる記録容量の無駄な消費及びこれらファイルの再生エラーを防止することが可能な映像記録装置及び映像記録方法を提供することにある。
【0008】
【課題を解決するための手段】
上記課題を解決し目的を達成するために、この発明の映像記録装置及び映像記録方法は、以下のように構成されている。
【0009】
(1)この発明の映像記録装置は、映像ファイルの検査及び修復を行なう映像ファイル検査修復手段と、前記映像ファイルのインデックス情報を含むインデックスファイルの検査及び修復を行なうインデックスファイル検査修復手段と、前記映像ファイル及び前記インデックスファイルを記録する記録手段とを備えている。
【0010】
(2)この発明の映像記録方法は、映像ファイル及びこの映像ファイルのインデックス情報を含むインデックスファイルの検査及び修復を行い、前記映像ファイル及び前記インデックスファイルを記録する。
【0011】
【発明の実施の形態】
以下、図面を参照しながら本実施の形態について説明する。
【0012】
図1は、この発明の第1の実施形態に係る映像記録装置の概略構成を示す図である。本装置の動作概略は次の通りである。
【0013】
システム制御部102は、ユーザからの指示101を受け取るとともに、各部への制御指示103を出力する。具体的に言うと、まず、システム制御部102は、映像入力選択指示を受け取る。それにより、システム制御部102は、各部へ制御指示103を出力し、入力映像をチューナからの映像またはライン入力からの映像のどちらかに切り替える。次に、システム制御部102は、即ち録画の開始指示を受け取る。システム制御部102は、MPEG2エンコーダ110及び録画制御部111を起動させる。MPEG2エンコーダ部110は、チューナ入力あるいはライン入力のうち選択された方の信号を受け取り、MPEG2圧縮を行い後段へ送出する。録画制御部111が起動されると、インデックスファイル118および映像ファイル117がオープンされ、それぞれのファイル名がファイルシステム120へ通知される。
【0014】
図2は、インデックスファイル118のデータ構造の一例を示す図である。インデックスファイル118は、映像ファイル117のインデックス情報を含む。インデックス情報とは、例えばGOP位置を示す情報である。映像ファイル117には、MPEG2エンコーダ部110から出力されるMPEG2圧縮されたデジタルデータが保存される。録画制御部111はMPEG2エンコーダ110から送信されるMPEG2圧縮されたデータを受け取り、MPEG2ヘッダを調べ、GOP先頭を検出した場合にはインデックスファイル118にファイル先頭からのGOP位置を書き込む。なお、GOP先頭の検出はMPEG2エンコーダ部110からの通知によって行っても構わない。GOP先頭の検出如何にかかわらず、MPEG2圧縮データは映像ファイル117へ書き込まれる。それぞれのファイル書き込みはファイルシステム120を経由して行われる。録画が継続している間はこの処理を継続する。
【0015】
最後に、システム制御部102が、ユーザからの指示101、即ち録画停止指示を受け取ると、MPEG2エンコーダ部110へエンコード停止、録画制御部111へ処理停止を行なう。MPEG2エンコード部110はエンコード停止指示を受け取ると、後段へのデータ送信を中止する。録画制御部111では、録画停止指示を受け取ると、映像ファイル117およびインデックスファイル118のクローズを行なう。
【0016】
この第1の実施形態の映像記録装置は、例えば起動時にシステム制御部102により修復処理が行われる。修復処理の概要フローチャートを図3に示す。システム制御部102は、記憶している全録画タイトルの映像ファイル名とインデックスファイル名の組を取り出す(ST101)。ここでは、全タイトルの修復は終了していないので(ST102、NO)、映像ファイル名とインデックスファイル名の組を一つずつ取り出し(ST103)、インデックスファイル修復部113、相互修復部114、映像ファイル修復部115を順にコールする(ST104、ST105、ST106)。この処理を映像ファイル名とインデックスファイル名の組の全てに対して行なう。
【0017】
まずインデックス修復部113が起動される。図4にインデックス修復部113の処理フローチャートを示す。例えば、インデックスファイルの各GOPの映像ファイル先頭からのオフセット値は8バイトで格納されているとする。この各々の8バイトをレコードと呼び、インデックスファイル中のそれぞれのレコードの値をindex[0], index[1], ....., index[N]と表す。なおNは総レコード長を示す。各レコードの値は、映像ファイル中のGOPの場所を順に格納しているため、単調に増加する。あるレコードの値index[i]よりも次のレコードの値index[i+1]が小さい場合はありえない。まず、インデックス修復部113では、インデックスファイルのファイルサイズを取得し、fSizeへ代入する(ST201)。次に、fSize/8の余りを求め(ST202)、0ならば(ST203、YES)、何も行なわないで次に進む。0以外ならば(ST203、NO)、余りの長さだけインデックスファイルのサイズを切り詰める(ST204)。次に変数Iに0を代入し(ST205)、インデックスファイルより8バイト読み込み、index[0]へ代入する(ST206)。ここからループに入る。インデックスファイルから8バイト読み込み、index[I+1]へ代入する(ST207)。index[I]<index[I+1]ならば(ST208、YES)、Iを1増やす(ST209)。IがN−1より大きい場合に(ST211、NO)、ループを抜け終了し、それ以外の場合はループ先頭(ST207)へ戻る。index[I]≧index[I+1]が成立する場合は(ST208、NO)、異常なデータが書き込まれていると判断し、index[I+1]以降のインデックスファイルを切り捨て(ST210)、修復処理は終了する。インデックス修復部113の処理により、インデックスファイルの各レコードは単調増加していることが保証される。
【0018】
次に相互修復部114が起動される。図5に相互修復部114の処理フローチャートを示す。本実施例では、簡単のために各pack長は2048バイト固定とし、Pack Hader長も14バイト固定する。さらに、GOPの先頭packには必ずSystem Headerが存在するものとする。この構造をもつ場合、各packを調べて15バイト目から18バイト目までのデータが0x00, 0x00,0x01, 0xbb(System Header start code)ならばGOP先頭と判断が可能である。まず変数Iに0を代入する(ST301)。ここからループに入る。インデックスファイルから8バイト読み込み(ST302)、index[0]へ代入する。次に映像ファイルを先頭からindex[0]だけseekし(ST303)、1024バイト読み込み、bufferへ代入する(ST304)。Buffer[14] == 0かつ buffer[15] == 0かつ buffer[16] == 1かつ buffer[17] == 0xbbならば正常GOPと判断し(ST305、YES)、Iを1増やす(ST306)。IがN以上になった場合に(ST307、NO)、ループを抜け終了し、それ以外の場合は(ST307、YES)、ループ先頭(ST302)へ戻る。Buffer[14] != 0または buffer[15] != 0または buffer[16] != 1または buffer[17] != 0xbbの場合は異常GOPと判断し(ST305、NO)、映像ファイルのうちindex[I]以降の部分を削除(ST308)、インデックスファイルのI番目以降のレコードを削除し(ST309)、修正処理を終了する。
【0019】
最後に映像ファイル修復部115が起動される。映像ファイル記録部では最終GOPのみ検査が行われ、MPEG2規格に準拠しているかの詳細な確認を行なう。映像ファイル修復部115の目的は、上記相互修復部114では、GOP先頭部分のみしか確認しないため、最終GOP直前までのGOPについては正当性が保証できるが、最終GOPについてはGOP先頭が存在することしか保証できない。よって、映像ファイル修復部115にて最終GOPの検査が必要になる。例えば、最終GOPが2048バイトの倍数(pack長の倍数)かの判断を行い、pack長の倍数でなければ、余り部分を切り捨てる。
【0020】
映像記録装置において録画実行中に停電などが発生してシステムへの電源供給が絶たれた場合において、既に記録媒体に記録されている映像ファイルおよびインデックスファイルを修復し、壊れた部分および映像ファイルとインデックスファイル間で不整合が発生している部分、不完全なGOPが取り除かれる。これにより、電源断までに録画していたタイトルを出来る限り救うことが出来る。さらに映像ファイルとインデックスファイルの不整合が無くなるため、再生において不具合が発生することも無くなる。また、起動時に録画済の全てのタイトルに対して修復処理が行われるが、この処理により全てのタイトルの整合性が常に保たれることになる。
【0021】
なおインデックスファイルの形式は、上記説明した形式にとらわれるものではない。映像ファイル中の各GOPの位置が何らかの形式で保存されていれば、上記説明した映像記録装置における修復処理が実現可能である。
【0022】
以上説明した映像記録装置は、録画実行中に電源断が発生しても、次回起動時に録画中に電源断が発生したことを検出し、録画対象となっていた映像ファイルおよびインデックスファイルに対して、それぞれファイルの単独修復および相互関係の整合性による修復を行い、映像ファイルおよびインデックスファイル中の異常なデータの切捨てを行い、正常に再生可能なファイルにすることができる。
【0023】
図6は、この発明の第2の実施形態に係る映像記録装置の概略構成を示す図である。本装置の動作概略について、図1に示す映像記録装置と異なる箇所を中心に説明する。
【0024】
この映像記録装置では、システム制御部102がユーザからの録画の開始指示を受け取った場合、システム制御部102は、MPEG2エンコーダ110の起動、及び録画制御部111の起動に加えて、状態記録部112へ「録画中」情報を通知する。状態記録部112では、システム制御部110から受け取った「録画中」情報により、「録画中フラグ」を記録媒体116または不揮発性メモリなどに書き込み、電源断でも情報が失われないようにする。
【0025】
次にユーザからの録画停止指示をシステム制御部102が受け取ると、システム制御部102は状態記録部112へ「録画停止」情報の通知を行なう。状態記録部112では、システム制御部102からの「録画停止」通知を受け取った場合にのみ録画が正常に終了したと判断し、記録媒体116に保持していた「録画中フラグ」をクリアする。このように、「録画中」フラグは、システムで録画を実行している時のみONになっている。
【0026】
上記の録画中の状態の時に、停電が発生したり、ユーザが誤って電源プラグを抜いたりした場合には、システム全体への電源供給が絶たれるため全てのシステムが停止する。その後、初めて電源が投入され、システムが起動した後、システム制御部102は状態制御部112に修復の必要性の問い合わせを行なう。システム制御部102は、記録媒体116または不揮発性メモリに記録している「録画中フラグ」により修復の必要性の可否を判断する。「録画中フラグ」が存在したならば、録画実行中に予期せぬ電源断が発生したと判断して、システム制御部102へ修復要の通知と、修復対象のファイル名の通知を行なう。「録画中フラグ」がクリアされていれば、録画は正常に終了しており修復の必要は無いため、システム制御部102へ修復不要の通知を行なう。
【0027】
システム制御部102は修復要の通知を受け取った場合には、修復対象のファイルのみファイル修復処理を開始する。図6に示す記録再生装置のファイル修復処理は、図1に示す映像記録再生装置のファイル修復処理と同様であり、再度の説明は省略する。
【0028】
この第2の実施形態の映像記録装置により、必要な場合のみ修復処理を起動させることが可能になり、システムの起動が迅速に行なえる。
【0029】
なお、本願発明は、上記実施形態に限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で種々に変形することが可能である。また、各実施形態は可能な限り適宜組み合わせて実施してもよく、その場合組み合わせた効果が得られる。更に、上記実施形態には種々の段階の発明が含まれており、開示される複数の構成要件における適当な組み合わせにより種々の発明が抽出され得る。例えば、実施形態に示される全構成要件からいくつかの構成要件が削除されても、発明が解決しようとする課題の欄で述べた課題が解決でき、発明の効果の欄で述べられている効果が得られる場合には、この構成要件が削除された構成が発明として抽出され得る。
【0030】
【発明の効果】
この発明によれば、映像ファイル及びこの映像ファイルのインデックスファイルによる記録容量の無駄な消費及びこれらファイルの再生エラーを防止することが可能な映像記録装置及び映像記録方法を提供できる。
【図面の簡単な説明】
【図1】この発明の第1の実施形態に係る映像記録装置の概略構成を示すブロック図である。
【図2】インデックスファイルのデータ構造の一例を示す図である。
【図3】映像ファイル及びインデックスファイルの修復処理の概要を示すフローチャートである。
【図4】インデックスファイル修復部によるインデックスファイルの修復処理を示すフローチャートである。
【図5】相互修復部による映像ファイル及びインデックスファイルの修復処理を示すスフローチャートである。
【図6】この発明の第2の実施形態に係る映像記録装置の概略構成を示すブロック図である。
【図7】録画中の電源断の影響を受けた映像ファイルのデータの概略を示す図である。
【符号の説明】
102…システム制御部
110…MPEGエンコーダ
111…録画制御部
112…状態記録部
113…インデックスファイル修復部
114…相互修復部
115…映像ファイル修復部
116…記録媒体
120…ファイルシステム
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a video recording device and a video recording method, and more particularly to a video recording device and a video recording method for recording an MPEG2-encoded video on a recording medium such as a hard disk.
[0002]
[Prior art]
In recent years, devices that encode terrestrial TV broadcasts by MPEG2 and record them on a hard disk or DVD-RAM disk have been receiving attention. When video is recorded on these devices, it is generally recorded as a file. When a general-purpose OS such as Linux is used as an OS (Operating System), a file system (file management, writing, The part for controlling the reading) also uses the file system attached to the OS.
[0003]
In this case, if a power failure occurs during recording or the user accidentally unplugs the AC plug and a forced power off occurs, the file restoration function of the OS file system will be used at the next power on and OS startup. The working file is repaired, but in the worst case, the file system itself may be destroyed. In recent years, Linux has started adopting a journaling file system having a function of preventing inconsistency and destruction of a file system from sudden power-off.
[0004]
[Problems to be solved by the invention]
However, even when a journaling file system having a repair function is used as the file system in the above-described conventional technology, only the consistency of the file management area (I-node) is guaranteed, and the data written to the file itself is not guaranteed. Not guaranteed. This is because if the data itself is guaranteed, the efficiency such as the writing speed of the file system decreases.
[0005]
FIG. 7 shows an outline of data of a recording target file when a power failure occurs during recording. As shown in FIG. 7, of the length of the video data recorded from the start of recording to the occurrence of power interruption, that is, the file length indicated by the management area, the data is normal up to the middle of the file, but random near the end of the file. Data is written. This phenomenon prevents the inconsistency from occurring by duplicating the management area that manages the length of the file, etc., but the data of the file itself is written in the OS write buffer and the hard disk write. This is because the ejection of data included in the cache is performed later than the writing of the management area.
[0006]
In many cases, a video recording apparatus simultaneously writes a video file obtained by compressing an input video by MPEG2 and an index file storing a GOP (Group of Picture) position and the like in the video file. In this case, meaningless data exists at the end of both the video file and the index file. If these files are used for reproduction as they are, the meaningless data portion of the video file cannot be decoded, and there is a problem that a useless area on the recording medium is consumed. Further, if meaningless data exists at the end of the index file, an impossible GOP position is indicated, and there is a problem that reproduction may not be performed at all.
[0007]
The present invention solves these problems, and a video recording apparatus and a video recording apparatus capable of preventing unnecessary consumption of a recording capacity by a video file and an index file of the video file and a reproduction error of the file. It is to provide a method.
[0008]
[Means for Solving the Problems]
In order to solve the above problems and achieve the object, a video recording device and a video recording method of the present invention are configured as follows.
[0009]
(1) A video recording apparatus according to the present invention comprises: a video file inspection / repair unit for inspecting and restoring a video file; an index file inspection / repair unit for examining and restoring an index file including index information of the video file; Recording means for recording the video file and the index file.
[0010]
(2) The video recording method of the present invention performs inspection and restoration of a video file and an index file including index information of the video file, and records the video file and the index file.
[0011]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, the present embodiment will be described with reference to the drawings.
[0012]
FIG. 1 is a diagram showing a schematic configuration of a video recording device according to the first embodiment of the present invention. The outline of the operation of the present apparatus is as follows.
[0013]
The system control unit 102 receives an instruction 101 from a user and outputs a control instruction 103 to each unit. Specifically, first, the system control unit 102 receives a video input selection instruction. Thereby, the system control unit 102 outputs the control instruction 103 to each unit, and switches the input video to either the video from the tuner or the video from the line input. Next, the system control unit 102 receives a recording start instruction. The system control unit 102 activates the MPEG2 encoder 110 and the recording control unit 111. The MPEG2 encoder unit 110 receives a signal selected from the tuner input or the line input, performs MPEG2 compression, and sends the signal to the subsequent stage. When the recording control unit 111 is activated, the index file 118 and the video file 117 are opened, and the respective file names are notified to the file system 120.
[0014]
FIG. 2 is a diagram showing an example of the data structure of the index file 118. The index file 118 includes index information of the video file 117. The index information is, for example, information indicating a GOP position. In the video file 117, MPEG2 compressed digital data output from the MPEG2 encoder unit 110 is stored. The recording control unit 111 receives the MPEG2 compressed data transmitted from the MPEG2 encoder 110, checks the MPEG2 header, and writes the GOP position from the file head into the index file 118 when detecting the GOP head. The GOP head may be detected by a notification from the MPEG2 encoder unit 110. The MPEG2 compressed data is written to the video file 117 regardless of whether the GOP head is detected. Each file writing is performed via the file system 120. This process is continued while the recording is continued.
[0015]
Finally, when receiving the instruction 101 from the user, that is, the recording stop instruction, the system control unit 102 stops encoding to the MPEG2 encoder unit 110 and stops processing to the recording control unit 111. Upon receiving the encoding stop instruction, the MPEG2 encoding unit 110 stops data transmission to the subsequent stage. Upon receiving the recording stop instruction, the recording control unit 111 closes the video file 117 and the index file 118.
[0016]
In the video recording apparatus according to the first embodiment, a restoration process is performed by the system control unit 102 at the time of startup, for example. FIG. 3 shows a schematic flowchart of the restoration process. The system control unit 102 extracts a set of the stored video file names and index file names of all recorded titles (ST101). Here, since the restoration of all the titles has not been completed (NO in ST102), a pair of the video file name and the index file name is extracted one by one (ST103), and the index file restoration unit 113, the mutual restoration unit 114, the video file The repair unit 115 is called in order (ST104, ST105, ST106). This process is performed for all pairs of the video file name and the index file name.
[0017]
First, the index restoration unit 113 is activated. FIG. 4 shows a processing flowchart of the index restoration unit 113. For example, it is assumed that the offset value from the head of the video file of each GOP in the index file is stored in 8 bytes. Each of these 8 bytes is called a record, and the value of each record in the index file is index [0], index [1],. . . . . , Index [N]. N indicates the total record length. The value of each record monotonically increases because the location of the GOP in the video file is stored in order. This is impossible when the value index [i + 1] of the next record is smaller than the value index [i] of a certain record. First, the index restoring unit 113 acquires the file size of the index file and substitutes it for fSize (ST201). Next, the remainder of fSize / 8 is obtained (ST202). If it is 0 (ST203, YES), the process proceeds to the next step without performing any operation. If it is not 0 (ST203, NO), the size of the index file is reduced by the remaining length (ST204). Next, 0 is assigned to the variable I (ST205), 8 bytes are read from the index file, and assigned to index [0] (ST206). Enter the loop from here. Eight bytes are read from the index file and assigned to index [I + 1] (ST207). If index [I] <index [I + 1] (ST208, YES), I is incremented by 1 (ST209). When I is larger than N-1 (ST211, NO), the process exits the loop and ends. Otherwise, the process returns to the beginning of the loop (ST207). If index [I] ≧ index [I + 1] holds (ST208, NO), it is determined that abnormal data has been written, the index file after index [I + 1] is truncated (ST210), and the restoration process ends. I do. The processing of the index restoration unit 113 guarantees that each record of the index file is monotonically increasing.
[0018]
Next, the mutual repair unit 114 is activated. FIG. 5 shows a processing flowchart of the mutual repair unit 114. In this embodiment, for simplicity, the length of each pack is fixed at 2048 bytes, and the length of the pack header is also fixed at 14 bytes. Further, it is assumed that a System Header always exists at the head pack of the GOP. In the case of this structure, it is possible to determine that the GOP is the head of the GOP if the data from the 15th byte to the 18th byte is 0x00, 0x00, 0x01, 0xbb (System Header start code). First, 0 is substituted for the variable I (ST301). Enter the loop from here. 8 bytes are read from the index file (ST302) and assigned to index [0]. Next, the video file is sought by index [0] from the top (ST303), 1024 bytes are read, and assigned to a buffer (ST304). If Buffer [14] == 0 and buffer [15] == 0 and buffer [16] == 1 and buffer [17] == 0xbb, it is determined as a normal GOP (ST305, YES), and I is increased by 1 (ST306). ). When I becomes N or more (ST307, NO), the process exits the loop and ends. Otherwise (ST307, YES), the process returns to the loop head (ST302). Buffer [14]! = 0 or buffer [15]! = 0 or buffer [16]! = 1 or buffer [17]! In the case of = 0xbb, it is determined to be an abnormal GOP (ST305, NO), the portion after index [I] in the video file is deleted (ST308), the record after the Ith in the index file is deleted (ST309), and the correction process is performed. To end.
[0019]
Finally, the video file restoration unit 115 is activated. In the video file recording unit, only the last GOP is checked, and a detailed check is made as to whether or not it conforms to the MPEG2 standard. The purpose of the video file restoration unit 115 is that the mutual restoration unit 114 checks only the top of the GOP, so that the validity of the GOP immediately before the last GOP can be guaranteed, but the top of the GOP exists for the last GOP. Can only be guaranteed. Therefore, the video file restoration unit 115 needs to check the last GOP. For example, it is determined whether the final GOP is a multiple of 2048 bytes (a multiple of the pack length). If the final GOP is not a multiple of the pack length, the remainder is discarded.
[0020]
When the power supply to the system is cut off due to a power failure or the like while recording is being performed on the video recording device, the video file and index file already recorded on the recording medium are restored, and the damaged part and the video file are deleted. The part where the inconsistency occurs between the index files and the incomplete GOP are removed. As a result, it is possible to save the title that was recorded before the power was turned off as much as possible. Further, since there is no inconsistency between the video file and the index file, no trouble occurs during reproduction. Also, at the time of startup, the restoration processing is performed on all the recorded titles, and this processing always keeps the consistency of all the titles.
[0021]
The format of the index file is not limited to the format described above. If the position of each GOP in the video file is stored in some form, the above-described restoration processing in the video recording device can be realized.
[0022]
The video recording apparatus described above detects that power has been lost during recording at the next start-up even if the power has been lost during the execution of recording. In this case, a file can be independently repaired and repaired by consistency of mutual relations, and abnormal data in the video file and the index file can be truncated to make the file playable normally.
[0023]
FIG. 6 is a diagram showing a schematic configuration of a video recording device according to the second embodiment of the present invention. An outline of the operation of the present apparatus will be described focusing on points different from the video recording apparatus shown in FIG.
[0024]
In this video recording apparatus, when the system control unit 102 receives a recording start instruction from the user, the system control unit 102 activates the MPEG2 encoder 110 and the recording control unit 111, and also activates the state recording unit 112. To the “Recording” information. The state recording unit 112 writes the “recording flag” in the recording medium 116 or the nonvolatile memory based on the “recording” information received from the system control unit 110 so that the information is not lost even when the power is turned off.
[0025]
Next, when the system control unit 102 receives a recording stop instruction from the user, the system control unit 102 notifies the status recording unit 112 of “recording stop” information. The state recording unit 112 determines that the recording has been normally completed only when receiving the “recording stop” notification from the system control unit 102, and clears the “recording flag” stored in the recording medium 116. As described above, the “recording” flag is ON only when recording is being performed in the system.
[0026]
If a power failure occurs or the user accidentally removes the power plug during the above-described recording state, the power supply to the entire system is cut off, and all the systems are stopped. Then, after the power is turned on for the first time and the system is started, the system control unit 102 inquires the state control unit 112 of the necessity of restoration. The system control unit 102 determines whether restoration is necessary based on the “recording flag” recorded in the recording medium 116 or the nonvolatile memory. If the "recording flag" is present, it is determined that an unexpected power interruption has occurred during the execution of recording, and a notification of the need for repair and a file name of the file to be repaired are sent to the system control unit 102. If the “recording flag” is cleared, the recording has been completed normally and there is no need for restoration, so that the system controller 102 is notified that restoration is unnecessary.
[0027]
When the system control unit 102 receives the notification of the need for repair, the system control unit 102 starts the file repair process only for the file to be repaired. The file restoration processing of the recording / reproducing apparatus shown in FIG. 6 is the same as the file restoration processing of the video recording / reproducing apparatus shown in FIG.
[0028]
With the video recording device of the second embodiment, the restoration process can be started only when necessary, and the system can be started quickly.
[0029]
It should be noted that the present invention is not limited to the above-described embodiment, and can be variously modified in an implementation stage without departing from the spirit of the invention. In addition, the embodiments may be implemented in appropriate combinations as much as possible, in which case the combined effects can be obtained. Further, the above embodiments include inventions at various stages, and various inventions can be extracted by appropriate combinations of a plurality of disclosed constituent elements. For example, even if some components are deleted from all the components shown in the embodiment, the problem described in the column of the problem to be solved by the invention can be solved, and the effects described in the column of the effect of the invention can be solved. Is obtained, a configuration from which this configuration requirement is deleted can be extracted as an invention.
[0030]
【The invention's effect】
According to the present invention, it is possible to provide a video recording apparatus and a video recording method capable of preventing unnecessary consumption of a recording capacity by a video file and an index file of the video file and a reproduction error of the file.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a schematic configuration of a video recording device according to a first embodiment of the present invention.
FIG. 2 is a diagram illustrating an example of a data structure of an index file.
FIG. 3 is a flowchart illustrating an outline of a restoration process of a video file and an index file.
FIG. 4 is a flowchart illustrating an index file restoration process performed by an index file restoration unit.
FIG. 5 is a flowchart showing a process of repairing a video file and an index file by a mutual repair unit.
FIG. 6 is a block diagram illustrating a schematic configuration of a video recording device according to a second embodiment of the present invention.
FIG. 7 is a diagram showing an outline of data of a video file affected by a power-off during recording.
[Explanation of symbols]
102 system control unit 110 MPEG encoder 111 recording control unit 112 state recording unit 113 index file restoration unit 114 mutual restoration unit 115 video file restoration unit 116 recording medium 120 file system

Claims (6)

映像ファイルの検査及び修復を行なう映像ファイル検査修復手段と、
前記映像ファイルのインデックス情報を含むインデックスファイルの検査及び修復を行なうインデックスファイル検査修復手段と、
前記映像ファイル及び前記インデックスファイルを記録する記録手段と、
を備えたことを特徴とする映像記録装置。
Video file inspection and repair means for inspecting and repairing video files;
Index file inspection and repair means for inspecting and repairing the index file including the index information of the video file,
Recording means for recording the video file and the index file;
A video recording device comprising:
前記映像ファイル及び前記インデックスファイルの相互の整合性検査及び修復を行なう相互検査修復手段を備えたことを特徴とする請求項1に記載の映像記録装置。2. The video recording apparatus according to claim 1, further comprising a mutual inspection and repair unit that performs mutual consistency inspection and repair of the video file and the index file. 前記記録手段による前記映像ファイル及び前記インデックスファイルの記録状態を記録する状態記録手段と、
前記状態記録手段により記録された記録状態に基づき前記映像ファイル及び前記インデックスファイルの修復の必要性を判断し修復を実行させる制御手段と、
を備えたことを特徴とする請求項1又は2に記載の映像記録装置。
State recording means for recording the recording state of the video file and the index file by the recording means,
Control means for determining the necessity of restoration of the video file and the index file based on the recording state recorded by the state recording means and executing the restoration,
The video recording device according to claim 1, further comprising:
映像ファイル及びこの映像ファイルのインデックス情報を含むインデックスファイルの検査及び修復を行い、
前記映像ファイル及び前記インデックスファイルを記録する、
ことを特徴とする映像記録方法。
Inspect and repair the video file and the index file containing the index information of this video file,
Recording the video file and the index file,
A video recording method, characterized in that:
前記映像ファイル及び前記インデックスファイルの検査及び修復に加えて、前記映像ファイル及び前記インデックスファイルの相互の整合性検査及び修復を行なうことを特徴とする請求項4に記載の映像記録方法。5. The video recording method according to claim 4, wherein in addition to the inspection and restoration of the video file and the index file, a mutual consistency inspection and restoration of the video file and the index file are performed. 前記映像ファイル及び前記インデックスファイルの記録時に、これらファイルの記録状態を記録し、
記録された記録状態に基づき前記映像ファイル及び前記インデックスファイルの修復の必要性を判断し修復を実行させる、
ことを特徴とする請求項5又は6に記載の映像記録方法。
When recording the video file and the index file, record the recording state of these files,
Determining the need for restoration of the video file and the index file based on the recorded recording state and causing the restoration to be performed;
7. The video recording method according to claim 5, wherein:
JP2002157993A 2002-05-30 2002-05-30 Video recording apparatus and video recording method Expired - Lifetime JP3984100B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002157993A JP3984100B2 (en) 2002-05-30 2002-05-30 Video recording apparatus and video recording method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002157993A JP3984100B2 (en) 2002-05-30 2002-05-30 Video recording apparatus and video recording method

Publications (2)

Publication Number Publication Date
JP2004007075A true JP2004007075A (en) 2004-01-08
JP3984100B2 JP3984100B2 (en) 2007-09-26

Family

ID=30428558

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002157993A Expired - Lifetime JP3984100B2 (en) 2002-05-30 2002-05-30 Video recording apparatus and video recording method

Country Status (1)

Country Link
JP (1) JP3984100B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006276982A (en) * 2005-03-28 2006-10-12 Fujitsu Ltd File management device, and file management method
WO2007023784A1 (en) * 2005-08-22 2007-03-01 Sony Corporation Recording apparatus, recording method, program, and computer readable recording medium
US20110097058A1 (en) * 2009-10-23 2011-04-28 Vivotek Inc. Method of processing audio-video data
US8006080B2 (en) 2006-12-28 2011-08-23 Sony Corporation Apparatus, method, computer program and recording medium for processing information
TWI399656B (en) * 2009-07-24 2013-06-21 Vivotek Inc Audio and video data processing methods
KR101407166B1 (en) * 2007-06-20 2014-06-13 엘지전자 주식회사 Method for database recovery in digital video recorder

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02143343A (en) * 1988-11-25 1990-06-01 Fujitsu Ltd Robustizing processing system for storing ordinal file
JPH06236307A (en) * 1993-02-08 1994-08-23 Nec Software Ltd Discrimination system for end of file
JP2000324435A (en) * 1999-03-11 2000-11-24 Sony Corp Disk device
JP2001266496A (en) * 2000-01-11 2001-09-28 Hitachi Ltd Unit and method for recording and reproducing information
JP2001312875A (en) * 2000-04-28 2001-11-09 Matsushita Electric Ind Co Ltd Recording and reproducing disk controller and disk device using the controller
JP2002084498A (en) * 2000-06-26 2002-03-22 Matsushita Electric Ind Co Ltd Digital video recording device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02143343A (en) * 1988-11-25 1990-06-01 Fujitsu Ltd Robustizing processing system for storing ordinal file
JPH06236307A (en) * 1993-02-08 1994-08-23 Nec Software Ltd Discrimination system for end of file
JP2000324435A (en) * 1999-03-11 2000-11-24 Sony Corp Disk device
JP2001266496A (en) * 2000-01-11 2001-09-28 Hitachi Ltd Unit and method for recording and reproducing information
JP2001312875A (en) * 2000-04-28 2001-11-09 Matsushita Electric Ind Co Ltd Recording and reproducing disk controller and disk device using the controller
JP2002084498A (en) * 2000-06-26 2002-03-22 Matsushita Electric Ind Co Ltd Digital video recording device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006276982A (en) * 2005-03-28 2006-10-12 Fujitsu Ltd File management device, and file management method
WO2007023784A1 (en) * 2005-08-22 2007-03-01 Sony Corporation Recording apparatus, recording method, program, and computer readable recording medium
US8346064B2 (en) 2005-08-22 2013-01-01 Sony Corporation Recording apparatus, recording method, program and computer-readable recording medium
US8006080B2 (en) 2006-12-28 2011-08-23 Sony Corporation Apparatus, method, computer program and recording medium for processing information
KR101407166B1 (en) * 2007-06-20 2014-06-13 엘지전자 주식회사 Method for database recovery in digital video recorder
TWI399656B (en) * 2009-07-24 2013-06-21 Vivotek Inc Audio and video data processing methods
US20110097058A1 (en) * 2009-10-23 2011-04-28 Vivotek Inc. Method of processing audio-video data
US8340505B2 (en) * 2009-10-23 2012-12-25 Vivotek Inc. Method of processing audio-video data

Also Published As

Publication number Publication date
JP3984100B2 (en) 2007-09-26

Similar Documents

Publication Publication Date Title
US8270813B2 (en) Apparatus, method and computer program for processing information
JP4583270B2 (en) Recording device
US8139927B2 (en) Information recording apparatus and information recording method
JP3984100B2 (en) Video recording apparatus and video recording method
JP3675437B2 (en) Information recording / reproducing apparatus, method, and computer program
US8094993B2 (en) Video recording device, video recording method, video recording program, and integrated circuit
JP2004120365A (en) Video recorder, video reproducing apparatus, and video recording method
JP2006202353A (en) Reproduction device having corrective function of management information of mpeg2 transport stream
US20060013093A1 (en) Content recording apparatus
JP2001045420A (en) Recorder, method and computer-readable storage medium
JP2005301641A (en) Video photographing device
JP4991579B2 (en) Playback device
JP4157884B2 (en) Recording / playback device
JP5453191B2 (en) Video server
JP3815952B2 (en) Video information recording and playback device
JP2006295656A (en) Vide sound recording/reproducing device and video sound recording/reproducing method
JP4228618B2 (en) Recording apparatus and method, reproducing apparatus and method, recording medium, and program
US20100316352A1 (en) Moving picture reproduction apparatus
JP2003259270A (en) Data recorder, image recorder, and data recording method
KR100536698B1 (en) Method for continuously recoding in a vcr/dvd combo system
JPH1093927A (en) Data processing monitor device and data error detecting method
JP2006079736A (en) Optical disk recording device
JP5822603B2 (en) Recording device
JP5712631B2 (en) Video recording apparatus and video recording method
US7821882B2 (en) Recording and reproducing apparatus and recording method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040420

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040427

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040628

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050201

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050404

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060718

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060901

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20070703

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070705

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100713

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100713

Year of fee payment: 3