gpac / gpac

GPAC Ultramedia OSS for Video Streaming & Next-Gen Multimedia Transcoding, Packaging & Delivery
https://gpac.io
GNU Lesser General Public License v2.1
2.72k stars 530 forks source link

MP4Client is not playing hevc content #335

Closed trrahul closed 8 years ago

trrahul commented 8 years ago

I'm streaming from webcam using the command -vf video4linux2 -vres 320x240 -vfr 30 -v4l2f mjpeg -v /dev/video0 -live -out /opt/lampp/htdocs/dash -conf dashcast.conf

When trying to play the stream using mp4client it displays only one frame and shows the following error. The playback is fine when I'm using libx264.

System info: 3988 MB RAM - 4 cores
Modules Found : 32
Loading GPAC Terminal
Terminal Loaded in 34 ms
Opening URL http://10.42.0.18/dash/dashcast.mpd
Using network protocols without global network initialization. Please use avform
at_network_init(), this will become mandatory later.
Using network protocols without global network initialization. Please use avform
at_network_init(), this will become mandatory later.
Using network protocols without global network initialization. Please use avform
at_network_init(), this will become mandatory later.
Using network protocols without global network initialization. Please use avform
at_network_init(), this will become mandatory later.
Service Connected
[hevc @ 000000000175dec0] nb threads_frame = 3, nb threads_slice 1, thread_type
= frame
[hevc @ 000000000175e840] nb threads_frame = 3, nb threads_slice 1, thread_type
= frame
[hevc @ 0000000004032960] max_ra equal to s->max_ra 88
[hevc @ 0000000004032960] Could not find ref with POC 87
[hevc @ 0000000004032960] Replace reference 87 with 88.
jeanlf commented 8 years ago

I think this might be because of performance issues of x265. Try (with latest git) to specify an ast-offset to delay the playback, for example of 10 sec: DashCast [...] -ast-offset 10000

Note that low latency is not working with x265 we need to figure out what the correct options are for that, if any.

trrahul commented 8 years ago

Mp4client no longer shows [hevc @ 0000000004032960] Could not find ref with POC 87 errors but it still not playing anything other than the first frame.

I tried playing the segments using ffplay. ffplay -i "concat:v1_init_gpac.mp4|v1_1_gpac.m4s|v1_2_gpac.m4s|v1_3_gpac.m4s|v1_4_gpac.m4s|v1_5_gpac.m4s"

It plays the file but with lots of [hevc @ 0x7f01f80050e0] missing picture in access unit 0B f=0/0 messages.

I tried streaming h265 encoded files (https://s3.amazonaws.com/x265.org/video/Tears_400_x265.mp4). DashCast always shows [hevc @ 0000000004032960] Could not find ref with POC 87 errors and terminates for both libx265 and libx265.

jeanlf commented 8 years ago

try doing the test offline (using a file source and transcoding to hevc without -live option). Do you have the same errors ?

trrahul commented 8 years ago

No, it does not show any error when I removed the live option! But when playing the segments using ffplay still shows [hevc @ 0x7fbb780050e0] missing picture in access unit errors.

trrahul commented 8 years ago

Webcam Playback works if I run mp4client in linux machine. I was testing the playback using windows when I reported the error. When I run mp4client on Ubuntu 14.04, it shows the error

[hevc @ 0x7ff358047da0] max_ra equal to s->max_ra -121 
[hevc @ 0x7ff358047da0] Could not find ref with POC -122

but continues the playback. Only in windows the playback stops.

jeanlf commented 8 years ago

OK so this means the encoder is not fast enough to produce the segments in real time, not much we can do about that. For windows are you using one of the latest installers ?

trrahul commented 8 years ago

I'm using version 0.5.2 on windows. If dashcast can not be used to stream h265 video in realtime could you tell me if the live function mp4box can be used for this purpose?

jeanlf commented 8 years ago

1) this i not enough, what is the revision number used? HEVC playback works fine on windows, can you post the output of MP4Client session.mpd

2) yes, pre-encode your files to h265, import to MP4 and then use MP4Box for live simulation

trrahul commented 8 years ago

I tried another revision and it works now. Thank you for your help.

trrahul commented 8 years ago

Could you tell me what settings are used for encoding when -low-delay is used with dashcast and libx265?

jeanlf commented 8 years ago

vprofile=baseline preset=ultrafast tune=zerolatency

and for x264: no-mbtree:sliced-threads:sync-lookahead=0

trrahul commented 8 years ago

Thanks, but x265 documentation doesn't anything about a baseline profile.

rbouqueau commented 8 years ago

These are FFmpeg options. Dashcast use x265 thru FFmpeg.

susan1992 commented 7 years ago

For those who are also new to this area: I solved this problem by adding -low-delay.