...
Code Block | ||
---|---|---|
| ||
Atom ftyp @ 0 of size: 32, ends @ 32 Atom moov @ 32 of size: 357961, ends @ 357993 ... Atom free @ 357993 of size: 8, ends @ 358001 Atom mdat @ 358001 of size: 212741950, ends @ 213099951 |
VOD capture management with REST API
REST query should be HTTP/HTTPS POST request as:
- HTTP: http://test.flashphoner.com:8081/rest-api/vod/startup
- HTTPS: https://test.flashphoner.com:8444/rest-api/vod/startup
Where:
- test.flashphoner.com - WCS server address
- 8081 - standard REST / HTTP port
- 8444 - standard HTTPS port
- rest-api - mandatory part of URL
- /vod/startup - REST method used
REST queries and responses
...
REST query
...
REST query example
...
REST response example
...
Response states
...
Description
...
/vod/startup
...
Code Block | ||||
---|---|---|---|---|
| ||||
{
"uri":"vod://sample.mp4"
"localStreamName": "test"
} |
409 - Conflict
500 - Internal error
Capture VOD stream from file
...
Code Block | ||||
---|---|---|---|---|
| ||||
{
"localStreamName": "test"
} |
...
language | js |
---|---|
theme | RDark |
...
File structure can be checked with AtomicParsley utility
Code Block | ||||
---|---|---|---|---|
| ||||
AtomicParsley file.mp4 -T 1 |
Wrong file structure can be fixed if necessary with ffmpeg without reencoding
Code Block | ||||
---|---|---|---|---|
| ||||
ffmpeg -i bad.mp4 -acodec copy -vcodec copy -movflags +faststart good.mp4 |
VOD capture management with REST API
REST query should be HTTP/HTTPS POST request as:
- HTTP: http://test.flashphoner.com:8081/rest-api/vod/startup
- HTTPS: https://test.flashphoner.com:8444/rest-api/vod/startup
Where:
- test.flashphoner.com - WCS server address
- 8081 - standard REST / HTTP port
- 8444 - standard HTTPS port
- rest-api - mandatory part of URL
- /vod/startup - REST method used
REST queries and responses
REST query | REST query example | REST response example | Response states | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
/vod/startup |
| 409 - Conflict 500 - Internal error | Capture VOD stream from file | |||||||||||||
/vod/find |
|
|
|
|
|
|
|
|
|
|
| 200 – OK 404 – not found | Find VOD streams by criteria | |||||||||
/vod/find_all |
| 200 – OK 404 – not found | Find all VOD streams | ||||||||
/vod/terminate |
| 200 - Stream is stopped 404 - |
Stream not found | Stop VOD stream |
Parameters
Name | Description | Example |
---|---|---|
uri | File name to capture | vod://sample.mp4 |
localStreamName | Stream name | test |
status | Stream status | PROCESSED_LOCAL |
localMediaSessionId | Mediasession Id | 29ec3236-1093-42bb-88d6-d4ac37af3ac0 |
hasAudio | Stream has audio | true |
hasVideo | Stream has video | true |
record | Stream is recording | false |
Known
...
1. AAC frames of type 0 are not supported by decoder and will be ignored while stream pulled playback
...
limits
/rest-api/vod/startup query can be used for VOD live translations creation only. However, find, find_all and terminate queries can be applied both to VOD and VOD live translations.
VOD stream publishing timeout after all subscribers gone off
By default, VOD stream stays published on server during 30 seconds after last subscriber gone off, if file duration exceeds this interval. This timeout can be changed with the following parameter
Code Block | ||
---|---|---|
| ||
vod_stream_timeout=60000 |
In this case, VOD stream stays published during 60 seconds.
Known issues
1. AAC frames of type 0 are not supported by ffmpeg decoder and will be ignored while stream pulled playback
Symptoms: warnings in the client log:
Code Block | ||||
---|---|---|---|---|
| ||||
10:13:06,815 WARN AAC - AudioProcessor-c6c22de8-a129-43b2-bf67-1f433a814ba9 Dropping AAC frame that starts with 0, 119056e500 |
Solution: switch to FDK AAC decoder
Code Block | ||
---|---|---|
| ||
use_fdk_aac=true |
2. Files with B-frames can be played unsmoothly, with artifacts and freezes
Symptoms: periodic freezes and artifacts while playing VOD file, warnongs in the client log
Code Block | ||
---|---|---|
| ||
09:32:31,238 WARN 4BitstreamNormalizer - RTMP-pool-10-thread-5 It is B-frame! |
Solution: reencode this file to exclude B-frames, for example
Code Block | ||||
---|---|---|---|---|
| ||||
ffmpeg -i bad.mp4 -preset ultrafast -acodec copy -vcodec h264 -g 24 -bf 0 good.mp4 |
3. When VOD is captured from a long-duration file, server process can terminate with Out of memory in case of exceeding maximum number of regions of virtual memory (vm.max_map_count)
Symptoms: server process terminates; "Map failed" in server log and in error*.log
Code Block | ||
---|---|---|
| ||
19:30:53,277 ERROR DefaultMp4SampleList - Thread-34 java.io.IOException: Map failed
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:940)
at com.googlecode.mp4parser.FileDataSourceImpl.map(FileDataSourceImpl.java:62)
at com.googlecode.mp4parser.BasicContainer.getByteBuffer(BasicContainer.java:223)
at com.googlecode.mp4parser.authoring.samples.DefaultMp4SampleList$SampleImpl.asByteBuffer(DefaultMp4SampleList.java:204)
at com.flashphoner.media.F.A.A.A$1.A(Unknown Source)
at com.flashphoner.media.M.B.C.D(Unknown Source)
at com.flashphoner.server.C.A.B.A(Unknown Source)
at com.flashphoner.server.C.A.B.C(Unknown Source)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.OutOfMemoryError: Map failed
at sun.nio.ch.FileChannelImpl.map0(Native Method)
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:937)
... 8 more |
Code Block | ||
---|---|---|
| ||
Event: 1743.157 Thread 0x00007fc480375000 Exception <a 'java/lang/OutOfMemoryError': Map failed> (0x00000000a1d750b0) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u161/10277/hotspot/src/share/vm/prims/jni.cpp, line 735] |
Solution: increase maximum number of regions of virtual memory
Code Block | ||||
---|---|---|---|---|
| ||||
10:13:06,815 WARN AAC - AudioProcessor-c6c22de8-a129-43b2-bf67-1f433a814ba9 Dropping AAC frame that starts with 0, 119056e500sysctl -w vm.max_map_count=262144 |