...
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 |
...
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 | ||||
---|---|---|---|---|
| ||||
sysctl -w vm.max_map_count=262144 |