JP4254548B2 - Moving image recording apparatus and program - Google Patents
Moving image recording apparatus and program Download PDFInfo
- Publication number
- JP4254548B2 JP4254548B2 JP2004006362A JP2004006362A JP4254548B2 JP 4254548 B2 JP4254548 B2 JP 4254548B2 JP 2004006362 A JP2004006362 A JP 2004006362A JP 2004006362 A JP2004006362 A JP 2004006362A JP 4254548 B2 JP4254548 B2 JP 4254548B2
- Authority
- JP
- Japan
- Prior art keywords
- recording
- data
- image
- recording medium
- moving image
- 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.)
- Expired - Fee Related
Links
Images
Description
本発明は、動画をストリーム記録する機能を備えた動画像記録装置及びプログラムに関する。
The present invention relates to a moving picture imaging apparatus及beauty program having a function of stream recording video.
従来、入力された動画像をリアルタイムで圧縮し、かつ記録媒体に記録するストリーム記録を行う動画像記録装置があり、例えば動画撮影機能を有するデジタルカメラがそれに該当する。係るデジタルカメラでは、記録媒体として着脱自在な各種のメモリカード等が一般に用いられており、動画撮影時(録画時)には、フレーム毎に圧縮された画像データ(フレームデータ)はメモリカード等に順次記録される。また、記録する動画像の品質、すなわち録画品質(ファイン、ノーマル、エコノミー等)をユーザーが予め設定できるものが一般的である。撮影時における動画像の記録(以下、録画)は、複数の録画パラメータ(主に圧縮方式や圧縮率、画像サイズ、フレームレート)に従って行われ、係る録画パラメータの値(内容)は、そのとき設定されている録画品質により固定される。さらに、録画中に一定時間内に処理しなければならないデータ量も録画品質によってほぼ決定される。 2. Description of the Related Art Conventionally, there is a moving image recording apparatus that performs stream recording in which an input moving image is compressed in real time and is recorded on a recording medium, for example, a digital camera having a moving image shooting function. In such digital cameras, various detachable memory cards are generally used as recording media, and image data (frame data) compressed for each frame is stored in a memory card or the like when shooting a movie (recording). Recorded sequentially. In general, the user can set the quality of a moving image to be recorded, that is, the recording quality (fine, normal, economy, etc.) in advance. Recording of moving images at the time of shooting (hereinafter, recording) is performed according to a plurality of recording parameters (mainly compression method, compression rate, image size, frame rate), and the values (contents) of the recording parameters are set at that time. It is fixed according to the recording quality being recorded. Furthermore, the amount of data that must be processed within a certain time during recording is also almost determined by the recording quality.
一方、例えば下記の特許文献1には、デジタルカメラにおいて動画像をストリーム記録する際に、その録画時間を長期化するための方法が記載されている。その方法は、予め内部メモリに複数フレーム分のバッファ領域を確保しておき、フレームデータの内部メモリへの書込み動作と並行して、先に記憶された画像データを読み出してメモリカード等に随時記憶し、かつそのフレームデータを内部メモリから消去する、つまり内部メモリをリングバッファとして使用するというものである。
しかしながら、上記の方法においては内部メモリ(リングバッファ)の容量によって、動画像の記録時間(録画時間)が決まってしまう。そのため、実際に動画データを記録するメモリカードの空き容量にみあった長時間の録画を可能とするには、ユーザーが設定可能な上限の録画品質や、または固定的に設定しておく録画品質を、使用されるメモリカード等へのデータの書き込み速度に合わせておくこととなる。 However, in the above method, the moving image recording time (recording time) is determined by the capacity of the internal memory (ring buffer). Therefore, in order to be able to record for a long time according to the free space of the memory card that actually records the video data, the recording quality of the upper limit that can be set by the user or the recording quality that is fixedly set Is matched with the data writing speed to the memory card or the like to be used.
ところが、前述したように録画中において一定時間内に処理しなければならないデータ量は録画品質によってほぼ決定されるが、撮像される画像の内容によって変動する。また、メモリカード等に対するデータの書き込み速度も、それが同一規格のメディアであっても製造メーカー毎にバラツキがあり、しかも空き容量や、データが記録される領域の違い、さらにはシステムの電源電圧の変化等の実使用環境によっても変化するため、必ずしも一定ではない。 However, as described above, the amount of data that must be processed within a certain time during recording is substantially determined by the recording quality, but varies depending on the content of the image to be captured. In addition, the writing speed of data to memory cards, etc. varies from manufacturer to manufacturer even if the media is the same standard, and the available capacity, the difference in the area where data is recorded, and the power supply voltage of the system Since it changes depending on the actual use environment such as changes in
係ることから、ユーザーが設定可能な上限の録画品質や、または固定的に設定しておく録画品質をメモリカード等の種類に応じて決めておいたとしても、一定時間内に処理しなければならないデータ量が大幅に増大したり、メモリカード等へのデータ書込み速度が大きく低下したりすることに起因して、フレームデータの書き込み処理が間に合わなくなり録画処理が時間的に破綻し、その結果、画像と音声の同期がズレたり、不正なデータを書き込んだりするといった事態の発生が懸念される。したがって、メモリカード等の空き容量にみあった長時間の録画を可能とするには、ユーザーが設定可能な録画品質の上限や、固定的に設定しておく録画品質を自ずと予め低めに決めておかなければならないという問題があった。 Therefore, even if the upper limit recording quality that can be set by the user or the recording quality that is fixedly set is determined according to the type of memory card etc., it must be processed within a certain time Due to the large increase in data volume and the significant decrease in data writing speed to memory cards, etc., the frame data writing process will not be in time and the recording process will fail in time. There is concern about the occurrence of situations such as out-of-synchronization of voice and writing illegal data. Therefore, in order to enable recording for a long time based on the free space of the memory card, etc., the upper limit of the recording quality that can be set by the user and the recording quality that is fixedly set are set to be low in advance. There was a problem that had to be left.
本発明は、かかる従来の課題に鑑みてなされたものであり、データ書き込み速度のバラツキや、使用状態の影響を受けることなく、記録媒体の空き容量にみあった長時間の動画像をより高品質で記録することができる動画像記録装置及び、その実現に使用されるプログラムを提供することを目的とする。
The present invention has been made in view of the above-described conventional problems, and it is possible to increase a moving image for a long time corresponding to the free capacity of a recording medium without being affected by variations in data writing speed and usage conditions. moving picture recording apparatus及beauty can be recorded in quality, and to provide a program used for its implementation.
前記課題を解決するため請求項1の発明にあっては、動画像を構成する画像データを所定のフレーム周期で画像処理しながら記録媒体に順次記録する動画像記録装置において、前記記録媒体への画像処理後の画像データの書込み処理に、動画像の正常な記録を阻害する遅れが生じているか否かを判断する判断手段と、この判断手段により前記遅れが生じていると判断されたとき、前記記録媒体に対する書き込みデータ量を減少させる調整手段と、を備え、前記調整手段は、前記判断手段により前記遅れが生じていると判断されたとき、前記記録媒体に対する次のフレームの画像処理後の画像データの書込み処理を中止させる中止手段を含み、その中止手段により書込み処理が中止された画像データに基づく画像に代えて、当該画像データのフレームの前後いずれかのフレームと同一内容の画像を再生させるための所定情報を前記記録媒体に記録させるものとした。 In order to solve the above-mentioned problem, in the invention of claim 1, a moving image recording apparatus for sequentially recording image data constituting a moving image on a recording medium while performing image processing at a predetermined frame period. When it is determined that the delay has occurred in the writing process of the image data after the image processing, and whether or not the delay that hinders the normal recording of the moving image has occurred, Adjusting means for reducing the amount of data to be written to the recording medium, and when the determining means determines that the delay has occurred, the adjusting means after image processing of the next frame on the recording medium Including a canceling unit for canceling the writing process of the image data. Instead of the image based on the image data for which the writing process was canceled by the canceling unit, the image data The predetermined information for playing an image of one frame having the same content before and after chromatography beam was assumed to be recorded on the recording medium.
請求項2の発明にあっては、前記調整手段は、この判断手段により前記遅れが生じていると判断されたとき、所定の録画パラメータを変更させることにより、前記記録媒体に対する書き込みデータ量を減少させるものとした。 According to a second aspect of the present invention, the adjusting means reduces the amount of data written to the recording medium by changing a predetermined recording parameter when the determining means determines that the delay has occurred. It was supposed to be
請求項3の発明にあっては、動画像を構成する画像データを所定のフレーム周期で画像処理しながら記録媒体に順次記録する動画像記録装置が有するコンピュータを、前記記録媒体に対する新たな画像処理後の画像データの書込み時点で、1つ前の画像処理後の画像データが書き込み中であったとき、前記記録媒体への画像処理後の画像データの書込み処理に、動画像の正常な記録を阻害する遅れが生じているか否かを判断する判断手段、この判断手段により前記遅れが生じていると判断されたとき、前記記録媒体に対する書き込みデータ量を減少させる調整手段、として機能させるものとした。 According to a third aspect of the present invention , a new image processing for a recording medium includes a computer having a moving image recording apparatus that sequentially records image data constituting a moving image on a recording medium while performing image processing at a predetermined frame period. When the image data after the previous image processing is being written at the time of writing the subsequent image data, normal recording of the moving image is performed in the writing processing of the image data after the image processing to the recording medium. A judgment means for judging whether or not a delay to inhibit has occurred, and when this judgment means judges that the delay has occurred, it functions as an adjustment means for reducing the amount of data written to the recording medium. .
本発明によれば、動画像の記録中に、記録媒体への画像処理後の画像データの記録動作に動画像の正常な記録を阻害する遅れが生じたときであっても、書き込みデータ量を減少させることにより、正常な動画記録を維持したままで、録画処理が時間的に破綻することが防止できるようにした。そのため、ユーザーが設定可能な録画品質の上限や、固定的に設定しておく録画品質を高めにすることができる。よって、データ書き込み速度のバラツキや、使用状態の影響を受けることなく、記録媒体の空き容量にみあった長時間の動画像をより高品質で記録することが可能となる。
According to the present invention, during recording of a moving image, even when there is a delay that hinders normal recording of a moving image in the recording operation of image data after image processing on a recording medium, the amount of write data is reduced. By reducing the number, the video recording process can be prevented from failing in time while maintaining normal video recording. Therefore, the upper limit of the recording quality that can be set by the user and the recording quality that is fixedly set can be increased. Therefore, it is possible to record a high-quality moving image for a long time corresponding to the free capacity of the recording medium without being affected by variations in the data writing speed and usage conditions.
以下、本発明の一実施の形態を図にしたがって説明する。
(実施形態1)
図1は、本発明の各実施の形態に共通するデジタルカメラのブロック図である。このデジタルカメラは動画撮影機能を備えたものであり、以下の構成を備えている。
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
(Embodiment 1)
FIG. 1 is a block diagram of a digital camera common to each embodiment of the present invention. This digital camera has a moving image shooting function and has the following configuration.
デジタルカメラは、カメラ本体1と、カメラ本体1に着脱可能な記録メディア20から構成されており、カメラ本体1には複数枚のレンズからなる光学系2、及び光学系2を介して自己の受光面に被写体の光像を結像される撮像手段であるベイヤ配列等の色フィルタが装着されたCCD3が配置されている。CCD3はタイミングジェネレータ7から送られる駆動信号により駆動され、被写体の光像を光電変換し撮像信号として出力する。CCD3からの出力信号はCDS回路4で相関二重サンプリング及びゲイン調整が行われ、A/D変換回路5でデジタル信号に変換される。A/D変換されたベイヤデータはDSP部6に入力され、ペデスタルクランプ等の処理が施された後、ブロック内の輝度・色差マトリックス回路で輝度(Y)信号及び色差(UV)信号に変換される。なお、DSP部6では、オートアイリス、オートホワイトバランス、輪郭強調などの画品質向上のための処理も行われる。
The digital camera includes a camera body 1 and a
DSP部6で変換されたYUVデータは解像度変換ブロック8で予め設定された画像サイズに変換された後、1フレーム分のデータが順次内蔵メモリ14(例えばSDRAM)に格納される。内蔵メモリ14に格納された1フレーム分のYUVデータは表示コントローラ11へ送られ、そこでビデオ信号に変換された後、LCD(液晶表示器)12によりスルー画像として表示される。なお、LCD12は、後述する動画記録時においては本発明の報知手段としても機能する。
The YUV data converted by the
動画撮影時に内蔵メモリ14に格納されたYUVデータは順次データ圧縮伸長ブロック9へ送られ、所定の動画記録方式(例えばMotion−JPEGやMPEG)のコーデックによりデータ圧縮後コード化されて、メディアコントローラ10を介してフレームデータ(ビデオデータ)として記録メディア20に順次書き込まれる。係る一連の動作はフレーム毎に繰り返し実行され、内蔵メモリ14内の圧縮データは順次書き換えられる。つまりストリーム記録される。なお、その際のフレームレートはタイミングジェネレータ7で作成されるタイミング信号によって決まり、コード化されるデータの圧縮率はデータ圧縮伸長ブロック9内の量子化テーブル値によって決定される。また、内蔵メモリ14のメモリ容量は、圧縮された1フレーム分の画像データに相当する容量(変動幅が勘案された容量)である。
The YUV data stored in the built-in
なお、静止画撮影時に内蔵メモリ14に格納された1フレームの分YUVデータは、前記データ圧縮伸長ブロック9でJPEG方式等でデータ圧縮後コード化され、内蔵メモリ14内でファイル化された後、メディアコントローラ10を介して記録メディア20に静止画データとして記録される。また、データ圧縮伸長ブロック9は、静止画又は動画の再生時には記録メディア20から読み出された静止画や動画のデータを伸張し、静止画データやフレームデータとして内蔵メモリ14に展開する。
Note that one frame of YUV data stored in the built-in
音声処理ブロック15は、動画撮影時においてカメラ本体1に内蔵されたマイク16に入力した音声をデジタル信号に変換し、データ圧縮後にオーディオデータとして内蔵メモリ14へ送る。内蔵メモリ14に送られたオーディオデータはフレームデータと共にストリームデータとして記録メディア20に順次書き込まれる。また、音声処理ブロック15は、動画再生時には、内蔵メモリ14から送られたオーディオデータを復号し、アナログの音声信号に変換した後、カメラ本体1に内蔵された内蔵スピーカ17から音声出力させる。
The
キー入力ブロック18は、シャッターボタン、電源キー、MENUキー等の複数の操作キーを含み、使用者によるキー操作に応じたキー入力信号をCPU13に出力する。なお、シャッターボタンは動画撮影に録画開始/終了ボタンとしても機能する。
The
上述した各ブロックはCPU13により制御されており、CPU13が各ブロックの制御に必要とされるプログラムやデータはプログラムメモリ19に記憶されている。そして、CPU13は上記プログラム及びキー入力信号に基づき動作することにより本発明の判断手段、中止手段、調整手段として機能する。また、プログラムメモリ19はEEPROMやフラッシュメモリ等の書き換え可能な不揮発性メモリからなり、上記プログラムやデータ以外にも、ユーザーにより設定されたシステムや各機能に関する設定データ、例えば動画撮影時における録画品質の設定値(圧縮方式や圧縮率、画像サイズ、フレームレート等の録画パラメータ)が随時記憶される。
Each block described above is controlled by the
次に、以上の構成からなるデジタルカメラにおいて、動画像の記録(録画)が行われるときの本発明に係る動作を説明する。図2は、録画中においてCPU13が実施する処理内容を示すフローチャートである。
Next, an operation according to the present invention when a moving image is recorded (recorded) in the digital camera having the above configuration will be described. FIG. 2 is a flowchart showing the processing contents executed by the
CPU13は、ユーザーによる録画開始操作に応じた録画処理の開始に伴い、先ず内蔵メモリ14の所定領域に記憶するダミーフレームカウンタを初期化する(ステップSA1)。ダミーフレームカウンタは、CCD3により撮像されたフレーム画像のうち、記録メディア20へのデータの書き込み時間がフレームレートに比べて長期化することにより記録できない(フレーム落ちする)フレーム数を示すデータである。なお、以下の説明においては、録画中に取得される前述したオーディオデータについては、記録メディア20へのデータの書き込み時間がフレームデータに比べて僅かであり、記録メディア20の種類等に関係なく常に記録可能であるものとする。
The
次に、CCD3による撮像処理を開始した後(ステップSA2)、フレーム周期タイミングを待って(ステップSA3)、その時点で記録メディア20に書き込み中のデータがあるか否かを先ず確認する。ここで書き込み中のデータがなければ(ステップSA4でNO)、引き続きダミーフレームカウンタの値を参照し、それが"0"であれば(ステップSA5でNO)、そのまま圧縮済みのフレームデータを記録メディア20へ書き込む(ステップSA6)。以後、録画終了操作がなく、且つ記録メディア20の空き容量があれば(ステップSA7でNO)、ステップSA3へ戻って、次のフレーム周期タイミングを待って上記処理を繰り返す。
Next, after the imaging process by the
その間に、いずれかのフレーム周期タイミングが到来した時点で、最後に書き込み処理を開始したデータの書き込みが終了しておらず、記録メディア20に書き込み中のデータがあった場合には(ステップSA4でYES)、内蔵メモリ14内の最新の圧縮済みフレームデータを破棄する(上書きを許容する)とともに(ステップSA8)、ダミーフレームカウンタを1つ加算する(ステップSA9)。さらに、例えば「フレームレートを下げて録画をしています。」といったような、設定されている録画品質が確保できていない旨を示す注意メッセージをLCD12にOSD機能により表示した後(ステップSA10)、録画終了操作がなければ(ステップSA7でNO)、ステップSA3へ戻る。なお、係るステップSA8〜SA10の処理は、次のフレーム周期タイミングが到来した時点であっても、最後に書き込み処理を開始したデータの書き込みが終了していなければ(ステップSA4でYES)、繰り返し行われる。
In the meantime, when any of the frame cycle timings has arrived, if the writing of the data for which the writing process was last started is not completed and there is data being written to the recording medium 20 (in step SA4). YES) Discards the latest compressed frame data in the built-in memory 14 (allows overwriting) (step SA8) and increments one dummy frame counter (step SA9). Further, after displaying a warning message on the
そして、上記ステップSA8〜SA10の処理を経た後には、次のフレーム周期タイミングが到来した時点で、最後に書き込み処理を開始したデータの書き込みが終了していたら(ステップSA4でNO)、ダミーカウンタが1以上であるため(ステップSA5でYES)、ステップSA11へ進み、ダミーカウンタ分の数のダミーフレームと、最新の圧縮済みのフレームデータとを記録メディア20に書き込む(ステップSA11)。ここで、上記ダミーフレームは、前のフレームの表示を保持する指定を行うための所定のデータであって、実際のフレームデータよりもデータ量が極めて小さいものとする。例えば動画フォーマットがMPEG−4であれば、"vop_coded=0"のフレームデータがそれに相当する。 Then, after the processing of steps SA8 to SA10, when the next frame cycle timing has arrived and the writing of the data for which the writing processing was last started is completed (NO in step SA4), the dummy counter is Since it is 1 or more (YES in step SA5), the process proceeds to step SA11, and the dummy frames corresponding to the dummy counter and the latest compressed frame data are written in the recording medium 20 (step SA11). Here, the dummy frame is predetermined data for specifying to hold the display of the previous frame, and the data amount is extremely smaller than the actual frame data. For example, if the moving image format is MPEG-4, frame data “vop_coded = 0” corresponds to this.
しかる後、この時点でダミーフレームカウンタを初期化した後(ステップSA12)、録画終了操作がなく、且つ記録メディア20の空き容量があれば(ステップSA7でNO)、ステップSA3へ戻って引き続き上述した処理を繰り返し行い、録画終了操作があった時点又は記録メディア20の空き容量がなくなった時点で(ステップSA7でYES)、録画処理を終了する。
Thereafter, after the dummy frame counter is initialized at this point (step SA12), if there is no recording end operation and there is free space on the recording medium 20 (NO in step SA7), the process returns to step SA3 and continues as described above. The process is repeated, and the recording process is ended when the recording end operation is performed or when the
以上のように本実施の形態においては、例えば使用されている記録メディア20におけるデータの書き込み速度が、空き容量やデータが記録される領域の違い、システムの電源電圧の変化等の実使用環境の違いにより、あるいはCPU13における処理負荷の増大を起因として、想定されている速度よりも大きく低下した状況下で、フレームデータのサイズ変動に伴い記録メディア20に対するフレームデータの書き込み処理が間に合わなくなったときには、実際に撮像されかつ圧縮されたフレームデータに代えてダミーフレームが記録メディア20に記録される。
As described above, in the present embodiment, for example, the data writing speed in the
したがって、フレームデータの書き込み処理が間に合わなくなったときには、録画された動画の再生時における見かけ上のフレームレートを一時的に低下させることにより正常な動画記録を維持したままで、録画処理が時間的に破綻することが防止できる。つまり画像と音声の同期がズレたり、不正なデータを書き込んだりすることがない。そのため、ユーザーが設定可能な録画品質の上限や、固定的に設定しておく録画品質を高めにすることができる。よって、データ書き込み速度のバラツキや、使用状態の影響を受けることなく、記録メディア20の空き容量にみあった長時間の動画像をより高品質で記録することができる。
Therefore, when the writing process of the frame data is not in time, the recording process is performed temporally while maintaining normal moving picture recording by temporarily reducing the apparent frame rate when playing the recorded moving picture. It can be prevented from failing. In other words, the synchronization between the image and the sound is not shifted, and illegal data is not written. Therefore, the upper limit of the recording quality that can be set by the user and the recording quality that is fixedly set can be increased. Therefore, it is possible to record a high-quality moving image for a long time corresponding to the free capacity of the
しかも、書き込み速度が速い記録メディア20が使用される場合には、そのまま設定されている録画品質での録画を問題なく行うことができる。
In addition, when the
また、本実施の形態においては、内蔵メモリ14に、圧縮済みのフレームデータを複数フレーム分記憶させる領域を設ける必要がないため、録画動作時には内蔵メモリ14を他の処理等に有効に利用することができる。また、録画途中にダミーフレームが記録メディア20に記録される状況が発生したときには、その度毎に前述した注意メッセージをLCD12に表示して、設定されている録画品質が確保できていないことをユーザーに知らせることができるため、使い勝手もよい。なお、例えば音声無しの録画を行う場合にあっては、注意メッセージの表示に代えて、所定のアラーム音や音声メッセージをスピーカ17から出力させるようにしてもよい。
Further, in the present embodiment, it is not necessary to provide an area for storing a plurality of frames of compressed frame data in the built-in
なお、本実施の形態では、記録メディア20に対するフレームデータの書き込み処理が間に合わなくなったとき記録メディア20に記録するダミーフレームを、MPEG−4における"vop_coded=0"のフレームデータ等のように、圧縮後のフレームデータよりも極めて小さいデータとしたが、ダミーフレームは、圧縮後のフレームデータと同一乃至は同程度のサイズのデータとしてもよい。例えば、動画フォーマットがMotion−JPEGの場合には、直前のフレームデータつまりコピーデータとする等、動画フォーマットに応じて適宜決めることができる。コピーデータとする場合には、その旨を示す情報をフレームデータに代えて記録しておき、録画終了後に、その情報に基づいてコピーを実施することとなる。また、ダミーフレームのデータサイズをより小さくして、ダミーフレームの書き込み時間を短くした方が、動画中のダミーフレームの数が少なくなり、動画再生時における見かけ上のフレームレートの変動(回数)を抑えることができるため、より良質の録画品質が確保できる。
In the present embodiment, the dummy frame to be recorded on the
(実施形態2)
次に、本発明の第2の実施の形態について説明する。本実施の形態は、図1に示した構成を備えたデジタルカメラにおいて、録画時に前記記録メディア20に記録される動画ファイルがAVI(Audio Video Interleave)ファイルであるものである。
(Embodiment 2)
Next, a second embodiment of the present invention will be described. In the present embodiment, in the digital camera having the configuration shown in FIG. 1, the moving image file recorded on the
図3(a)は、本実施の形態において記録されるAVIファイル100の概略のデータ構造を示す模式図であり、AVIファイル100にはデータ本体であるmoviチャンク101とindexチャンク102とが含まれるとともに、moviチャンク101が、各々が圧縮されたフレームデータ(以下、ビデオデータ)である3つの画像チャンク(図でビデオ1、ビデオ2、ビデオ3、・・・)につき圧縮されたオーディオデータである1つの音声チャンク(図でオーディオ1、・・・)で構成され、indexチャンク102に、各々の画像チャンク及び音声チャンクのポインタとサイズを示すインデックス情報が記録順に並んで記録された構造である。なお、動画再生時には、indexチャンク102のインデックス情報の並び順に従って画像チャンク及び音声チャンクのデータが再生されることとなる。
FIG. 3A is a schematic diagram showing a schematic data structure of the AVI file 100 recorded in the present embodiment, and the
また、本実施の形態においては、前述した内蔵メモリ14には上記画像チャンク及び音声チャンクを一時記憶するための、図3(b)に示したような録画用バッファ110が確保されている。この録画用バッファ110は先に説明したリングバッファとして使用されるものであり、本実施の形態において、そのサイズは最低60秒分のビデオ及びオーディオデータの合計サイズにマージンを加えたサイズである。なお、以下の説明においては、ビデオデータが、フレームレート=15fps、1フレームの平均データサイズ=10kbであり、オーディオデータが、サンプルレート周波数=8kHz、1サンプルあたりのビット数=8ビット、チャンネル=モノラルであるものとし、録画用バッファ110のサイズが、
[(10kb×15)+8000]×60≒9.25kb+マージン
であるものとする。
In the present embodiment, the built-in
It is assumed that [(10 kb × 15) +8000] × 60≈9.25 kb + margin.
次に、以上の構成からなるデジタルカメラにおいて、動画像の記録(録画)が行われるときの本発明に係る動作を説明する。図4は、録画中においてCPU13が実施する処理内容を示すフローチャートである。
Next, an operation according to the present invention when a moving image is recorded (recorded) in the digital camera having the above configuration will be described. FIG. 4 is a flowchart showing the processing contents executed by the
CPU13は、ユーザーによる録画開始操作に応じて録画処理を開始すると、まず暫定的な仮のヘッダチャンク(図示せず)を有するとともに、前述したindexチャンク102が付加されていないAVIファイル100を記録メディア20に作成する(ステップSB1)。さらに、内蔵メモリ14の所定領域に、録画終了後にAVIファイル100に付加されるindexチャンク102の元となる前記インデックス情報を記憶するための作業用インデックスファイル120(図5参照)を作成した後(ステップSB2)、CCD3による撮像処理、及び前述した録画用バッファ110へのデータ(画像チャンク及び音声チャンク)の記憶を開始する(ステップSB3)。
When the
以後、データ圧縮伸長ブロック9や音声処理ブロック15からの録画用バッファ110へのデータ書き込み要求がある毎に(ステップSB4でYES)、その時点で録画用バッファ110がバッファフルの状態であるか否かを判断する(ステップSB5)。なお、かかる判断は、以下の判断基準によって行う。すなわち書き込み要求があったデータが画像チャンクのデータである場合には、当該データのサイズ+1音声チャンクの平均データサイズ+マージン分の空き容量が残存していない状態をバッファフルとし、かつ書き込み要求があったデータが音声チャンクのデータである場合には、当該データのサイズ以上の空き容量が残存していない状態をバッファフルとする。これは、録画用バッファ110内に常に1音声チャンク分の空き容量を確保するためである。
Thereafter, every time there is a data write request from the data compression / decompression block 9 or the
そして、録画開始当初においては、録画用バッファ110がフル状態でないため(ステップSB5でNO)、そのまま録画用バッファ110へのデータ書き込みを許可するとともに(ステップSB6)、書き込まれたデータのポインタとサイズを示すインデックス情報を作業用インデックスファイル120に追加する(ステップSB7)。引き続き、録画用バッファ110に記憶された、未だAVIファイル100(記録メディア20)への書き込みが済んでいないデータ(最先のデータ)をAVIファイル100に書き込むとともに、当該データを録画用バッファ110から消去(当該データに対する上書きを許可)した後(ステップSB8でYES、ステップSB9)、ステップSB4へ戻り、上記動作を繰り返す。これにより、AVIファイル100に複数フレーム分の画像チャンク及び音声チャンクが記録順に格納され、同様に作業用インデックスファイル120にそれらのチャンクのインデックス情報が記録順に格納される。
Since the
ここで、上記の録画用バッファ110へのデータ書き込み(及びインデックス情報の追加)と、AVIファイル100へのデータ書き込み(及び録画用バッファ110からの書き込み済みデータの消去)は非同期で行い、実際には、AVIファイル100へのデータ書き込みが終了する以前であっても、録画用バッファ110へのデータ書き込み等が一定のフレーム周期(本実施の形態では15fps)で行われる。そのため、AVIファイル100へのデータ書き込みに遅れが生じると、未書き込みのデータが録画用バッファ110内に蓄積されることになる。
Here, the data writing to the recording buffer 110 (and addition of index information) and the data writing to the AVI file 100 (and erasing of the written data from the recording buffer 110) are performed asynchronously, and actually Even before data writing to the
図5(a)は、その状態の一例を示した図であって、記録メディア20に対するデータの書き込み速度が10fpsであった場合における60秒後の状態を示した図である。本実施の形態においてはフレームレートが15fpsであるため、録画用バッファ110にビデオデータが3フレーム分記憶される間におけるAVIファイル100へのデータの書き込み分が2フレームとなる。したがって、60秒後の時点では、AVIファイル100へ2/3のデータが書き込まれ、残りの1/3のデータが録画用バッファ110に残存し、かつそのサイズも録画用バッファ110の1/3程度となる。また、作業用インデックスファイル120には、AVIファイル100へ書き込まれた全てのデータのインデックス情報が格納された状態となる。
FIG. 5A is a diagram illustrating an example of the state, and is a diagram illustrating a state after 60 seconds when the data writing speed to the
一方、前述した処理を繰り返す間に、録画用バッファ110がバッファフルの状態となったときには(ステップSB5でYES)、要求された録画用バッファ110へのデータの書き込みを制限(禁止)して(ステップSB10)、作業用インデックスファイル120に、1つ前に書き込まれたデータと同一のインデックス情報を追加する(ステップSB11)。なお、本実施の形態ではバッファフルの状態を前述した判断基準によって行っているため、ステップSB10で制限つまり破棄されるデータは画像チャンクのデータのみとなる。
On the other hand, if the
図5(b)は、その一例を示した図であって、記録メディア20に対するデータの書き込み速度が10fpsであった場合における180秒後の状態を示した図である。180秒後には、120秒分のデータのみがAVIファイル100に書き込まれ、残りのデータ(図で、ビデオ1801〜オーディオ900)が録画用バッファ110に格納された状態にある。この時点で、録画用バッファ110が既にバッファフルの状態となっている。したがって、録画用バッファ110への新たなデータ書き込み要求があった時には、録画用バッファ110内のデータはそのままで、作業用インデックスファイル120に、1つ前のデータ(図で、ビデオ2700)のインデックス情報が再度追加されることとなる。
FIG. 5B is a diagram illustrating an example thereof, and is a diagram illustrating a state after 180 seconds when the data writing speed to the
引き続き、例えば「フレームレートを下げて録画をしています。」といったような、設定されている録画品質が確保できていない旨を示す注意メッセージをLCD12にOSD機能により表示する(ステップSB12)。そして、前述したステップSB8へ進み、以後は、録画用バッファ110にデータが残存する間においては(ステップSB8でYES)、録画終了操作の有無に関係なく、AVIファイル100へのデータ書き込みを続ける(ステップSB9)。そして、録画用バッファ110にデータがなくなり、そのとき既に録画終了操作が行われていたら(ステップSB8でNO、ステップSB13がYES)、その時点で作業用インデックスファイル120のデータに基づきindexチャンクを生成し、それをAVIファイル100に付加してAVIファイル100を完成させ(ステップSB14)、全ての録画処理を完了する。
Subsequently, a warning message indicating that the set recording quality cannot be ensured, such as “Recording is performed at a reduced frame rate”, is displayed on the
以上のように本実施の形態においては、先に説明したような原因により想定されている速度よりも大きく低下した状況下で、フレームデータのサイズ変動に伴い記録メディア20へのデータの書き込みに遅れが生じ、録画中に録画用バッファ110(リングバッファ)に新たな画像チャンクが蓄積することができなくなったときには、その1つ前の画像チャンクを示すインデックス情報がindexチャンクに記録される。
As described above, in the present embodiment, the writing of data to the
したがって、録画用バッファ110に新たな画像チャンクが蓄積することができなくなったときには、録画された動画の再生時における見かけ上のフレームレートを一時的に低下させることにより正常な動画記録を維持したままで、録画処理が時間的に破綻することが防止でき、ユーザーが設定可能な録画品質の上限や、固定的に設定しておく録画品質を高めにすることができる。
Therefore, when a new image chunk can no longer be stored in the
よって、第1の実施の形態と同様、データ書き込み速度のバラツキや、使用状態の影響を受けることなく、記録メディア20の空き容量にみあった長時間の動画像をより高品質で記録することができる。しかも、書き込み速度が速い記録メディア20が使用される場合には、そのまま設定されている録画品質での録画を問題なく行うことができる。また、録画途中に録画用バッファ110に新たな画像チャンクが蓄積することができなくなった状況が発生したときには、その度毎に前述した注意メッセージをLCD12に表示して、設定されている録画品質が確保できていないことをユーザーに知らせることができ、使い勝手もよい。
Therefore, as in the first embodiment, it is possible to record a high-quality moving image for a long time corresponding to the free capacity of the
さらに、本実施の形態においては、内蔵メモリ14に、複数フレーム分の画像チャンクを記憶する録画用バッファ110を設け、それをリングバッファとして使用することにより、例えば録画開始当初から、設定されているフレームレートに対して記録メディア20へのデータの書き込み速度が遅い場合であっても、その当初の一定期間(本実施の形態では60秒)については、再生時におけるフレームレートとして、設定されているフレームレートを確保することができる。これによっても、使い勝手がよい。
Further, in the present embodiment, a
なお、本実施の形態では、記録メディア20に記録する動画ファイルがAVIファイル100である場合について説明したが、動画ファイルの形式は、圧縮後のフレームデータに、各々のフレームデータの再生順を示すインデックス情報が付随するものであれば、他の形式のファイルであってもかまわない。
In the present embodiment, the case where the moving image file to be recorded on the
また、動画像を、本実施の形態のようにAVIファイル100として、またそれ以外のインデックス情報を備えた形式のファイルとして記録する場合、内蔵メモリ14に録画用バッファ110を設けることなく、第1の実施の形態で説明したもののように、圧縮後のフレームデータを記録メディア20に直接書き込む構成としてもよい。その場合、記録メディア20に対するデータの書き込みに遅れが生じたか否かは、第1の実施の形態と同様の基準で判断すればよい。なお、前述した作業用インデックスファイル120等を設ける場所は任意であり、その点については本実施の形態においても同様である。
In addition, when recording a moving image as an
また、上記とは別に、第1の実施の形態で説明したものに、本実施の形態における録画用バッファ110に相当するものを設けた構成とし、記録メディア20に対するデータの書き込みにおくれが生じたか否かを、第1の実施の形態と同様の基準で判断するものとしてもよい。
In addition to the above, a configuration corresponding to the
また、本実施の形態においては、録画用バッファ110がバッファフルとなった時、記録メディア20に対するデータの書き込みに遅れが生じたと判断するようにしたが、録画用バッファ110の空き容量が所定量以下になった時点を遅れが生じた時点と判断するようにしてもよい。このようにすれば、一時的に低下させるときのフレームレートの低減量(低減幅)を小さくすることができる。つまりフレームレートを急激に低下させなくとも正常な動画記録ができ、より高い録画品質が確保できる。
In this embodiment, when the
また、録画用バッファ110に圧縮後の画像データ(フレームデータ)を順次記憶するものとしたが、圧縮前の画像データを録画用バッファ110に順次記憶するようにしてもよい。
Further, although the compressed image data (frame data) is sequentially stored in the
また、以上説明した第1及び第2の実施の形態においては、前記遅れが生じたときには、前述したように動画の再生時における見かけ上のフレームレートを一時的に低下させるための処理によって書き込みデータ量を減らするようにしたが、上記の処理とは別に、又はそれと並行して、前記フレームレート以外の他の録画パラメータ(圧縮率、画像サイズ等)を変更して書き込みデータ量を減らするようにしてもよい。 Further, in the first and second embodiments described above, when the delay occurs, the write data is processed by the process for temporarily reducing the apparent frame rate at the time of reproducing the moving image as described above. Although the amount is reduced, the recording data amount is reduced by changing other recording parameters (compression rate, image size, etc.) other than the frame rate separately from or in parallel with the above processing. It may be.
また、第1及び第2の実施形態においては、本発明を、動画撮影機能を備えたデジタルカメラに採用した場合について説明したが、これに限らず本発明は、録画時に動画をストリーム記録する構成を備えたものであれば、例えばデジタルビデオカメラ、カメラ付き携帯電話機、カメラ付きPDA、カメラ付きパソコン等の種々の電子カメラ装置にも採用することができる。その場合においても、前述した効果を得ることができる。 In the first and second embodiments, the case where the present invention is applied to a digital camera having a moving image shooting function has been described. However, the present invention is not limited to this, and the present invention is configured to stream-record moving images during recording. Can be employed in various electronic camera devices such as a digital video camera, a mobile phone with a camera, a PDA with a camera, and a personal computer with a camera. Even in that case, the above-described effects can be obtained.
さらに、任意の形式で圧縮して記録する動画像は撮影されたものでなくとも、例えばアナログのテレビ放送の放送画像やビデオ入力端子から入力された動画像であってもよく、また、その場合を含め、動画を記録する記録媒体は半導体メモリに限らずハードディスク等であってもかまわない。 Furthermore, a moving image that is compressed and recorded in an arbitrary format may be a moving image input from a video input terminal or a broadcast image of an analog television broadcast, for example. In addition, a recording medium for recording a moving image is not limited to a semiconductor memory, and may be a hard disk or the like.
1 カメラ本体
2 光学系
3 CCD
12 LCD
13 CPU
14 内蔵メモリ
17 内蔵スピーカ
18 キー入力ブロック
19 プログラムメモリ
20 記録メディア
100 AVIファイル
101 moviチャンク
102 indexチャンク
110 録画用バッファ
120 作業用インデックスファイル
1 Camera body 2
12 LCD
13 CPU
14
Claims (3)
前記記録媒体への画像処理後の画像データの書込み処理に、動画像の正常な記録を阻害する遅れが生じているか否かを判断する判断手段と、
この判断手段により前記遅れが生じていると判断されたとき、前記記録媒体に対する書き込みデータ量を減少させる調整手段と、を備え、
前記判断手段は、
前記記録媒体に対する新たな画像処理後の画像データの書込み時点で、1つ前の画像処理後の画像データが書き込み中であったとき、前記遅れが生じていると判断する
ことを特徴とする動画像記録装置。 In a moving image recording apparatus for sequentially recording image data constituting a moving image on a recording medium while performing image processing at a predetermined frame period,
Determination means for determining whether or not there is a delay that hinders normal recording of moving images in the writing processing of image data after image processing to the recording medium;
Adjusting means for reducing the amount of data written to the recording medium when it is determined by the determining means that the delay has occurred,
The determination means includes
A moving image characterized by determining that the delay has occurred when the image data after the previous image processing is being written at the time of writing the image data after the new image processing to the recording medium. Image recording device.
この判断手段により前記遅れが生じていると判断されたとき、所定の録画パラメータを変更させることにより、前記記録媒体に対する書き込みデータ量を減少させる
ことを特徴とする請求項1記載の動画像記録装置。 The adjusting means includes
2. The moving image recording apparatus according to claim 1 , wherein when it is determined by the determining means that the delay has occurred, the amount of data to be written to the recording medium is reduced by changing a predetermined recording parameter. .
前記記録媒体に対する新たな画像処理後の画像データの書込み時点で、1つ前の画像処理後の画像データが書き込み中であったとき、前記記録媒体への画像処理後の画像データの書込み処理に、動画像の正常な記録を阻害する遅れが生じているか否かを判断する判断手段、
この判断手段により前記遅れが生じていると判断されたとき、前記記録媒体に対する書き込みデータ量を減少させる調整手段、
として機能させるためのプログラム。 A computer having a moving image recording apparatus for sequentially recording image data constituting a moving image on a recording medium while performing image processing at a predetermined frame period;
When the image data after the previous image processing is being written at the time of writing the image data after the new image processing to the recording medium, the image data is written into the recording medium after the image processing. Determining means for determining whether or not there is a delay that hinders normal recording of moving images;
An adjusting means for reducing the amount of data written to the recording medium when it is determined by the determining means that the delay has occurred;
Program to function as.
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004006362A JP4254548B2 (en) | 2004-01-14 | 2004-01-14 | Moving image recording apparatus and program |
US11/033,423 US7583299B2 (en) | 2004-01-14 | 2005-01-11 | Moving image recording apparatus with a stream recording function of a moving image |
CNB200510003991XA CN100413336C (en) | 2004-01-14 | 2005-01-14 | Moving image recording apparatus, digital camera device and moving image recording method |
US12/023,969 US7903151B2 (en) | 2004-01-14 | 2008-01-31 | Moving image recording apparatus with a stream recording function of a moving image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004006362A JP4254548B2 (en) | 2004-01-14 | 2004-01-14 | Moving image recording apparatus and program |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008265842A Division JP2009050017A (en) | 2008-10-15 | 2008-10-15 | Moving image recording apparatus and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2005203922A JP2005203922A (en) | 2005-07-28 |
JP4254548B2 true JP4254548B2 (en) | 2009-04-15 |
Family
ID=34820354
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004006362A Expired - Fee Related JP4254548B2 (en) | 2004-01-14 | 2004-01-14 | Moving image recording apparatus and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4254548B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010135912A (en) * | 2008-12-02 | 2010-06-17 | Sumitomo Electric Ind Ltd | Compressing method of video data |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1042295A (en) * | 1996-07-19 | 1998-02-13 | Sony Corp | Video signal encoding method and video signal encoder |
JPH10164503A (en) * | 1996-11-26 | 1998-06-19 | Matsushita Electric Ind Co Ltd | Video-processing device and method therefor |
JP4306035B2 (en) * | 1998-08-24 | 2009-07-29 | ソニー株式会社 | Encoding method, encoding device, and camera device |
JP2000217068A (en) * | 1999-01-22 | 2000-08-04 | Hitachi Ltd | Information recorder |
JP4242581B2 (en) * | 2000-12-08 | 2009-03-25 | パナソニック株式会社 | Data converter |
JP2002247509A (en) * | 2001-02-21 | 2002-08-30 | Sanyo Electric Co Ltd | Camera device |
JP3731657B2 (en) * | 2002-08-30 | 2006-01-05 | ソニー株式会社 | Image processing apparatus and method, and recording medium |
-
2004
- 2004-01-14 JP JP2004006362A patent/JP4254548B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2005203922A (en) | 2005-07-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7692690B2 (en) | Image sensing apparatus for recording a moving image and a still image and its control method | |
US7903151B2 (en) | Moving image recording apparatus with a stream recording function of a moving image | |
JP4725183B2 (en) | Imaging apparatus and method | |
JP4777180B2 (en) | Imaging apparatus and control method thereof | |
US8743227B2 (en) | Imaging apparatus and control method for reducing a load of writing image data on a recording medium | |
JP4958758B2 (en) | Recording apparatus, reproducing apparatus, recording method, reproducing method, and program | |
KR20040017773A (en) | Recording apparatus and method, recording medium, and program | |
JP4577557B2 (en) | Electronic camera device, moving image recording method and program | |
JPWO2009072276A1 (en) | Image encoding apparatus, video camera, integrated circuit, and image encoding method | |
JP2006310907A (en) | Imaging apparatus and its control method | |
JP2009147743A (en) | Recording apparatus, reproduction apparatus, recording method, reproduction method, and program | |
JP4901673B2 (en) | Imaging apparatus, recording apparatus, reproducing apparatus, imaging method, recording method, reproducing method, and program | |
JP2007116635A (en) | Imaging apparatus | |
JP4254548B2 (en) | Moving image recording apparatus and program | |
JP2011233985A (en) | Image processing system and its control method | |
JP4687801B2 (en) | Moving image recording apparatus, electronic camera apparatus, moving image recording method, and program | |
JP2009147745A (en) | Recording apparatus, reproduction apparatus, recording method, reproduction method, and program | |
JP2009050017A (en) | Moving image recording apparatus and program | |
JP4305254B2 (en) | Moving image recording apparatus, electronic camera apparatus, moving image recording method, and program | |
JP2005252499A (en) | Electronic camera apparatus | |
JP2008160860A (en) | Electronic camera apparatus, moving image recording method and program | |
KR101545902B1 (en) | Photographing apparatus recording apparatus reproducing apparatus photographing method recording method reproducing method and storing medium having program to perform the recording method | |
JP4298583B2 (en) | Imaging device and mobile phone | |
JP4234662B2 (en) | Electronic device and data recording method thereof | |
JP4166148B2 (en) | Image recording device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20061206 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080520 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080618 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20080930 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20081015 |
|
A911 | Transfer to examiner for re-examination before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20081201 |
|
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: 20090106 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090119 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120206 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4254548 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120206 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130206 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130206 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140206 Year of fee payment: 5 |
|
LAPS | Cancellation because of no payment of annual fees |