[go: up one dir, main page]

JP5213130B2 - Data distribution system, switching device, and data distribution method - Google Patents

Data distribution system, switching device, and data distribution method Download PDF

Info

Publication number
JP5213130B2
JP5213130B2 JP2009184603A JP2009184603A JP5213130B2 JP 5213130 B2 JP5213130 B2 JP 5213130B2 JP 2009184603 A JP2009184603 A JP 2009184603A JP 2009184603 A JP2009184603 A JP 2009184603A JP 5213130 B2 JP5213130 B2 JP 5213130B2
Authority
JP
Japan
Prior art keywords
stream data
gop
data
rate
ring buffer
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.)
Active
Application number
JP2009184603A
Other languages
Japanese (ja)
Other versions
JP2011040879A (en
Inventor
潔 池原
義則 武者
啓太 朝倉
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.)
Hitachi Consumer Electronics Co Ltd
Original Assignee
Hitachi Consumer Electronics Co Ltd
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 Hitachi Consumer Electronics Co Ltd filed Critical Hitachi Consumer Electronics Co Ltd
Priority to JP2009184603A priority Critical patent/JP5213130B2/en
Publication of JP2011040879A publication Critical patent/JP2011040879A/en
Application granted granted Critical
Publication of JP5213130B2 publication Critical patent/JP5213130B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Description

本発明は、動画を配信するシステムに関し、特に、任意のビットレートの動画ストリームを配信するシステムに関する。   The present invention relates to a system for distributing moving images, and more particularly to a system for distributing a moving image stream of an arbitrary bit rate.

従来、デジタル化された動画データをネットワークに送出する場合、各種のビットレートのディジタル動画データを生成し、ネットワークの使用可能帯域に合ったビットレートを有するディジタル動画データを選択して送出している。すなわち、ビットレートが高い動画像は高画質であるが、通信路の帯域を必要とする。一方、ビットレートが低いほど画質は低いが、通信路は狭帯域でよい。このため、例えば特許文献1には、複数のデータ変換手段(各種ビット用エンコーダシステム)を用いて、異なるビットレートを有する複数のデジタル動画データに変換する符号化システムが提案されている。   Conventionally, when digitalized moving image data is transmitted to a network, digital moving image data of various bit rates is generated, and digital moving image data having a bit rate that matches the usable bandwidth of the network is selected and transmitted. . That is, a moving image with a high bit rate has high image quality, but requires a bandwidth of the communication path. On the other hand, the lower the bit rate, the lower the image quality, but the communication path may be narrow. For this reason, for example, Patent Document 1 proposes an encoding system that converts a plurality of digital moving image data having different bit rates using a plurality of data conversion means (encoder systems for various bits).

特開平11−341488号公報Japanese Patent Laid-Open No. 11-341488

しかし、前述した特許文献1に記載された技術によると、あらかじめ決められた何種類かのビットレートの動画データのいずれかを送信するため、帯域変動の大きなネットワーク(例えば、無線通信ネットワーク)であった場合に、クライアント端末毎の帯域変動に対応することが困難である。また、端末毎に帯域を制御するためには、端末毎に(すなわち、端末の数だけ)ビットレート変換装置を設ける必要がある。   However, according to the technique described in Patent Document 1 described above, since any one of several types of video data having a predetermined bit rate is transmitted, it is a network with a large band fluctuation (for example, a wireless communication network). In such a case, it is difficult to cope with bandwidth fluctuations for each client terminal. In addition, in order to control the bandwidth for each terminal, it is necessary to provide a bit rate conversion device for each terminal (that is, by the number of terminals).

このため、端末毎のビットレートの変換を、より少ないリソースで実現するシステムが求められている。   For this reason, there is a demand for a system that realizes bit rate conversion for each terminal with fewer resources.

本願において開示される発明の代表的な一例を示せば以下の通りである。すなわち、ソースストリームデータから低レートの少なくとも一つのストリームデータを生成する変換装置と、前記ストリームデータを選択して出力する切替装置とを備えるデータ配信システムであって、前記切替装置は、前記ストリームデータのレート毎に、前記ストリームデータを格納するリングバッファを備え、前記ストリームデータを読み出す前記リングバッファを選択し、前記選択されたリングバッファからGOPのデータを読み出すことによって、前記ソースストリームデータと前記変換されたストリームデータとのいずれかのGOPを、前記GOP毎に選択し、前記選択されたGOPによって、所望のレートのストリームデータを生成する。 A typical example of the invention disclosed in the present application is as follows. That is, a data distribution system including a conversion device that generates at least one stream data at a low rate from source stream data, and a switching device that selects and outputs the stream data , the switching device including the stream data A ring buffer for storing the stream data for each rate, selecting the ring buffer for reading the stream data, and reading the GOP data from the selected ring buffer, thereby converting the source stream data and the conversion One GOP with the selected stream data is selected for each GOP, and stream data at a desired rate is generated by the selected GOP .

本発明の代表的な実施の形態によれば、リアルタイムに生成される動画像を適切なビットレートに変換して送信するシステムを、少ないリソースで実現することができる。   According to a typical embodiment of the present invention, a system that converts a moving image generated in real time to an appropriate bit rate and transmits the moving image can be realized with a small amount of resources.

本発明の第1の実施の形態の動画ストリーム配信システムの構成を示すブロック図である。It is a block diagram which shows the structure of the moving image stream delivery system of the 1st Embodiment of this invention. 本発明の第1の実施の形態のマルチプレクサの動作を示す説明図である。It is explanatory drawing which shows operation | movement of the multiplexer of the 1st Embodiment of this invention. 本発明の第1の実施の形態のストリーム切替装置7A〜7Eによる処理を示す説明図である。It is explanatory drawing which shows the process by the stream switching apparatuses 7A-7E of the 1st Embodiment of this invention. 本発明の第1の実施の形態のStream Switcherスレッドによる処理のフローチャートである。It is a flowchart of the process by the Stream Switcher thread of the 1st Embodiment of this invention. 本発明の第1の実施の形態のGOP選択処理の一例(方法1)フローチャートである。It is an example (method 1) flowchart of the GOP selection process of the 1st Embodiment of this invention. 本発明の第1の実施の形態のGOP選択処理の一例(方法2)フローチャートである。It is an example (method 2) flowchart of the GOP selection process of the 1st Embodiment of this invention. 本発明の第1の実施の形態の方法1によってレートが選択された映像データの変化を示す説明図である。It is explanatory drawing which shows the change of the video data by which the rate was selected by the method 1 of the 1st Embodiment of this invention. 本発明の第2の実施の形態の動画ストリーム配信システムの構成を示すブロック図である。It is a block diagram which shows the structure of the moving image stream delivery system of the 2nd Embodiment of this invention. 本発明の第2の実施の形態のマルチプレクサの動作を示す説明図である。It is explanatory drawing which shows operation | movement of the multiplexer of the 2nd Embodiment of this invention. 本発明の第1の実施の形態のストリーム切替装置による処理を示す説明図である。It is explanatory drawing which shows the process by the stream switching apparatus of the 1st Embodiment of this invention. 本発明の第2の実施の形態のStream Switcherスレッドによる処理のフローチャートである。It is a flowchart of the process by the Stream Switcher thread of the 2nd Embodiment of this invention. 本発明の第2の実施の形態のGOP選択処理の一例(方法1)フローチャートである。It is an example (method 1) flowchart of the GOP selection process of the 2nd Embodiment of this invention. 本発明の第2の実施の形態のGOP選択処理の一例(方法2)フローチャートである。It is an example (method 2) flowchart of the GOP selection process of the 2nd Embodiment of this invention. 本発明の第3の実施の形態の動画ストリーム配信システムの構成を示すブロック図である。It is a block diagram which shows the structure of the moving image stream delivery system of the 3rd Embodiment of this invention. 従来のビットレート変換装置によって生成される映像フレームの説明図である。It is explanatory drawing of the video frame produced | generated by the conventional bit rate conversion apparatus. 第3の実施の形態のビットレート変換装置によって生成される映像フレームの説明図である。It is explanatory drawing of the video frame produced | generated by the bit rate conversion apparatus of 3rd Embodiment. 第3の実施の形態の切替装置によって生成される映像フレームの説明図である。It is explanatory drawing of the video frame produced | generated by the switching apparatus of 3rd Embodiment.

<実施形態1>
図1は、本発明の第1の実施の形態の動画ストリーム配信システムの構成を示すブロック図である。
<Embodiment 1>
FIG. 1 is a block diagram showing a configuration of a moving picture stream distribution system according to the first embodiment of this invention.

第1の実施の形態の動画ストリーム配信システムは、カムコーダ1、ネットワーク2、映像受信装置3、複数のビットレート変換装置4A〜4D、マルチプレクサ5、負荷監視装置6、複数のストリーム切替装置7A〜7E及び複数の映像配信装置8A〜8Eを備える。なお、ビットレート変換装置は複数ではなく、1台であってもよい。この場合、ソース映像のビットレートと、ビットレート変換装置によって変換されたビットレートとの間で、配信される映像のビットレートが制御される。   The video stream distribution system according to the first embodiment includes a camcorder 1, a network 2, a video reception device 3, a plurality of bit rate conversion devices 4A to 4D, a multiplexer 5, a load monitoring device 6, and a plurality of stream switching devices 7A to 7E. And a plurality of video distribution apparatuses 8A to 8E. Note that the number of bit rate conversion devices may be one instead of a plurality. In this case, the bit rate of the distributed video is controlled between the bit rate of the source video and the bit rate converted by the bit rate conversion device.

カムコーダ1は、動画像撮像装置及び動画像符号化装置を備え、例えば、ビデオカメラ、携帯電話などである。カムコーダ1は、動画像符号化装置によって、撮影した画像を符号化することによって圧縮し、符号化された動画像データ((ソース映像)をネットワーク2を通じて映像受信装置3に送信する。例えば、MPEG2/H.264エンコーダを用いて、MPEG2/H.264で符号化することができる。   The camcorder 1 includes a moving image capturing device and a moving image encoding device, and is, for example, a video camera or a mobile phone. The camcorder 1 compresses the captured image by encoding it with the moving image encoding device, and transmits the encoded moving image data ((source image) to the image receiving device 3 via the network 2. For example, MPEG2 is used. MPEG2 / H.264 can be encoded using the /H.264 encoder.

ネットワーク2は、インターネット、携帯電話網、NGN(Next Generation Network)などの広域ネットワークでも、LAN(Local Area Network)などの狭い地域内のネットワークでもよい。   The network 2 may be a wide area network such as the Internet, a mobile phone network, or an NGN (Next Generation Network), or a network in a narrow area such as a LAN (Local Area Network).

なお、カムコーダ1、ネットワーク2は、本発明の必須の構成ではない。動画ストリーム配信システムがカムコーダ1及びネットワーク2を備えない場合、映像受信装置3に符号化された動画像データ(例えば、録画された動画像データ)が直接入力されればよい。   Note that the camcorder 1 and the network 2 are not essential components of the present invention. When the moving picture stream distribution system does not include the camcorder 1 and the network 2, encoded video data (for example, recorded video data) may be directly input to the video receiver 3.

映像受信装置3は、プロセッサ、メモリ及びネットワークインタフェースを備えるコンピュータであり、カムコーダ1から送信される符号化されたソース映像を、ネットワーク2を介して受信し、後段のビットレート変換装置4A〜4Dに出力する。すなわち、各ビットレート変換装置に対し、同じソース映像を与える。映像受信装置3は、例えば、MPEG2−TS形式に従ってデータを出力する。なお、出力されるデータは、TSパケット中のビデオES(Elementary Stream)だけでよい。   The video reception device 3 is a computer having a processor, a memory, and a network interface, receives the encoded source video transmitted from the camcorder 1 via the network 2, and sends it to the subsequent bit rate conversion devices 4A to 4D. Output. That is, the same source video is given to each bit rate conversion device. The video receiver 3 outputs data according to, for example, the MPEG2-TS format. Note that the output data may be only the video ES (Elementary Stream) in the TS packet.

ビットレート変換装置4A〜4Dは、ソース映像を、ソース映像とは異なる低いビットレートの符号化データに変換する。ビットレート変換装置4A〜4Dは、プロセッサ、メモリ及びネットワークインタフェースを備えるコンピュータでもよく、専用ハードウェア(例えば、ViXS SystemsのXCode2111)によって処理を行うものでもよい。各ビットレート変換装置4A〜4Dは、変換結果を後段のマルチプレクサ5に出力する。   The bit rate conversion devices 4A to 4D convert the source video into encoded data having a low bit rate different from that of the source video. The bit rate conversion devices 4A to 4D may be computers having a processor, a memory, and a network interface, and may perform processing using dedicated hardware (for example, XCode 2111 of ViXS Systems). Each of the bit rate conversion devices 4A to 4D outputs the conversion result to the multiplexer 5 at the subsequent stage.

なお、映像受信装置3と各ビットレート変換装置4A〜4Dとが別のコンピュータに実装される場合、両装置をネットワークによって接続するとよい。また、ビットレート変換装置4A〜4Dが専用ハードウェアによって実現される場合、映像受信装置3とビットレート変換装置4A〜4Dとの間は、PCIバス、PCIExpress等の装置内接続用の規格に従って接続する。   When the video reception device 3 and the bit rate conversion devices 4A to 4D are mounted on different computers, both devices may be connected via a network. In addition, when the bit rate conversion devices 4A to 4D are realized by dedicated hardware, the video reception device 3 and the bit rate conversion devices 4A to 4D are connected in accordance with a standard for in-device connection such as a PCI bus and PCI Express. To do.

マルチプレクサ5は、プロセッサ、メモリ及びネットワークインタフェースを備えるコンピュータであり、映像受信装置3が実装されるコンピュータと同じコンピュータに実装されても、別のコンピュータに実装されてもよい。マルチプレクサ5は、各ビットレート変換装置4A〜4Dから、各々に設定されたビットレートの映像ストリーム(例えば、MPEG2−TS形式)に変換された動画像データを受け取り、上記複数のストリームをGOP単位でマルチプレクスする(図2参照)。このとき、音声ESを多重化してもよい。   The multiplexer 5 is a computer including a processor, a memory, and a network interface, and may be mounted on the same computer as the computer on which the video reception device 3 is mounted or may be mounted on another computer. The multiplexer 5 receives the moving image data converted into the video stream (for example, MPEG2-TS format) of the bit rate set for each from the bit rate conversion devices 4A to 4D, and the plurality of streams in GOP units. Multiplex (see FIG. 2). At this time, the audio ES may be multiplexed.

なお、ビットレート変換装置4A〜4Dとマルチプレクサ5とが別のコンピュータに実装される場合、両装置をネットワークによって接続するとよい。また、ビットレート変換装置4A〜4Dが専用ハードウェアによって実現される場合、マルチプレクサ5は、映像受信装置3が実装されるコンピュータのプロセッサと同一のプロセッサで動作するものでもよい。   When the bit rate conversion devices 4A to 4D and the multiplexer 5 are mounted on different computers, both devices may be connected by a network. When the bit rate conversion devices 4A to 4D are realized by dedicated hardware, the multiplexer 5 may be operated by the same processor as the computer processor in which the video reception device 3 is mounted.

また、マルチプレクサ5を設けず、各ビットレート変換装置4A〜4Dが独立して、ストリーム切替装置7A〜7Eに、ビットレートが変換されたTSパケットをブロードキャストし、ストリーム切換装置7A〜7Eで複数ストリームのパケットを収集し、収集したパケットを並べ替えてもよい。   Also, the multiplexer 5 is not provided, and each of the bit rate conversion devices 4A to 4D independently broadcasts the TS packet with the bit rate converted to the stream switching devices 7A to 7E, and the stream switching devices 7A to 7E perform a plurality of streams. May be collected, and the collected packets may be rearranged.

ストリーム切替装置7A〜7Eは、プロセッサ、メモリ及びネットワークインタフェースを備えるコンピュータであり、Stream Receiverスレッド71と、Stream Writerスレッド73と、複数のStream Switcherスレッド74とが動作している(図3参照)。   The stream switching devices 7A to 7E are computers each including a processor, a memory, and a network interface, and a stream receiver thread 71, a stream writer thread 73, and a plurality of stream switch threads 74 are operating (see FIG. 3).

Stream Writerスレッド73は、受信したストリームをデマルチプレクスし、デマルチプレクスされたストリームをリングバッファ構造の共有メモリに書き込む。Stream Switcherスレッド74は、映像配信装置8A〜8Eからの要求に従ってポインタを前方に進めながらリングバッファからGOPを読み出し、読み出された動画像データを出力する。   The Stream Writer thread 73 demultiplexes the received stream and writes the demultiplexed stream in the shared memory having the ring buffer structure. The Stream Switcher thread 74 reads the GOP from the ring buffer while advancing the pointer forward according to the request from the video distribution apparatuses 8A to 8E, and outputs the read moving image data.

その際、ストリーム切替装置7A〜7Eは、送信レートが目標レートより高ければより低いレートの動画像データを、低ければより高いレートの動画像データを選択する。GOPの選択方法については後述する。目標レートは、映像配信装置8A〜8Eとクライアント端末(図示省略)との間の通信帯域の値を用いてもよい。   At this time, the stream switching devices 7A to 7E select moving image data at a lower rate if the transmission rate is higher than the target rate, and select moving image data at a higher rate if the transmission rate is lower. A GOP selection method will be described later. As the target rate, the value of the communication band between the video distribution apparatuses 8A to 8E and the client terminal (not shown) may be used.

マルチプレクサ5とストリーム切替装置7A〜7Eとの間は、ブロードキャスト通信が可能なネットワークによって接続するとよい。   The multiplexer 5 and the stream switching devices 7A to 7E may be connected by a network capable of broadcast communication.

映像配信装置8A〜8Eは、プロセッサ、メモリ及びネットワークインタフェースを備えるコンピュータである。映像配信装置8A〜8Eは、クライアント端末(図示省略)に映像を配信する装置であり、Webサーバ及びRTPサーバに実装することができる。なお、映像配信装置8A〜8Eは、ストリーム切換装置7A〜7Eが実装されるコンピュータのCPUと同一のCPUで動作するものでもよい。   The video distribution devices 8A to 8E are computers each including a processor, a memory, and a network interface. The video distribution devices 8A to 8E are devices that distribute video to client terminals (not shown), and can be mounted on a Web server and an RTP server. Note that the video distribution devices 8A to 8E may be operated by the same CPU as the CPU of the computer on which the stream switching devices 7A to 7E are mounted.

ストリーム切換装置7A〜7Eと映像配信装置8A〜8Eとが別のコンピュータに実装される場合、両装置をネットワークによって接続するとよい。   When the stream switching devices 7A to 7E and the video distribution devices 8A to 8E are mounted on different computers, both devices may be connected via a network.

負荷監視装置6は、プロセッサ、メモリ及びネットワークインタフェースを備えるコンピュータであり、システムのネットワーク負荷および各装置のプロセッサの負荷を監視する。特に、ストリーム切換装置7A〜7Eのプロセッサの負荷、映像配信装置8A〜8Eのプロセッサの負荷、および映像配信装置8A〜8Eが接続されるネットワークの負荷と予め定められた閾値とを、各々比較する。そして、これらの負荷率が予め定められた閾値(例えば、上限値の90%)を超えた場合、各ビットレート変換装置4A〜4Dから出力される動画像データのビットレートを下げることによって、システム全体の負荷を下げる。一方、これらの負荷率が予め定められた別の閾値(例えば、上限値の80%)未満となった場合は、各ビットレート変換装置に割り当てられた初期値(25Mbps、20Mbps、15Mbps、10Mbpsなど)を上限として、各ビットレート変換装置から出力される動画像データのビットレートを上げる。   The load monitoring device 6 is a computer including a processor, a memory, and a network interface, and monitors the network load of the system and the load of the processor of each device. In particular, the processor load of the stream switching devices 7A to 7E, the processor load of the video distribution devices 8A to 8E, and the load of the network to which the video distribution devices 8A to 8E are connected are compared with a predetermined threshold value. . When these load factors exceed a predetermined threshold value (for example, 90% of the upper limit value), the bit rate of the moving image data output from each of the bit rate conversion devices 4A to 4D is lowered, thereby reducing the system Reduce the overall load. On the other hand, when these load factors become less than another predetermined threshold (for example, 80% of the upper limit value), initial values (25 Mbps, 20 Mbps, 15 Mbps, 10 Mbps, etc.) assigned to each bit rate conversion device ) Is the upper limit, and the bit rate of moving image data output from each bit rate conversion device is increased.

図2は、本発明の第1の実施の形態のマルチプレクサ5の動作を示す説明図である。なお、図2には、ビットレート変換装置4A〜4Cの各々から出力された、25Mbps、20Mbps及び15Mbpsの動画像データを多重化することによって合成した信号を示す。   FIG. 2 is an explanatory diagram illustrating the operation of the multiplexer 5 according to the first embodiment of this invention. FIG. 2 shows signals synthesized by multiplexing moving image data of 25 Mbps, 20 Mbps, and 15 Mbps output from each of the bit rate conversion devices 4A to 4C.

信号Aは、ビットレート変換装置4Aから出力された25Mbpsの動画像データ(例えば、MPEG2−TS形式の映像ストリーム)であり、PID250が付されている。信号Bは、ビットレート変換装置4Bから出力された20Mbpsの動画像データであり、PID200が付されている。信号Cは、ビットレート変換装置4Cから出力された15Mbpsの動画像データであり、PID150が付されている。これらの動画像データは、単一のビデオESをTS形式にパケット化したものである。ここで、PIDとは、TS形式に多重化された各ストリームを識別するための識別子である。   The signal A is 25 Mbps moving image data (for example, a video stream in the MPEG2-TS format) output from the bit rate conversion device 4A, and has a PID 250 attached thereto. The signal B is 20 Mbps moving image data output from the bit rate conversion device 4B, and is given PID200. The signal C is 15 Mbps moving image data output from the bit rate conversion device 4C, and is given PID150. These moving image data are obtained by packetizing a single video ES in the TS format. Here, the PID is an identifier for identifying each stream multiplexed in the TS format.

マルチプレクサ5は、25Mbps、20Mbps及び15Mbpsの動画像データをGOP単位で連結して、マルチプレクスされたTSストリームを生成する。このマルチプレクスされたTSストリームには、各ビットレートのGOP毎の動画像データがGOPの順に含まれている。なお、音声ESを多重化してもよい。   The multiplexer 5 concatenates 25 Mbps, 20 Mbps, and 15 Mbps moving image data in GOP units to generate a multiplexed TS stream. The multiplexed TS stream includes moving image data for each GOP at each bit rate in the order of GOP. Note that the audio ES may be multiplexed.

ストリーム切換装置7A〜7Eは、動画像データのビットレートをPIDによって判定し、必要なビットレートの動画像データのGOPを選択する。   The stream switching devices 7A to 7E determine the bit rate of moving image data based on the PID, and select a GOP of moving image data having a necessary bit rate.

図3は、本発明の第1の実施の形態のストリーム切替装置7A〜7Eによる処理を示す説明図である。図3には、ビットレート変換装置4A〜4Cの各々から出力された、多重化された25Mbps、20Mbps及び15Mbpsの動画像データを分離して出力する様子を示す。   FIG. 3 is an explanatory diagram illustrating processing by the stream switching devices 7A to 7E according to the first embodiment of this invention. FIG. 3 shows a state in which multiplexed 25 Mbps, 20 Mbps, and 15 Mbps moving image data output from each of the bit rate conversion devices 4A to 4C is separated and output.

前述したように、各ストリーム切替装置7A〜7Eでは、Stream Receiverスレッド71、Stream Writerスレッド73、及び複数のStream Switcherスレッド74が動作している。   As described above, in each of the stream switching devices 7A to 7E, the Stream Receiver thread 71, the Stream Writer thread 73, and the plurality of Stream Switch threads 74 are operating.

また、各ストリーム切替装置7A〜7Eは、複数のリングバッファ75を備え、各リングバッファには、各ビットレートのデータがGOP単位で格納されており、各GOPのデータは、参照ポインタ76によって、矢印の向きに結合されている。各スレッド71、72、73は、この参照ポインタ76を手繰りながら、各リングバッファに格納されたデータを処理する。このリングバッファは、各スレッドからアクセス可能な共有メモリに設けられる。   Each of the stream switching devices 7A to 7E includes a plurality of ring buffers 75. Each ring buffer stores data of each bit rate in units of GOPs. Combined in the direction of the arrow. Each thread 71, 72, 73 processes the data stored in each ring buffer while handing over this reference pointer 76. This ring buffer is provided in a shared memory accessible from each thread.

Stream Receiverスレッド71は、マルチプレクサ5からTSデータを受信し、FIFO(First In First Out)バッファ72に格納する。   The Stream Receiver thread 71 receives TS data from the multiplexer 5 and stores it in a FIFO (First In First Out) buffer 72.

Stream Writerスレッド73は、Stream Receiverスレッド71が受信したストリームをデマルチプレクスし、各ビットレートのデータを対応するリングバッファに書き込む。   The Stream Writer thread 73 demultiplexes the stream received by the Stream Receiver thread 71 and writes the data of each bit rate to the corresponding ring buffer.

すなわち、Stream Writerスレッド73は、TSデータをPID毎に仕分けし、対応するリングバッファの書き込みポイントタに書き込む。このデータの書き込みは、同一フレームのGOPを一度に書き込む不可分操作(アトミック操作)によって行われる。すなわち、リングバッファへのデータの書き込み中は、データが書き込まれるエントリへの、Stream Switcherスレッド74によるアクセスが禁止される。なお、最も直近にデータが書き込まれたエントリがリングバッファの先頭である。   That is, the Stream Writer thread 73 sorts the TS data for each PID and writes it to the write pointer of the corresponding ring buffer. This data writing is performed by an inseparable operation (atomic operation) in which GOPs of the same frame are written at a time. In other words, during the writing of data to the ring buffer, access to the entry to which data is written by the Stream Switcher thread 74 is prohibited. The entry in which data is most recently written is the head of the ring buffer.

Stream Switcherスレッド74は、映像配信装置の要求に従って読み出しポインタを前方に進めながらリングバッファからGOPを読み出して、読み出されたGOPを出力する。なお、読み出されたGOPに音声ESを多重化してもよい。   The Stream Switcher thread 74 reads the GOP from the ring buffer while advancing the read pointer in accordance with a request from the video distribution apparatus, and outputs the read GOP. Note that the audio ES may be multiplexed with the read GOP.

図4は、本発明の第1の実施の形態のStream Switcherスレッド74による処理のフローチャートである。   FIG. 4 is a flowchart of a process performed by the stream switch thread 74 according to the first embodiment of this invention.

Stream Switcherスレッド74が動作するプロセッサは、まず、受信側のクライアント端末からの動画像送信リクエストを待つ(S101)。   The processor on which the Stream Switch thread 74 operates first waits for a moving image transmission request from the client terminal on the receiving side (S101).

そして、送信リクエストを受信した後、(1)書き込みポインタが読み出しポインタを追い越したか、又は、(2)読み出しポインタから書き込みポインタまでの距離がリングバッファ長の90%以上となったかを判定する(S102)。   After receiving the transmission request, it is determined whether (1) the write pointer has passed the read pointer or (2) the distance from the read pointer to the write pointer is 90% or more of the ring buffer length (S102). ).

この条件(1)又は(2)のいずれかが成立した場合、GOPをスキップし、読み出しポインタと書き込みポインタとの距離が、リングバッファ長の50%程度となるように調整する。すなわち、この条件(1)が成立した場合、リングバッファが既にオーバーフローしている。また、条件(2)が成立した場合、有効データがリングバッファ長の90%以上となっており、バッファがオーバーフローする可能性が高い。このため、所定数のGOPを読み出すことなく、読み出しポインタを進める(S103)。このスキップされるGOPは、リングバッファ長の約半分に相当する量が望ましい。なお、読み出しポインタと書き込みポインタとの位置が、Stream Switcherスレッド74が安定的にデータを読み出すことができるような関係であれば、スキップされるGOPの量は任意の量でよい。   If either of the conditions (1) or (2) is satisfied, the GOP is skipped and the distance between the read pointer and the write pointer is adjusted to be about 50% of the ring buffer length. That is, when this condition (1) is satisfied, the ring buffer has already overflowed. Further, when the condition (2) is satisfied, the valid data is 90% or more of the ring buffer length, and there is a high possibility that the buffer overflows. For this reason, the read pointer is advanced without reading a predetermined number of GOPs (S103). The skipped GOP is desirably an amount corresponding to about half of the ring buffer length. If the position of the read pointer and the write pointer is such that the Stream Switcher thread 74 can stably read data, the amount of skipped GOP may be an arbitrary amount.

一方、条件(1)及び(2)のいずれかも成立していない場合、リングバッファは書き込み可能な容量があると判定し、ステップS104に進む。   On the other hand, if neither of the conditions (1) and (2) is satisfied, it is determined that the ring buffer has a writable capacity, and the process proceeds to step S104.

ステップS104では、どのレートのGOPを選択するかを決定するGOP選択処理を実行する。GOPを選択する処理の詳細は、図5及び図6を用いて詳述する。   In step S104, GOP selection processing for determining which rate of GOP to select is executed. Details of the process of selecting a GOP will be described in detail with reference to FIGS.

ステップS104の後、選択されたGOPを送信するGOP送信処理を実行し(S105)、現リングバッファの次のエントリへ読み出しポインタを進める(S106)。   After step S104, GOP transmission processing for transmitting the selected GOP is executed (S105), and the read pointer is advanced to the next entry in the current ring buffer (S106).

その後、読み出しポインタから書き込みポインタまでの距離が0であるか否かを判定する(S107)。読み出しポインタから書き込みポインタまでの距離が0でなければ、リングバッファには読み出すことができる有効データが格納されているので、ステップS102に戻り、次のGOPを処理する。   Thereafter, it is determined whether or not the distance from the read pointer to the write pointer is 0 (S107). If the distance from the read pointer to the write pointer is not 0, valid data that can be read is stored in the ring buffer, and the process returns to step S102 to process the next GOP.

一方、読み出しポインタから書き込みポインタまでの距離が0であれば、リングバッファには読み出すことができる有効データが格納されていない。このため、読み出しポインタがストリームの終端に達し、Stream Switcherスレッド74が停止しているか否かを判定する(S108)。   On the other hand, if the distance from the read pointer to the write pointer is 0, no valid data that can be read is stored in the ring buffer. For this reason, it is determined whether or not the read pointer reaches the end of the stream and the Stream Switcher thread 74 is stopped (S108).

その結果、読み出しポインタがストリームの終端に達している場合、このStream Switcherスレッド74による処理を終了する。一方、読み出しポインタがストリームの終端に達していない場合、読み出すことができる有効データがリングバッファに格納されるまでの所定時間(例えば、0.5秒)、Stream Switcherスレッド74を停止した後、ステップS102に戻り、次のGOPを処理する。   As a result, if the read pointer has reached the end of the stream, the processing by the Stream Switcher thread 74 is terminated. On the other hand, if the read pointer has not reached the end of the stream, after the Stream Switcher thread 74 is stopped for a predetermined time (for example, 0.5 seconds) until valid data that can be read is stored in the ring buffer, Returning to S102, the next GOP is processed.

図5は、本発明の第1の実施の形態のGOP選択処理の一例(方法1)のフローチャートである。   FIG. 5 is a flowchart of an example (method 1) of the GOP selection process according to the first embodiment of this invention.

方法1では、Stream Switcherスレッド74は、送信レートが目標レートより高ければ、より低いレートを選択し、送信レートが目標レートより低ければ、より高いレートを選択する。この目標レートは、例えば、映像配信装置8A〜8Eとクライアント端末との間の回線の帯域等によって定めるとよい。また、送信レートは、直近の所定時間(例えば、10秒間)に送信したデータ量を用いるとよい。   In Method 1, the Stream Switcher thread 74 selects a lower rate if the transmission rate is higher than the target rate, and selects a higher rate if the transmission rate is lower than the target rate. This target rate may be determined by, for example, the bandwidth of the line between the video distribution apparatuses 8A to 8E and the client terminal. The transmission rate may be the amount of data transmitted during the latest predetermined time (for example, 10 seconds).

そして、選択されたレートの動画像データ(GOPデータ)によって構成された映像データを映像配信装置8A〜8Eに出力する。その結果、例えば、図7に示す様にレートが変化する映像データが生成される。   And the video data comprised by the moving image data (GOP data) of the selected rate is output to the video delivery apparatuses 8A-8E. As a result, for example, video data whose rate changes as shown in FIG. 7 is generated.

但し、ポインタの現在位置が予め定められた位置(例えば、読み出しポインタから20%進んだ位置より近い位置)である場合は、低いレートを選択する。これは、ポインタの現在位置が予め定められた位置より後方である場合は、リングバッファに蓄積されている有効データの量が20%より少ないために、リングバッファからのデータの読み出し量を制限して、バッファアンダーランによる映像の途切れを避けるためである。   However, if the current position of the pointer is a predetermined position (for example, a position closer to a position advanced by 20% from the read pointer), a low rate is selected. This is because if the current position of the pointer is behind the predetermined position, the amount of valid data stored in the ring buffer is less than 20%, so the amount of data read from the ring buffer is limited. This is to avoid interruption of the video due to buffer underrun.

方法1のGOP選択処理について、フローチャートに従って具体的に説明する。   The GOP selection process of Method 1 will be specifically described according to the flowchart.

まず、送信レートを算出する(S111)。この送信レートの算出は、所定のサンプリング区間(例えば、直近の10秒)を定め、その区間内で実際に送信されたデータのレートの平均値(サンプリング区間での送信ビット量/時間)を求めることができる。また、サンプリング区間で実際に送信されたデータ量を線形回帰分析等を用いて直線に当てはめた場合の傾きを送信レートとしてもよい。   First, a transmission rate is calculated (S111). The calculation of the transmission rate defines a predetermined sampling interval (for example, the latest 10 seconds), and obtains the average value of the data actually transmitted within that interval (transmission bit amount / time in the sampling interval). be able to. Further, the transmission rate may be a slope when the amount of data actually transmitted in the sampling interval is applied to a straight line using linear regression analysis or the like.

その後、算出された送信レートと目標レートとを比較し、送信レートから目標レートを減じた値が所定値(C1)を超えるか否かを判定する(S112)。その結果、送信レート−目標レート>C1である場合、送信レートが目標レートより大きいので、一段階低いレートのリングバッファからGOPを選択して(S114)、GOP選択処理を終了する。   Thereafter, the calculated transmission rate is compared with the target rate, and it is determined whether or not a value obtained by subtracting the target rate from the transmission rate exceeds a predetermined value (C1) (S112). As a result, if transmission rate−target rate> C1, the transmission rate is larger than the target rate, so a GOP is selected from the ring buffer at a lower rate (S114), and the GOP selection process is terminated.

一方、送信レート−目標レート≦C1である場合、送信レートから目標レートを減じた値が所定値(C2)を未満か否かを判定する(S113)。その結果、送信レート−目標レート<C2である場合、送信レートが目標レートより小さいので、一段階高いレートのリングバッファからGOPを選択して(S115)、GOP選択処理を終了する。   On the other hand, if transmission rate−target rate ≦ C1, it is determined whether or not a value obtained by subtracting the target rate from the transmission rate is less than a predetermined value (C2) (S113). As a result, if transmission rate−target rate <C2, since the transmission rate is smaller than the target rate, a GOP is selected from the ring buffer having a higher step (S115), and the GOP selection process is terminated.

一方、C2≦送信レート−目標レート≦C1である場合、送信される動画像データのビットレートを変更する必要がないので、現在選択されているレートのGOPを選択して(S116)、GOP選択処理を終了する。   On the other hand, if C2 ≦ transmission rate−target rate ≦ C1, it is not necessary to change the bit rate of the moving image data to be transmitted. Therefore, the GOP of the currently selected rate is selected (S116), and the GOP is selected. The process ends.

図6は、本発明の第1の実施の形態のGOP選択処理の一例(方法2)のフローチャートである。   FIG. 6 is a flowchart of an example (method 2) of the GOP selection process according to the first embodiment of this invention.

方法2では、書き込みポインタと対向する位置を目標として読み出しポインタを制御する。具体的には、読み出しポインタの位置が目標位置よりも進んでいる場合は、より高いレートを選択する。一方、読み出しポインタの位置が目標位置よりも遅れている場合は、より低いレートを選択する。   In Method 2, the read pointer is controlled with the position facing the write pointer as a target. Specifically, when the position of the read pointer is ahead of the target position, a higher rate is selected. On the other hand, if the position of the read pointer is behind the target position, a lower rate is selected.

すなわち、送信レートを超えるレートでデータがリングバッファに書き込まれた場合、書き込みポインタが読み出しポインタに追いついて、バッファがオーバーフローする。一方、送信レートより低いレートでデータがリングバッファに書き込まれた場合、読み出しポインタが書き込みポインタに追いついて、バッファがアンダーフローする。このため、リングバッファに蓄積されるデータ量が適正となるように、読み出しポインタの目標位置を書き込みポインタと対向する位置になるように、すなわち、読み出すことが出来る有効データ量は、リングバッファの容量の50%程度に制御される。   That is, when data is written to the ring buffer at a rate exceeding the transmission rate, the write pointer catches up with the read pointer and the buffer overflows. On the other hand, when data is written into the ring buffer at a rate lower than the transmission rate, the read pointer catches up with the write pointer and the buffer underflows. For this reason, the effective amount of data that can be read is the capacity of the ring buffer so that the target position of the read pointer is opposite to the write pointer so that the amount of data stored in the ring buffer is appropriate. Is controlled to about 50%.

方法2のGOP選択処理について、フローチャートに従って具体的に説明する。   The GOP selection process of Method 2 will be specifically described according to the flowchart.

まず、送信レートを算出する(S131)。この送信レートの算出は、方法1のGOP選択処理(図5)で説明した方法と同じ方法を採用することができる。   First, the transmission rate is calculated (S131). For the calculation of the transmission rate, the same method as that described in the GOP selection process (FIG. 5) of Method 1 can be employed.

その後、読み出しポインタから書き込みポインタまでの距離がリングバッファ長の20%未満か否かを判定する(S132)。その結果、読み出しポインタから書き込みポインタまでの距離がリングバッファ長の20%未満である場合、読み出すことができる有効データが少ないので、一段階低いレートのリングバッファからGOPを選択して(S314)、GOP選択処理を終了する。   Thereafter, it is determined whether or not the distance from the read pointer to the write pointer is less than 20% of the ring buffer length (S132). As a result, when the distance from the read pointer to the write pointer is less than 20% of the ring buffer length, there is little effective data that can be read, so a GOP is selected from the ring buffer at a lower rate (S314), The GOP selection process is terminated.

一方、読み出しポインタから書き込みポインタまでの距離がリングバッファ長の20%以上である場合、読み出しポインタから書き込みポインタまでの距離がリングバッファ長の80%より大きいか否かを判定する(S133)。その結果、読み出しポインタから書き込みポインタまでの距離がリングバッファ長の80%より大きい場合、読み出すことができる有効データが多いので、一段階高いレートのリングバッファからGOPを選択して(S135)、GOP選択処理を終了する。   On the other hand, if the distance from the read pointer to the write pointer is 20% or more of the ring buffer length, it is determined whether or not the distance from the read pointer to the write pointer is greater than 80% of the ring buffer length (S133). As a result, when the distance from the read pointer to the write pointer is greater than 80% of the ring buffer length, there is a lot of valid data that can be read, so a GOP is selected from the ring buffer with a higher step (S135). The selection process ends.

一方、読み出しポインタから書き込みポインタまでの距離がリングバッファ長の20%以上かつ80%以下である場合、読み出すことができる有効データの量は適正であると判定し、現在選択されているレートのGOPを選択して(S136)、GOP選択処理を終了する。   On the other hand, if the distance from the read pointer to the write pointer is not less than 20% and not more than 80% of the ring buffer length, it is determined that the amount of valid data that can be read is appropriate, and the GOP at the currently selected rate. Is selected (S136), and the GOP selection process is terminated.

図7は、前述した方法1によってレートが選択された映像データの変化を示す説明図である。   FIG. 7 is an explanatory diagram showing changes in video data whose rate is selected by the method 1 described above.

グラフ中、時間軸に平行な破線は20Mbpsのデータレートによる、各GOPの累積データ量を示し、時間軸に平行な一点鎖線は25Mbpsのデータレートによる、各GOPの累積データ量を示す。   In the graph, a broken line parallel to the time axis indicates the accumulated data amount of each GOP at a data rate of 20 Mbps, and a one-dot chain line parallel to the time axis indicates an accumulated data amount of each GOP at a data rate of 25 Mbps.

図7に示す状態ではGOPn+4までは、25Mbpsのデータが選択され、次のGOPn+3は低い20Mbpsのデータが選択され、次のGOPn+2は高い25Mbpsのデータが選択され、次のGOPn+1及びGOPnは低い20Mbpsのデータが選択された。   In the state shown in FIG. 7, up to GOPn + 4, 25 Mbps data is selected, the next GOPn + 3 is low 20 Mbps data, the next GOPn + 2 is high 25 Mbps data, and the next GOPn Low 20 Mbps data was selected for +1 and GOPn.

このため、本実施の形態のストリーム切替装置7A〜7Eから出力される動画像データは、25Mbpsと20Mbpsとの間のレートを維持することができる。   For this reason, the moving image data output from the stream switching devices 7A to 7E of the present embodiment can maintain a rate between 25 Mbps and 20 Mbps.

以上説明したように、本発明の第1の実施の形態では、GOP毎に適正なレートのGOPを選択することによって、クライアント端末に適するレートで動画像データを配信することができ、バッファアンダーランによる映像の途切れを避けることができる。   As described above, in the first embodiment of the present invention, by selecting a GOP having an appropriate rate for each GOP, moving image data can be distributed at a rate suitable for the client terminal, and a buffer underrun is performed. You can avoid the interruption of the video.

<実施形態2>
次に、本発明の第2の実施の形態について説明する。
<Embodiment 2>
Next, a second embodiment of the present invention will be described.

動画像符号化形式によっては、GOP間に依存関係があり、簡単にGOP単位で切り替えることができない場合がある。例えば、オープンGOPは、前後のGOPとの依存関係があるので、前後のGOPがない場合は、フレームを再生することができない。そこで、第2の実施の形態では、15フレーム分のオープンGOP、7フレーム分の後方クローズドGOP、又は、8フレーム分の前方クローズドGOPを生成する。   Depending on the moving picture coding format, there is a dependency relationship between GOPs, and there is a case where it is not possible to easily switch between GOPs. For example, since an open GOP has a dependency relationship with the preceding and succeeding GOPs, a frame cannot be reproduced if there is no preceding or following GOP. Therefore, in the second embodiment, an open GOP for 15 frames, a rear closed GOP for 7 frames, or a front closed GOP for 8 frames is generated.

図8は、本発明の第2の実施の形態の動画ストリーム配信システムの構成を示すブロック図である。   FIG. 8 is a block diagram illustrating a configuration of a moving picture stream distribution system according to the second embodiment of this invention.

第2の実施の形態の動画ストリーム配信システムは、カムコーダ1、ネットワーク2、映像受信装置3、複数のビットレート変換装置4A〜4E、マルチプレクサ5、負荷監視装置6、複数のストリーム切替装置7A〜7E及び複数の映像配信装置8A〜8Eを備える。なお、第2の実施の形態において、前述した第1の実施の形態と同じ構成には同じ符号を付し、それらの説明は省略する。   The video stream distribution system according to the second embodiment includes a camcorder 1, a network 2, a video reception device 3, a plurality of bit rate conversion devices 4A to 4E, a multiplexer 5, a load monitoring device 6, and a plurality of stream switching devices 7A to 7E. And a plurality of video distribution apparatuses 8A to 8E. Note that, in the second embodiment, the same components as those in the first embodiment described above are denoted by the same reference numerals, and description thereof is omitted.

第2の実施の形態の動画ストリーム配信システムは、前述した第1の実施の形態の動画ストリーム配信システムと異なり、30Mbpsのソース映像もビットレート変換装置4Eを経由してマルチプレクサ5に入力される。   Unlike the moving picture stream distribution system of the first embodiment described above, the moving picture stream distribution system of the second embodiment also inputs a source video of 30 Mbps to the multiplexer 5 via the bit rate conversion device 4E.

第2の実施の形態のビットレート変換装置4A〜4Dは、ソース映像のデータレートを変換して、低いレートの動画像データに変換し、さらに、そのビットレートのオープンGOP、後方クローズドGOP及び前方クローズドGOPを生成する。また、ビットレート変換装置4Eは、ソース映像のデータレートを変えずに、そのビットレートのオープンGOP、後方クローズドGOP及び前方クローズドGOPを生成する(図9参照)。ここで、オープンGOPは、GOP間の前後両方の依存関係があるGOPで、15フレームのデータを含む。後方クローズドGOPは、前方のGOPのみとの依存関係があるGOPで、7フレームのデータを含む。前方クローズドGOPは、後方のGOPのみとの依存関係があるGOPで、8フレームのデータを含む。すなわち、後方クローズドGOP及び前方クローズドGOPを合わせて、オープンGOPに含まれるフレームを再生することができる。   The bit rate conversion devices 4A to 4D according to the second embodiment convert the data rate of the source video to convert it to low-rate moving image data, and further, open GOP, rear closed GOP, and front of the bit rate. Create a closed GOP. Also, the bit rate conversion device 4E generates an open GOP, a rear closed GOP, and a front closed GOP of the bit rate without changing the data rate of the source video (see FIG. 9). Here, an open GOP is a GOP having both front and rear dependencies between GOPs, and includes 15 frames of data. The rear closed GOP is a GOP having a dependency relationship with only the front GOP, and includes 7 frames of data. The front closed GOP is a GOP having a dependency relationship with only the rear GOP, and includes 8 frames of data. That is, the frame included in the open GOP can be reproduced by combining the rear closed GOP and the front closed GOP.

マルチプレクサ5は、各ビットレート変換装置4A〜4Dから、各データレートのオープンGOP、後方クローズドGOP及び前方クローズドGOPを受け取り、上記複数のデータレートのGOPをマルチプレクスする(図9参照)。このとき、音声ESを多重化してもよい。   The multiplexer 5 receives the open GOP, the rear closed GOP, and the front closed GOP of each data rate from each of the bit rate conversion devices 4A to 4D, and multiplexes the GOPs of the plurality of data rates (see FIG. 9). At this time, the audio ES may be multiplexed.

ストリーム切替装置7A〜7EのStream Switcherスレッド74は、データレートの切り換えが発生しない場合、リングバッファからオープンGOPを読み出す。一方、Stream Switcherスレッド74は、データレートの切り換えが発生する場合、切り替え元のレートの後方クローズドGOPと、切換先のレートの前方クローズドGOPとを読み出す。   The Stream Switcher thread 74 of the stream switching devices 7A to 7E reads the open GOP from the ring buffer when the data rate does not switch. On the other hand, when the data rate switching occurs, the Stream Switcher thread 74 reads the backward closed GOP of the switching source rate and the forward closed GOP of the switching destination rate.

図9は、本発明の第2の実施の形態のマルチプレクサ5の動作を示す説明図である。   FIG. 9 is an explanatory diagram illustrating the operation of the multiplexer 5 according to the second embodiment of this invention.

ビットレート変換装置4Aは、ソース映像(30Mbps)のビットレートを変換して、低いレートのオープンGOP、後方クローズドGOP及び前方クローズドGOPを生成する。例えば、オープンGOPは25Mbpsの動画像データ(例えば、MPEG2−TS形式の映像ストリーム)であり、PID250が付されている。また、同様に、後方クローズドGOPにはPID251が付されており、前方クローズドGOPにはPID252が付されている。すなわち、第2の実施の形態におけるPIDは、GOPのビットレート及び種類を識別するための識別子である。このため、ストリーム切替装置7A〜7Eは、PIDによって、選択するGOPを区別することができる。   The bit rate conversion device 4A converts the bit rate of the source video (30 Mbps) to generate a low-rate open GOP, rear closed GOP, and front closed GOP. For example, an open GOP is 25 Mbps moving image data (for example, a video stream in the MPEG2-TS format) and has a PID 250 attached thereto. Similarly, the PID 251 is assigned to the rear closed GOP, and the PID 252 is assigned to the front closed GOP. That is, the PID in the second embodiment is an identifier for identifying the bit rate and type of GOP. For this reason, the stream switching devices 7A to 7E can distinguish the GOP to be selected based on the PID.

なお、図9には、ビットレート変換装置4Aから出力された25Mbpsの動画像データのみを図示するが、同様に、30Mbps、20Mbps、15Mbps及び10Mbpsにおいても、オープンGOP、後方クローズドGOP及び前方クローズドGOPを含む動画像データが各ビットレート変換装置から出力されている。   Note that FIG. 9 illustrates only 25 Mbps moving image data output from the bit rate conversion device 4A. Similarly, the open GOP, the rear closed GOP, and the front closed GOP are also used at 30 Mbps, 20 Mbps, 15 Mbps, and 10 Mbps. Is output from each bit rate conversion device.

マルチプレクサ5は、30Mbpsから10Mbpsの動画像データをGOP単位で連結して、マルチプレクスされたTSストリームを生成する。このマルチプレクスされたTSストリームには、GOP毎に各ビットレートの動画像データ(オープンGOP、後方クローズドGOP及び前方クローズドGOP)がGOPの順に含まれている。なお、音声ESを多重化してもよい。   The multiplexer 5 concatenates moving image data from 30 Mbps to 10 Mbps in units of GOPs, and generates a multiplexed TS stream. The multiplexed TS stream includes moving image data (open GOP, rear closed GOP, and front closed GOP) of each bit rate for each GOP in the order of GOP. Note that the audio ES may be multiplexed.

ストリーム切換装置7A〜7Eは、動画像データのビットレート及びGOPの種類をPIDによって判定し、必要なビットレートの動画像データのGOPを選択する。   The stream switching devices 7A to 7E determine the bit rate of moving image data and the type of GOP based on the PID, and select the GOP of moving image data having a necessary bit rate.

図10は、本発明の第1の実施の形態のストリーム切替装置7A〜7Eによる処理を示す説明図である。図10には、ビットレート変換装置4E、4A、4Bの各々から出力され、多重化された30Mbps、25Mbps及び20Mbpsの動画像データを分離して、選択されたGOPによる動画像データを出力する様子を示す。   FIG. 10 is an explanatory diagram illustrating processing performed by the stream switching devices 7A to 7E according to the first embodiment of this invention. FIG. 10 shows a state in which the multiplexed moving image data of 30 Mbps, 25 Mbps, and 20 Mbps output from each of the bit rate conversion devices 4E, 4A, and 4B is separated, and the moving image data by the selected GOP is output. Indicates.

図3を用いて前述したように、各ストリーム切替装置7A〜7Eでは、Stream Receiverスレッド(図示省略)、Stream Writerスレッド(図示省略)、及び複数のStream Switcherスレッド74が動作している。   As described above with reference to FIG. 3, in each of the stream switching devices 7 </ b> A to 7 </ b> E, a Stream Receiver thread (not shown), a Stream Writer thread (not shown), and a plurality of Stream Switch threads 74 are operating.

また、各ストリーム切替装置7A〜7Eは、複数のリングバッファを備え、各リングバッファには、各ビットレートのデータ(オープンGOP、後方クローズドGOP及び前方クローズドGOP)がGOP単位で格納されており、各GOPのデータは、参照ポインタ76によって、矢印の向きに結合されている。なお、図中、オープンGOPには”O”の符号を付し、後方クローズドGOPには”C”の符号及び後方に太線を付し、前方クローズドGOPには”C”の符号及び前方に太線を付した。   Each of the stream switching devices 7A to 7E includes a plurality of ring buffers, and each ring buffer stores data of each bit rate (open GOP, rear closed GOP, and front closed GOP) in units of GOP. The data of each GOP is coupled in the direction of the arrow by a reference pointer 76. In the figure, the open GOP is marked with an “O”, the rear closed GOP is marked with a “C” and a thick line behind it, and the front closed GOP is marked with a “C” and a thick line ahead. Was attached.

各スレッドは、この参照ポインタ76を手繰りながら、各リングバッファに格納されたデータを処理する。このリングバッファは、各スレッドからアクセス可能な共有メモリに設けられる。   Each thread processes the data stored in each ring buffer while using the reference pointer 76. This ring buffer is provided in a shared memory accessible from each thread.

Stream Switcherスレッド74は、映像配信装置の要求に従って読み出しポインタを前方に進めながらリングバッファからGOPを読み出して、読み出したGOPを出力する。すなわち、Stream Switcherスレッド74は、データレートの切り換えが発生しない場合は、リングバッファからオープンGOPを読み出す。一方、Stream Switcherスレッド74は、データレートの切り換えが発生する場合は、切替元のレートの後方クローズドGOPと、切換先のレートの前方クローズドGOPとを読み出す。なお、図中、選択されたGOPにはハッチングを付した。   The Stream Switcher thread 74 reads the GOP from the ring buffer while advancing the read pointer in accordance with a request from the video distribution apparatus, and outputs the read GOP. That is, the Stream Switcher thread 74 reads the open GOP from the ring buffer when the data rate is not switched. On the other hand, when the data rate switching occurs, the Stream Switcher thread 74 reads the backward closed GOP of the switching source rate and the forward closed GOP of the switching destination rate. In the figure, the selected GOP is hatched.

これによって、レートが切り替わらないときは、圧縮率の高いオープンGOPを選択することによって、転送されるデータ量を抑制し、また、レートが切り替わるときは、後方クローズドGOP及び前方クローズドGOPを選択することによって、シームレスにデータレートが切り換えられる動画像データを配信することができる。   As a result, when the rate does not change, the open GOP with a high compression rate is selected to suppress the amount of data to be transferred, and when the rate changes, the rear closed GOP and the front closed GOP are selected. Therefore, moving image data whose data rate can be switched seamlessly can be distributed.

図11は、本発明の第2の実施の形態のStream Switcherスレッド74による処理のフローチャートである。   FIG. 11 is a flowchart of a process performed by the stream switch thread 74 according to the second embodiment of this invention.

Stream Switcherスレッド74が動作するプロセッサは、まず、受信側のクライアント端末からの動画像送信リクエストを待つ(S201)。   The processor on which the Stream Switch thread 74 operates first waits for a moving image transmission request from the receiving client terminal (S201).

そして、送信リクエストを受信した後、(1)書き込みポインタが読み出しポインタを追い越したか、又は、(2)読み出しポインタから書き込みポインタまでの距離がリングバッファ長の90%以上となったかを判定する(S202)。   After receiving the transmission request, it is determined whether (1) the write pointer has passed the read pointer, or (2) the distance from the read pointer to the write pointer is 90% or more of the ring buffer length (S202). ).

この条件(1)又は(2)のいずれかが成立した場合、GOPをスキップし、読み出しポインタと書き込みポインタとの距離が、リングバッファ長の50%程度となるように調整する。すなわち、この条件(1)が成立した場合、リングバッファが既にオーバーフローしている。また、条件(2)が成立した場合、有効データがリングバッファ長の90%以上となっており、バッファがオーバーフローする可能性が高い。このため、所定数のGOPを読み出すことなく、読み出しポインタを進める(S203)。このスキップされるGOPは、リングバッファ長の約半分に相当する量が望ましい。なお、読み出しポインタと書き込みポインタとの位置が、Stream Switcherスレッド74が安定的にデータを読み出すことができるような関係であれば、スキップされるGOPの量は任意の量でよい。   If either of the conditions (1) or (2) is satisfied, the GOP is skipped and the distance between the read pointer and the write pointer is adjusted to be about 50% of the ring buffer length. That is, when this condition (1) is satisfied, the ring buffer has already overflowed. Further, when the condition (2) is satisfied, the valid data is 90% or more of the ring buffer length, and there is a high possibility that the buffer overflows. Therefore, the read pointer is advanced without reading a predetermined number of GOPs (S203). The skipped GOP is desirably an amount corresponding to about half of the ring buffer length. If the position of the read pointer and the write pointer is such that the Stream Switcher thread 74 can stably read data, the amount of skipped GOP may be an arbitrary amount.

一方、条件(1)及び(2)のいずれかも成立していない場合、リングバッファは書き込み可能な容量があると判定し、ステップS204に進む。   On the other hand, if neither of the conditions (1) and (2) is satisfied, it is determined that the ring buffer has a writable capacity, and the process proceeds to step S204.

ステップS204では、どのレートのGOPを選択するかを決定し、選択されたGOPを送信するGOP選択・送信処理を実行する。GOP選択・送信処理の詳細は、図12及び図13を用いて詳述する。   In step S204, a GOP selection / transmission process of determining which rate of GOP to select and transmitting the selected GOP is executed. Details of the GOP selection / transmission process will be described in detail with reference to FIGS.

ステップS204の後、読み出しポインタから書き込みポインタまでの距離が0であるか否かを判定する(S207)。読み出しポインタから書き込みポインタまでの距離が0でなければ、リングバッファには読み出すことができる有効データが格納されているので、ステップS202に戻り、次のGOPを処理する。   After step S204, it is determined whether or not the distance from the read pointer to the write pointer is 0 (S207). If the distance from the read pointer to the write pointer is not 0, valid data that can be read is stored in the ring buffer, and the process returns to step S202 to process the next GOP.

一方、読み出しポインタから書き込みポインタまでの距離が0であれば、リングバッファには読み出すことができる有効データが格納されていない。このため、読み出しポインタがストリームの終端に達し、Stream Switcherスレッド74が停止しているか否かを判定する(S208)。   On the other hand, if the distance from the read pointer to the write pointer is 0, no valid data that can be read is stored in the ring buffer. For this reason, it is determined whether or not the read pointer has reached the end of the stream and the Stream Switcher thread 74 is stopped (S208).

その結果、読み出しポインタがストリームの終端に達している場合、このStream Switcherスレッド74による処理を終了する。一方、ストリームの終端に達していない場合、リングバッファには読み出すことができる有効データがリングバッファに格納されるまでの所定時間(例えば、0.5秒)、Stream Switcherスレッド74を停止した後、ステップS202に戻り、次のGOPを処理する。   As a result, if the read pointer has reached the end of the stream, the processing by the Stream Switcher thread 74 is terminated. On the other hand, if the end of the stream has not been reached, after stopping the Stream Switcher thread 74 for a predetermined time (for example, 0.5 seconds) until valid data that can be read in the ring buffer is stored in the ring buffer, Returning to step S202, the next GOP is processed.

図12は、本発明の第2の実施の形態のGOP選択処理の一例(方法1)のフローチャートである。   FIG. 12 is a flowchart of an example (method 1) of the GOP selection process according to the second embodiment of this invention.

方法1では、前述した第1の実施の形態と同様に、Stream Switcherスレッド74は、送信レートが目標レートより高ければ、より低いレートを選択し、送信レートが目標レートより低ければ、より高いレートを選択する。   In Method 1, as in the first embodiment described above, the Stream Switcher thread 74 selects a lower rate if the transmission rate is higher than the target rate, and a higher rate if the transmission rate is lower than the target rate. Select.

まず、送信レートを算出する(S211)。この送信レートの算出は、第1の実施の形態で前述した方法と同じ方法を採用することができる。   First, a transmission rate is calculated (S211). For the calculation of the transmission rate, the same method as described above in the first embodiment can be employed.

その後、算出された送信レートと目標レートとを比較し、送信レートから目標レートを減じた値が所定値(C1)を超えるか否かを判定する(S212)。その結果、送信レート−目標レート>C1である場合、送信レートが目標レートより大きいので、現在のGOPで送信レートを下げることを決定する。   Thereafter, the calculated transmission rate is compared with the target rate, and it is determined whether or not a value obtained by subtracting the target rate from the transmission rate exceeds a predetermined value (C1) (S212). As a result, if transmission rate−target rate> C1, the transmission rate is greater than the target rate, so it is determined to lower the transmission rate with the current GOP.

このため、現在選択されているレートのリングバッファから後方クローズドGOPを選択し、選択された後方クローズドGOPを送信する(S214)。その後、一段階低いレートのリングバッファの前方クローズドGOPを選択し(S215)、選択された前方クローズドGOPを送信する(S216)。この選択及び送信された後方クローズドGOP及び前方クローズドGOPによって、15フレームの画像を再生することができる。その後、ステップS221に進む。   For this reason, the rear closed GOP is selected from the ring buffer at the currently selected rate, and the selected rear closed GOP is transmitted (S214). Thereafter, the forward closed GOP of the ring buffer with a lower rate is selected (S215), and the selected forward closed GOP is transmitted (S216). A 15-frame image can be reproduced by the rear closed GOP and the front closed GOP selected and transmitted. Thereafter, the process proceeds to step S221.

一方、送信レート−目標レート≦C1である場合、送信レートから目標レートを減じた値が所定値(C2)を未満か否かを判定する(S213)。その結果、送信レート−目標レート<C2である場合、送信レートが目標レートより小さいので、現在のGOPで送信レートを上げる。   On the other hand, if transmission rate−target rate ≦ C1, it is determined whether or not a value obtained by subtracting the target rate from the transmission rate is less than a predetermined value (C2) (S213). As a result, when the transmission rate−the target rate <C2, the transmission rate is smaller than the target rate, so the transmission rate is increased with the current GOP.

このため、現在選択されているレートのリングバッファから後方クローズドGOPを選択し、選択された後方クローズドGOPを送信する(S218)。その後、一段階高いレートのリングバッファの前方クローズドGOPを選択し(S219)、選択された前方クローズドGOPを送信する(S220)。この選択及び送信された後方クローズドGOP及び前方クローズドGOPによって、15フレームの画像を再生することができる。その後、ステップS221に進む。   Therefore, the rear closed GOP is selected from the ring buffer at the currently selected rate, and the selected rear closed GOP is transmitted (S218). Thereafter, the forward closed GOP of the ring buffer having a higher level is selected (S219), and the selected forward closed GOP is transmitted (S220). A 15-frame image can be reproduced by the rear closed GOP and the front closed GOP selected and transmitted. Thereafter, the process proceeds to step S221.

一方、C2≦送信レート−目標レート≦C1である場合、送信される動画像データのビットレートを変更する必要がないと判定し、現在選択されているレートのリングバッファからオープンGOPを選択して(S217)、ステップS221に進む。   On the other hand, if C2 ≦ transmission rate−target rate ≦ C1, it is determined that there is no need to change the bit rate of the moving image data to be transmitted, and an open GOP is selected from the ring buffer of the currently selected rate. (S217), the process proceeds to step S221.

ステップS221では、現リングバッファの次エントリへポインタを進めて、GOP選択・送信処理を終了する。   In step S221, the pointer is advanced to the next entry in the current ring buffer, and the GOP selection / transmission process is terminated.

図13は、本発明の第2の実施の形態のGOP選択処理の一例(方法2)のフローチャートである。   FIG. 13 is a flowchart of an example (method 2) of the GOP selection process according to the second embodiment of this invention.

方法2では、前述した第1の実施の形態の方法2と同様に、書き込みポインタと対向する位置を目標として読み出しポインタを制御する。   In the method 2, similarly to the method 2 of the first embodiment described above, the read pointer is controlled with the position facing the write pointer as a target.

まず、送信レートを算出する(S231)。この送信レートの算出は、第1の実施の形態で前述した方法と同じ方法を採用することができる。   First, the transmission rate is calculated (S231). For the calculation of the transmission rate, the same method as described above in the first embodiment can be employed.

その後、読み出しポインタから書き込みポインタまでの距離がリングバッファ長の20%未満か否かを判定する(S232)。その結果、読み出しポインタから書き込みポインタまでの距離がリングバッファ長の20%未満である場合、読み出すことができる有効データが少ないので、現在のGOPで送信レートを下げる。   Thereafter, it is determined whether the distance from the read pointer to the write pointer is less than 20% of the ring buffer length (S232). As a result, when the distance from the read pointer to the write pointer is less than 20% of the ring buffer length, the effective data that can be read is small, so the transmission rate is lowered with the current GOP.

このため、現在選択されているレートのリングバッファから後方クローズドGOPを選択し、選択された後方クローズドGOPを送信する(S234)。その後、一段階低いレートのリングバッファの前方クローズドGOPを選択し(S235)、選択された前方クローズドGOPを送信する(S236)。この選択及び送信された後方クローズドGOP及び前方クローズドGOPによって、15フレームの画像を再生することができる。その後、ステップS241に進む。   For this reason, the backward closed GOP is selected from the ring buffer of the currently selected rate, and the selected backward closed GOP is transmitted (S234). Thereafter, the forward closed GOP of the ring buffer with a lower rate is selected (S235), and the selected forward closed GOP is transmitted (S236). A 15-frame image can be reproduced by the rear closed GOP and the front closed GOP selected and transmitted. Thereafter, the process proceeds to step S241.

一方、読み出しポインタから書き込みポインタまでの距離がリングバッファ長の20%以上である場合、読み出しポインタから書き込みポインタまでの距離がリングバッファ長の80%より大きいか否かを判定する(S233)。その結果、読み出しポインタから書き込みポインタまでの距離がリングバッファ長の80%より大きい場合、読み出すことができる有効データが多いので、現在のGOPで送信レートを上げる。   On the other hand, if the distance from the read pointer to the write pointer is 20% or more of the ring buffer length, it is determined whether or not the distance from the read pointer to the write pointer is greater than 80% of the ring buffer length (S233). As a result, when the distance from the read pointer to the write pointer is greater than 80% of the ring buffer length, there is a lot of valid data that can be read, so the transmission rate is increased with the current GOP.

このため、現在選択されているレートのリングバッファから後方クローズドGOPを選択し、選択された後方クローズドGOPを送信する(S238)。その後、一段階高いレートのリングバッファの前方クローズドGOPを選択し(S239)、選択された前方クローズドGOPを送信する(S240)。この選択及び送信された後方クローズドGOP及び前方クローズドGOPによって、15フレームの画像を再生することができる。その後、ステップS241に進む。   For this reason, the backward closed GOP is selected from the ring buffer of the currently selected rate, and the selected backward closed GOP is transmitted (S238). Thereafter, the forward closed GOP of the ring buffer with a higher rate is selected (S239), and the selected forward closed GOP is transmitted (S240). A 15-frame image can be reproduced by the rear closed GOP and the front closed GOP selected and transmitted. Thereafter, the process proceeds to step S241.

一方、読み出しポインタから書き込みポインタまでの距離がリングバッファ長の20%以上でかつ80%以下である場合、読み出すことができる有効データの量は適正であり、レートを変更する必要がないと判定して、現在選択されているレートのリングバッファからオープンGOPを選択して(S237)、ステップS241に進む。   On the other hand, when the distance from the read pointer to the write pointer is 20% or more and 80% or less of the ring buffer length, it is determined that the amount of valid data that can be read is appropriate and the rate does not need to be changed. Then, an open GOP is selected from the ring buffer of the currently selected rate (S237), and the process proceeds to step S241.

ステップS241では、現リングバッファの次エントリへポインタを進めて、GOP選択・送信処理を終了する。   In step S241, the pointer is advanced to the next entry in the current ring buffer, and the GOP selection / transmission process is terminated.

以上説明したように、本発明の第2の実施の形態では、オープンGOP、前方クローズドGOP及び後方クローズドGOPを生成し、レートの切替タイミング以外ではオープンGOPを選択し、レートの切替タイミングでは前方クローズドGOP及び後方クローズドGOPを選択することによって、GOP間に依存関係がある場合でも、ストリーム映像のレートを変更することができる。   As described above, in the second embodiment of the present invention, an open GOP, a front closed GOP, and a rear closed GOP are generated, an open GOP is selected at a timing other than the rate switching timing, and a front closed at the rate switching timing. By selecting the GOP and the rear closed GOP, the stream video rate can be changed even when there is a dependency between the GOPs.

<実施形態3>
次に、本発明の第3の実施の形態について説明する。
<Embodiment 3>
Next, a third embodiment of the present invention will be described.

図14は、本発明の第3の実施の形態の動画ストリーム配信システムの構成を示すブロック図である。   FIG. 14 is a block diagram illustrating a configuration of a moving picture stream distribution system according to the third embodiment of this invention.

第3の実施の形態においては、映像配信に使用するネットワークの帯域幅のいずれか一つ以上がソース映像のビットレート未満である場合、ビットレート変換装置によって低いビットレートに変換されたGOPフレームを、ソース映像の同時刻のGOPフレームに置き換えることによってビットレートを調整する。例えば、ビットレート変換装置が、複数の配信先のうち最も低い帯域幅の配信先に合わせてビットレートを変換し、ストリーム切替装置が、他の配信先にはソース映像と低いビットレートに変換された映像を切り替えながら送信する。   In the third embodiment, when any one or more of the network bandwidth used for video distribution is lower than the bit rate of the source video, the GOP frame converted to a lower bit rate by the bit rate conversion device is used. The bit rate is adjusted by replacing it with the GOP frame of the source video at the same time. For example, the bit rate conversion device converts the bit rate according to the delivery destination of the lowest bandwidth among the plurality of delivery destinations, and the stream switching device converts the source video to the lower bit rate for the other delivery destinations. Send while switching video.

第3の実施の形態の動画ストリーム配信システムは、映像読出装置9、ビットレート変換装置4F、マルチプレクサ5、複数のストリーム切替装置7A〜7B及び複数の映像配信装置8A〜8Bを備える。なお、第3の実施の形態において、前述した第1の実施の形態と同じ構成には同じ符号を付し、それらの説明は省略する。   The moving picture stream distribution system according to the third embodiment includes a video reading device 9, a bit rate conversion device 4F, a multiplexer 5, a plurality of stream switching devices 7A to 7B, and a plurality of video distribution devices 8A to 8B. Note that in the third embodiment, the same components as those in the first embodiment described above are denoted by the same reference numerals, and descriptions thereof are omitted.

映像読出装置9は、プロセッサ、メモリ及びネットワークインタフェースを備えるコンピュータであり、ストリームデータを記録装置から読み出す。なお、第3の実施の形態でも、前述した第1の実施の形態と同様に、カムコーダ1から送信される符号化された動画像データを、映像受信装置3を介して、ビットレート変換装置4A〜4Dに入力するものであってもよい。   The video reading device 9 is a computer including a processor, a memory, and a network interface, and reads stream data from the recording device. In the third embodiment, similarly to the first embodiment described above, the encoded moving image data transmitted from the camcorder 1 is converted into the bit rate conversion device 4A via the video receiving device 3. It may be input to 4D.

ビットレート変換装置4Fは、符号化された動画像データ(ソース映像)を、ソース映像とは異なる任意の低いビットレートの符号化データに変換する。また、ビットレート変換装置4Fは、出力される符号化データのビットレートを変更することができる。ビットレート変換装置4Fは、例えば、複数の配信先のうち最も低い帯域幅の配信先に合わせてビットレートを変換するとよい。   The bit rate conversion device 4F converts the encoded moving image data (source video) into encoded data having an arbitrary low bit rate different from that of the source video. Further, the bit rate conversion device 4F can change the bit rate of the encoded data to be output. For example, the bit rate conversion device 4F may convert the bit rate in accordance with a delivery destination having the lowest bandwidth among a plurality of delivery destinations.

ビットレート変換装置4Fは、プロセッサ、メモリ及びネットワークインタフェースを備えるコンピュータでもよいし、専用ハードウェア(例えば、ViXS SystemsのXCode2111)によって処理を行うものでもよい。ビットレート変換装置4Fは、変換結果を後段のマルチプレクサ5に出力する。   The bit rate conversion device 4F may be a computer including a processor, a memory, and a network interface, or may perform processing using dedicated hardware (for example, XCode 2111 of ViXS Systems). The bit rate conversion device 4F outputs the conversion result to the multiplexer 5 at the subsequent stage.

なお、第3の実施の形態においても、可変レートのビットレート変換装置4Fではなく、前述した第1の実施の形態のように複数のビットレート変換装置4A〜4Dを備えてもよい。この場合、最も低い帯域幅以下のビットレートの動画像を出力するビットレート変換装置を選択すればよい。   Also in the third embodiment, a plurality of bit rate conversion devices 4A to 4D may be provided as in the first embodiment described above instead of the variable rate bit rate conversion device 4F. In this case, a bit rate conversion device that outputs a moving image having a bit rate equal to or lower than the lowest bandwidth may be selected.

なお、映像受信装置3と各ビットレート変換装置4Fとが別のコンピュータに実装される場合、両装置をネットワークによって接続するとよい。また、ビットレート変換装置4Fが専用ハードウェアによって実現される場合、映像受信装置3とビットレート変換装置4Fとの間は、PCIバス、PCIExpressなどの装置内接続用の規格に従って接続する。   When the video reception device 3 and each bit rate conversion device 4F are mounted on different computers, both devices may be connected via a network. In addition, when the bit rate conversion device 4F is realized by dedicated hardware, the video reception device 3 and the bit rate conversion device 4F are connected in accordance with a connection standard such as a PCI bus or PCI Express.

図15は、従来のビットレート変換装置によって生成される映像フレームを示し、 図16は、第3の実施の形態のビットレート変換装置によって生成される映像フレームを示し、図17は、第3の実施の形態の切替装置によって生成される映像フレームを示す。   FIG. 15 shows a video frame generated by the conventional bit rate conversion apparatus, FIG. 16 shows a video frame generated by the bit rate conversion apparatus of the third embodiment, and FIG. The video frame produced | generated by the switching apparatus of embodiment is shown.

ビットレート変換装置4Fに入力されるソース映像データがオープンGOPによって構成されている場合、ビットレート変換開始時刻のGOPの先頭のB0フレーム及びB1フレームは、前のGOP中のフレームを参照しているため、オープンGOPの先頭のBフレームを再生することができない。結果として、図15に示すように一部フレーム(B0、B1)が欠落したGOPが生成される。   When the source video data input to the bit rate conversion device 4F is configured by an open GOP, the first B0 frame and the B1 frame of the GOP at the bit rate conversion start time refer to the frame in the previous GOP. Therefore, the first B frame of the open GOP cannot be reproduced. As a result, a GOP in which some frames (B0, B1) are missing is generated as shown in FIG.

このため、第3の実施の形態のビットレート変換装置4Fは、図16に示すように、オープンGOPであるGOPnから別のレートのオープンGOPであるGOPnに切り替える場合、ビットレート変換開始時刻のGOPnの直前のGOPn−1のソース映像からビットレートを変換する。   Therefore, when the bit rate conversion device 4F according to the third embodiment switches from GOPn that is an open GOP to GOPn that is an open GOP of another rate, as shown in FIG. 16, GOPn at the bit rate conversion start time The bit rate is converted from the source video of GOPn-1 immediately before.

この結果、図16に示すように、GOPn−1のIフレーム以前のBフレームは、参照すべきGOPn−2のデータがないために欠落するが、GOPnの全フレームは欠落することなく、再生可能なビットレートが変換されたフレームを生成することができる。そして、図17に示すように、元のソース映像のGOPn−1に、ビットレートが変換されたGOPnを接続することによって、連続したストリームを生成することができる。   As a result, as shown in FIG. 16, the B frame before the I frame of GOPn-1 is lost because there is no GOPn-2 data to be referenced, but all the frames of GOPn can be reproduced without being lost. A frame with a converted bit rate can be generated. Then, as shown in FIG. 17, a continuous stream can be generated by connecting GOPn with the bit rate converted to GOPn-1 of the original source video.

ビットレートの変換を終了する場合も、同様に終端のGOPより1GOPを余分に低ビットレートに変換することによって、Bフレームが欠落しないGOPを得ることができる。   Similarly, when the bit rate conversion is completed, a GOP in which B frames are not lost can be obtained by converting 1 GOP to a lower bit rate than the last GOP.

この場合、切替前後のGOPのビットレートが異なるので、切替前のGOPを参照する切換後のGOPのフレームの画質が劣化する可能性がある。このため、切替前後のGOPのビットレートの差が大きい場合、画質の大きな劣化を生じる可能性がある。例えば、図17において、GOPn−1のビットレートとGOPnのビットレートとが異なるので、GOPn−1のフレームを参照するGOPnのB0フレーム及びB1フレームの画質が劣化する。この画質劣化を緩和するため、ビットレート変換装置4Fによる、ソース映像のビットレートの変換の下限値をソース映像のビットレートの8割に設定してもよい。   In this case, since the bit rate of the GOP before and after switching is different, the image quality of the frame of the GOP after switching that refers to the GOP before switching may be deteriorated. For this reason, when the difference in the bit rate of GOP before and after switching is large, there is a possibility that image quality will be greatly degraded. For example, in FIG. 17, since the GOPn-1 bit rate and the GOPn bit rate are different, the image quality of the GOPn B0 frame and B1 frame referencing the GOPn-1 frame deteriorates. In order to alleviate this image quality degradation, the lower limit value of the bit rate conversion of the source video by the bit rate conversion device 4F may be set to 80% of the bit rate of the source video.

また、ビットレート変換装置4Fが、ビットレートを引き上げたGOPを繰り返し生成する(例えば、10GOPに1回の割合でソース映像のビットレートの8割以上のビットレートのGOPを生成する)。そして、ストリーム切替装置7AがオープンGOP間でビットレートを切り替える場合、比較的高いビットレートのGOPの箇所でビットレートを切り替えるとよい。   Further, the bit rate conversion device 4F repeatedly generates a GOP with an increased bit rate (for example, generates a GOP having a bit rate of 80% or more of the bit rate of the source video at a rate of once per 10 GOP). When the stream switching device 7A switches the bit rate between the open GOPs, the bit rate may be switched at a GOP having a relatively high bit rate.

以上説明したように、本発明の第3の実施の形態では、一つのビットレート変換装置を用いるだけで、任意のレートのストリームデータを生成することができる。また、ビットレート切替前後のGOPのビットレートの差を少なくするので、切替時の画質劣化を抑制することができる。   As described above, in the third embodiment of the present invention, stream data at an arbitrary rate can be generated by using only one bit rate conversion device. In addition, since the difference in the GOP bit rate before and after the bit rate switching is reduced, it is possible to suppress image quality deterioration at the time of switching.

1 カムコーダ
2 ネットワーク
3 映像受信装置
4A〜4F ビットレート変換装置
5 マルチプレクサ
6 負荷監視装置
7A〜7E ストリーム切替装置
8A〜8E 映像配信装置
DESCRIPTION OF SYMBOLS 1 Camcorder 2 Network 3 Video receiving device 4A-4F Bit rate conversion device 5 Multiplexer 6 Load monitoring device 7A-7E Stream switching device 8A-8E Video distribution device

Claims (13)

ソースストリームデータから低レートの少なくとも一つのストリームデータを生成する変換装置と、
前記ストリームデータを選択して出力する切替装置とを備えるデータ配信システムであって、
前記切替装置は、
前記ストリームデータのレート毎に、前記ストリームデータを格納するリングバッファを備え、
前記ストリームデータを読み出す前記リングバッファを選択し、前記選択されたリングバッファからGOPのデータを読み出すことによって、前記ソースストリームデータと前記変換されたストリームデータとのいずれかのGOPを、前記GOP毎に選択し、
前記選択されたGOPによって、所望のレートのストリームデータを生成することを特徴とするデータ配信システム。
A conversion device that generates at least one stream data at a low rate from the source stream data;
A data distribution system comprising a switching device that selects and outputs the stream data,
The switching device is
A ring buffer for storing the stream data for each stream data rate;
By selecting the ring buffer from which the stream data is to be read and reading GOP data from the selected ring buffer, any one GOP of the source stream data and the converted stream data is determined for each GOP. Selected,
A data distribution system for generating stream data at a desired rate by the selected GOP .
前記切替装置は、前記リングバッファに蓄積されているデータの量が所定の閾値より少なくなった場合、低いレートのストリームデータのGOPを選択することを特徴とする請求項1に記載のデータ配信システム。  The data distribution system according to claim 1, wherein the switching device selects a GOP of stream data at a low rate when the amount of data stored in the ring buffer becomes smaller than a predetermined threshold. . 前記切替装置は、  The switching device is
前記リングバッファにデータが書き込まれる位置を示す書込ポインタと、前記リングバッファからデータが読み出される位置を示す読出ポインタとによって、前記リングバッファを制御し、  Controlling the ring buffer by a write pointer indicating a position where data is written to the ring buffer and a read pointer indicating a position where data is read from the ring buffer;
前記リングバッファ上で前記書込ポインタに対向する位置を前記読出ポインタの目標位置に設定し、  A position facing the write pointer on the ring buffer is set as a target position of the read pointer,
前記読出ポインタが、前記目標位置より進んでいる場合、高いレートのストリームデータのGOPを選択することを特徴とする請求項1に記載のデータ配信システム。  2. The data distribution system according to claim 1, wherein when the read pointer is advanced from the target position, a GOP of high-rate stream data is selected.
ソースストリームデータから低レートの少なくとも一つのストリームデータを生成する変換装置と、  A conversion device that generates at least one stream data at a low rate from the source stream data;
前記ストリームデータを選択して出力する切替装置とを備えるデータ配信システムであって、  A data distribution system comprising a switching device that selects and outputs the stream data,
前記データ配信システムは、前記変換装置の負荷を監視する負荷監視装置をさらに備え、  The data distribution system further includes a load monitoring device that monitors a load of the conversion device,
前記負荷監視装置によって監視された負荷が所定の閾値を超えた場合、前記変換装置は生成されるストリームデータのレートを低くし、  When the load monitored by the load monitoring device exceeds a predetermined threshold, the conversion device lowers the rate of the stream data to be generated,
前記切替装置は、GOP毎に、前記ソースストリームデータと前記変換されたストリームデータとのいずれかのGOPを選択して、所望のレートのストリームデータを生成することを特徴とするデータ配信システム。  The data switching system, wherein the switching device selects a GOP of the source stream data and the converted stream data for each GOP, and generates stream data at a desired rate.
ソースストリームデータから低レートの少なくとも一つのストリームデータを生成する変換装置と、  A conversion device that generates at least one stream data at a low rate from the source stream data;
前記ストリームデータを選択して出力する切替装置とを備えるデータ配信システムであって、  A data distribution system comprising a switching device that selects and outputs the stream data,
前記変換装置は、オープンGOP、後方クローズドGOP及び前方クローズドGOPを含むストリームデータを生成し、  The conversion apparatus generates stream data including an open GOP, a rear closed GOP, and a front closed GOP,
前記切替装置は、  The switching device is
GOP毎に、前記ソースストリームデータと前記変換されたストリームデータとのいずれかのGOPを選択し、  For each GOP, select one of the GOPs of the source stream data and the converted stream data,
ストリームデータのレートが切り替えられない場合、オープンGOPを選択し、  If the stream data rate cannot be switched, select Open GOP,
ストリームデータのレートが切り替えられる場合、切り替え前のレートのストリームデータの後方クローズドGOP及び切り替え後のレートのストリームデータの前方クローズドGOPを選択し、  When the stream data rate is switched, the rear closed GOP of the stream data at the rate before switching and the forward closed GOP of the stream data at the rate after switching are selected,
前記選択されたGOPによって、所望のレートのストリームデータを生成することを特徴とするデータ配信システム。  A data distribution system for generating stream data at a desired rate by the selected GOP.
ソースストリームデータから低レートの少なくとも一つのストリームデータを生成する変換装置と、  A conversion device that generates at least one stream data at a low rate from the source stream data;
前記ストリームデータを選択して出力する切替装置とを備えるデータ配信システムであって、  A data distribution system comprising a switching device that selects and outputs the stream data,
前記変換装置は、  The converter is
生成するストリームデータのレートが可変であって、  The rate of the stream data to be generated is variable,
オープンGOPを含むストリームデータを生成し、  Generate stream data including open GOP,
ストリームデータのレートが切り替えられる場合、切り替え前のストリームデータのレートと切り替え後のストリームデータのレートとの差が所定値以下になるように、生成されるストリームデータのレートを制御し、  When the stream data rate is switched, the rate of the stream data to be generated is controlled so that the difference between the stream data rate before the switching and the stream data rate after the switching becomes a predetermined value or less,
前記切替装置は、GOP毎に、前記ソースストリームデータと前記変換されたストリームデータとのいずれかのGOPを選択して、所望のレートのストリームデータを生成することを特徴とするデータ配信システム。  The data switching system, wherein the switching device selects a GOP of the source stream data and the converted stream data for each GOP, and generates stream data at a desired rate.
ソースストリームデータから低レートの少なくとも一つのストリームデータを生成する変換装置に接続される切替装置であって、  A switching device connected to a conversion device that generates at least one stream data at a low rate from source stream data,
前記切替装置は、  The switching device is
前記ストリームデータのレート毎に、前記ストリームデータを格納するリングバッファを備え、  A ring buffer for storing the stream data for each stream data rate;
前記ストリームデータを読み出す前記リングバッファを選択し、前記選択されたリングバッファからGOPのデータを読み出すことによって、前記ソースストリームデータと前記変換されたストリームデータとのいずれかのGOPを、前記GOP毎に選択し、  By selecting the ring buffer from which the stream data is to be read and reading GOP data from the selected ring buffer, any one GOP of the source stream data and the converted stream data is determined for each GOP. Selected,
前記選択されたGOPによって、所望のレートのストリームデータを生成することを特徴とする切替装置。  A switching device that generates stream data of a desired rate by the selected GOP.
前記切替装置は、前記リングバッファに蓄積されているデータの量が所定の閾値より少なくなった場合、低いレートのストリームデータのGOPを選択することを特徴とする請求項7に記載の切替装置。  The switching device according to claim 7, wherein the switching device selects a GOP of stream data at a low rate when the amount of data stored in the ring buffer becomes smaller than a predetermined threshold. 前記切替装置は、  The switching device is
前記リングバッファにデータが書き込まれる位置を示す書込ポインタと、前記リングバッファからデータが読み出される位置を示す読出ポインタとによって、前記リングバッファを制御し、  Controlling the ring buffer by a write pointer indicating a position where data is written to the ring buffer and a read pointer indicating a position where data is read from the ring buffer;
前記リングバッファ上で前記書込ポインタに対向する位置を前記読出ポインタの目標位置に設定し、  A position facing the write pointer on the ring buffer is set as a target position of the read pointer,
前記読出ポインタが、前記目標位置より進んでいる場合、高いレートのストリームデータのGOPを選択することを特徴とする請求項7に記載の切替装置。  8. The switching device according to claim 7, wherein when the read pointer is advanced from the target position, a GOP of stream data having a high rate is selected.
ストリームデータのレートを変換する変換装置と、前記ストリームデータを選択して出力する切替装置とを備えるデータ配信システムにおけるデータ配信方法であって、  A data distribution method in a data distribution system comprising: a conversion device that converts a stream data rate; and a switching device that selects and outputs the stream data,
前記方法は、  The method
前記変換装置が、ソースストリームデータから低レートの少なくとも一つのストリームデータを生成し、  The conversion device generates at least one stream data at a low rate from the source stream data;
前記切替装置が、GOP毎に、前記ソースストリームデータと前記変換されたストリームデータとのいずれかのGOPを選択し、  The switching device selects a GOP of the source stream data and the converted stream data for each GOP,
前記切替装置が、生成されるストリームデータのレートが所定の目標レートより高い場合、低いレートのストリームデータのGOPを選択し、  When the rate of the stream data to be generated is higher than a predetermined target rate, the switching device selects a GOP of stream data with a low rate,
前記切替装置が、生成されるストリームデータのレートが前記目標レートより低い場合、高いレートのストリームデータのGOPを選択し、  When the rate of the stream data to be generated is lower than the target rate, the switching device selects a GOP of stream data with a higher rate;
前記切替装置が、前記選択されたGOPによって、所望のレートのストリームデータを生成して、前記生成されたストリームデータを配信することを特徴とするデータ配信方法。  The data distribution method, wherein the switching device generates stream data of a desired rate by the selected GOP and distributes the generated stream data.
ストリームデータのレートを変換する変換装置と、前記ストリームデータを選択して出力する切替装置とを備えるデータ配信システムにおけるデータ配信方法であって、  A data distribution method in a data distribution system comprising: a conversion device that converts a stream data rate; and a switching device that selects and outputs the stream data,
前記切替装置は、前記ストリームデータのレート毎に、前記ストリームデータを格納するリングバッファを備え、  The switching device includes a ring buffer for storing the stream data for each stream data rate,
前記方法は、  The method
前記変換装置が、ソースストリームデータから低レートの少なくとも一つのストリームデータを生成し、  The conversion device generates at least one stream data at a low rate from the source stream data;
前記切替装置が、前記ストリームデータを読み出す前記リングバッファを選択し、前記選択されたリングバッファからGOPのデータを読み出すことによって、前記ソースストリームデータと前記変換されたストリームデータとのいずれかのGOPを、前記GOP毎に選択し、  The switching device selects the ring buffer from which the stream data is to be read, and reads GOP data from the selected ring buffer, so that any one of the source stream data and the converted stream data is changed to GOP. , Select for each GOP,
前記切替装置が、前記選択されたGOPによって、所望のレートのストリームデータを生成して、前記生成されたストリームデータを配信することを特徴とするデータ配信方法。  The data distribution method, wherein the switching device generates stream data of a desired rate by the selected GOP and distributes the generated stream data.
前記方法は、  The method
前記切替装置が、前記リングバッファに蓄積されているデータの量が所定の閾値より少なくなった場合、低いレートのストリームデータのGOPを選択することを特徴とする請求項11に記載のデータ配信方法。  12. The data distribution method according to claim 11, wherein the switching device selects a GOP of stream data at a low rate when the amount of data stored in the ring buffer becomes smaller than a predetermined threshold. .
前記方法は、  The method
前記切替装置が、前記リングバッファにデータが書き込まれる位置を示す書込ポインタと、前記リングバッファからデータが読み出される位置を示す読出ポインタとによって、前記リングバッファを制御し、  The switching device controls the ring buffer by a write pointer indicating a position where data is written to the ring buffer and a read pointer indicating a position where data is read from the ring buffer;
前記切替装置が、前記リングバッファ上で前記書込ポインタに対向する位置を前記読出ポインタの目標位置に設定し、  The switching device sets a position facing the write pointer on the ring buffer as a target position of the read pointer;
前記切替装置が、前記読出ポインタが前記目標位置より進んでいる場合、高いレートのストリームデータのGOPを選択することを特徴とする請求項11に記載のデータ配信方法。  12. The data distribution method according to claim 11, wherein the switching device selects a GOP of stream data having a high rate when the read pointer is advanced from the target position.
JP2009184603A 2009-08-07 2009-08-07 Data distribution system, switching device, and data distribution method Active JP5213130B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009184603A JP5213130B2 (en) 2009-08-07 2009-08-07 Data distribution system, switching device, and data distribution method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009184603A JP5213130B2 (en) 2009-08-07 2009-08-07 Data distribution system, switching device, and data distribution method

Publications (2)

Publication Number Publication Date
JP2011040879A JP2011040879A (en) 2011-02-24
JP5213130B2 true JP5213130B2 (en) 2013-06-19

Family

ID=43768227

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009184603A Active JP5213130B2 (en) 2009-08-07 2009-08-07 Data distribution system, switching device, and data distribution method

Country Status (1)

Country Link
JP (1) JP5213130B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6149562B2 (en) * 2013-07-12 2017-06-21 富士通株式会社 Stream delivery system, stream creation device, stream delivery method, and stream creation method
CN106454395B (en) * 2016-09-20 2018-10-12 北京百度网讯科技有限公司 It is used to adaptively provide the method and device of multi code Rate of Chinese character Streaming Media in the server

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3834170B2 (en) * 1999-10-22 2006-10-18 日本電気株式会社 Video code processing system
JP2004088621A (en) * 2002-08-28 2004-03-18 Ntt Docomo Inc Multimedia communication control method, multimedia communication control server, and multimedia communication system
EP1579651A1 (en) * 2002-12-20 2005-09-28 Koninklijke Philips Electronics N.V. Multi-track hinting for receiver-driven streaming system
JP3976191B2 (en) * 2003-01-07 2007-09-12 株式会社エヌ・ティ・ティ・ドコモ Server, transmission rate control method, program, and recording medium

Also Published As

Publication number Publication date
JP2011040879A (en) 2011-02-24

Similar Documents

Publication Publication Date Title
US10623785B2 (en) Streaming manifest quality control
US9680902B2 (en) Media streaming method and device using the same
US8837586B2 (en) Bandwidth-friendly representation switching in adaptive streaming
US7292602B1 (en) Efficient available bandwidth usage in transmission of compressed video data
US8654849B2 (en) Integrated transcoding
US7529276B1 (en) Combined jitter and multiplexing systems and methods
US8290036B2 (en) Method, apparatus and system for concurrent processing of multiple video streams
EP2011332B1 (en) Method for reducing channel change times in a digital video apparatus
US20050175085A1 (en) Method and apparatus for providing dentable encoding and encapsulation
US7035278B2 (en) Method and apparatus for forming and utilizing a slotted MPEG transport stream
JP5147950B2 (en) Apparatus and method for performing simulcast over variable bandwidth channel
WO2009096366A1 (en) Dynamic image encoding/decoding system and dynamic image encoding device and dynamic image decoding device used for the same
JP2006508574A (en) Inserting I-images on demand
RU2420909C2 (en) Splitting data stream
JP2017520940A (en) Method and apparatus for multiplexing hierarchically encoded content
KR20060011426A (en) Method and device for elastically adjusting the buffer amount according to the property of contents
US20080144505A1 (en) Method and Apparatus for Bitrate Reduction
JP5213130B2 (en) Data distribution system, switching device, and data distribution method
JP2012521126A (en) Apparatus and method for transmitting a plurality of information signals in flexible time division multiplexing
KR101249613B1 (en) Network-adaptive variable stream layered method and apparatus for video streaming
JP4216553B2 (en) Digital broadcast signal switching device and digital broadcast signal switching method
KR101964649B1 (en) Method for trasmitting media content and device thereof
JP2006279803A (en) Re-multiplexing apparatus
JPH1141608A (en) Image transmission device, image encoding method, and image encoding device
WO2010086021A1 (en) Method and apparatus for efficient downstream video processing based on upstream metric processing and provision

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120120

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120309

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121116

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121120

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130108

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: 20130129

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130221

R150 Certificate of patent or registration of utility model

Ref document number: 5213130

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: 20160308

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250