Skip to content

Commit

Permalink
修改範例程式格式: 不縮排 不空格 避免 bullet 亂掉
Browse files Browse the repository at this point in the history
  • Loading branch information
dariachen committed Feb 15, 2016
1 parent dda3c8f commit eec8ead
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 77 deletions.
45 changes: 20 additions & 25 deletions content/en/tutorial/7688_videostream_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,30 +82,28 @@ Note 2: The deviceId is case sensitive.

1. Make sure the 7688 development board has been switched to station mode and connect to the same network as your computer successfully.
2. Connect to the console of 7688 development borad through `ssh` command on your computer.

```
ssh [email protected]
```
```
ssh [email protected]
```

3. Install FFmpeg package on the 7688 development board.

```
opkg update
opkg install ffmpeg
```
```
opkg update
opkg install ffmpeg
```

4. Install necessary Node.js package on the 7688 development board.

```
mkdir app && cd app npm init
npm install mcsjs
```
```
mkdir app && cd app npm init
npm install mcsjs
```

5. Test if FFmpeg can send streaming content to MCS successfully.

```
ffmpeg -s 176x144 -f video4linux2 -r 30 -i /dev/video0 -f mpeg1video -r 30 -b 800k http://stream-mcs.mediatek.com/:deviceId/:deviceKey/:dataChnId/176/144
```
```
ffmpeg -s 176x144 -f video4linux2 -r 30 -i /dev/video0 -f mpeg1video -r 30 -b 800k http://stream-mcs.mediatek.com/:deviceId/:deviceKey/:dataChnId/176/144
```

The :deviceId, :deviceKey and :dataChnId need to be replaced with the real value you just obtained. You also need to specify the video resolution in the URL. In this example, the resolution is 176x144.
You can view on either MCS web console or App to make sure the video stream works.

Expand All @@ -116,14 +114,12 @@ You can view on either MCS web console or App to make sure the video stream work
You are now ready to write the Node.js program on the 7688 development board.

1. Create a file called app.js using an editor, vi is used in this example:

```
vim app.js
```
```
vim app.js
```

2. Type **i** and copy/paste the following code in the editor. Please remember to replace the deviceId, deviceKey and dataChnId to the real values.

```
```
var mcs = require('mcsjs');
var exec = require('child_process').exec;
var deviceId = 'Input your deviceId';
Expand All @@ -142,12 +138,11 @@ exec('ffmpeg -s ' + width + 'x' + height + ' -f video4linux2 -r 30 -i /dev/video
console.log('exec error: ' + error);
}
});
```
```

### Run your program

Let's execute the Node.js program. In the 7688 system console, type the following command

```
node app
```
Expand Down
46 changes: 20 additions & 26 deletions content/zh-CN/tutorial/7688_videostream_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,28 @@ Note 2: The deviceId is case sensitive.

1. Make sure the 7688 development board has been switched to station mode and connect to the same network as your computer successfully.
2. Connect to the console of 7688 development borad through `ssh` command on your computer.

```
ssh [email protected]
```
```
ssh [email protected]
```

3. Install FFmpeg package on the 7688 development board.

```
opkg update
opkg install ffmpeg
```
```
opkg update
opkg install ffmpeg
```

4. Install necessary Node.js package on the 7688 development board.

```
mkdir app && cd app npm init
npm install mcsjs
```
```
mkdir app && cd app npm init
npm install mcsjs
```

5. Test if FFmpeg can send streaming content to MCS successfully.
```
ffmpeg -s 176x144 -f video4linux2 -r 30 -i /dev/video0 -f mpeg1video -r 30 -b 800k http://stream-mcs.mediatek.com/:deviceId/:deviceKey/:dataChnId/176/144
```

```
ffmpeg -s 176x144 -f video4linux2 -r 30 -i /dev/video0 -f mpeg1video -r 30 -b 800k http://stream-mcs.mediatek.com/:deviceId/:deviceKey/:dataChnId/176/144
```
The deviceId, deviceKey and dataChnId need to be replaced with the real value you just obtained. You also need to specify the video resolution in the URL. In this example, the resolution is 176x144.
The :deviceId, :deviceKey and :dataChnId need to be replaced with the real value you just obtained. You also need to specify the video resolution in the URL. In this example, the resolution is 176x144.
You can view on either MCS web console or App to make sure the video stream works.

## Developing a Node.js progream to connect with MCS
Expand All @@ -116,14 +113,12 @@ You can view on either MCS web console or App to make sure the video stream work
You are now ready to write the Node.js program on the 7688 development board.

1. Create a file called app.js using an editor, vi is used in this example:

```
vim app.js
```
```
vim app.js
```

2. Type **i** and copy/paste the following code in the editor. Please remember to replace the deviceId, deviceKey and dataChnId to the real values.

```
```
var mcs = require('mcsjs');
var exec = require('child_process').exec;
var deviceId = 'Input your deviceId';
Expand All @@ -142,12 +137,11 @@ exec('ffmpeg -s ' + width + 'x' + height + ' -f video4linux2 -r 30 -i /dev/video
console.log('exec error: ' + error);
}
});
```
```

### Run your program

Let's execute the Node.js program. In the 7688 system console, type the following command

```
node app
```
Expand Down
46 changes: 20 additions & 26 deletions content/zh-TW/tutorial/7688_videostream_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,30 +82,27 @@ Note 2: The deviceId is case sensitive.

1. Make sure the 7688 development board has been switched to station mode and connect to the same network as your computer successfully.
2. Connect to the console of 7688 development borad through `ssh` command on your computer.

```
ssh [email protected]
```
```
ssh [email protected]
```

3. Install FFmpeg package on the 7688 development board.

```
opkg update
opkg install ffmpeg
```
```
opkg update
opkg install ffmpeg
```

4. Install necessary Node.js package on the 7688 development board.

```
mkdir app && cd app npm init
npm install mcsjs
```
```
mkdir app && cd app npm init
npm install mcsjs
```

5. Test if FFmpeg can send streaming content to MCS successfully.

```
ffmpeg -s 176x144 -f video4linux2 -r 30 -i /dev/video0 -f mpeg1video -r 30 -b 800k http://stream-mcs.mediatek.com/:deviceId/:deviceKey/:dataChnId/176/144
```
```
ffmpeg -s 176x144 -f video4linux2 -r 30 -i /dev/video0 -f mpeg1video -r 30 -b 800k http://stream-mcs.mediatek.com/:deviceId/:deviceKey/:dataChnId/176/144
```

The :deviceId, :deviceKey and :dataChnId need to be replaced with the real value you just obtained. You also need to specify the video resolution in the URL. In this example, the resolution is 176x144.
You can view on either MCS web console or App to make sure the video stream works.

Expand All @@ -116,14 +113,12 @@ You can view on either MCS web console or App to make sure the video stream work
You are now ready to write the Node.js program on the 7688 development board.

1. Create a file called app.js using an editor, vi is used in this example:

```
vim app.js
```
```
vim app.js
```

2. Type **i** and copy/paste the following code in the editor. Please remember to replace the deviceId, deviceKey and dataChnId to the real values.

```
```
var mcs = require('mcsjs');
var exec = require('child_process').exec;
var deviceId = 'Input your deviceId';
Expand All @@ -142,12 +137,11 @@ exec('ffmpeg -s ' + width + 'x' + height + ' -f video4linux2 -r 30 -i /dev/video
console.log('exec error: ' + error);
}
});
```
```

### Run your program

Let's execute the Node.js program. In the 7688 system console, type the following command

```
node app
```
Expand Down

0 comments on commit eec8ead

Please sign in to comment.