Darwin Streaming Server服务器mp4文件点播返回”415 Unsupported Media Type“错误

时间:2021-04-29 16:50:04

Darwin Streaming Server中mp4文件点播失败,通过抓包发现服务器返回”415 Unsupported Media Type“错误,如下:

RTSP/1.0  Unsupported Media Type

Server: DSS/6.0. (Build/526.3; Platform/Linux; Release/Darwin Streaming Server; State/Development; )

Cseq: 

Connection: Close

解决方案如下:

用mp4box来hint文件

yingc@yingc:~/media/video$ MP4Box  h.mp4 -info
* Movie Info *
Timescale - Duration ::35.062
Fragmented File no - track(s)
File Brand mp42 - version
Created: GMT Sun Jul :: File has root IOD ( bytes)
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: ISO Reserved Profile (0x7f)
Audio PL: High Quality Audio Profile @ Level (0x0f)
No streams included in root OD iTunes Info:
Encoder Software: tv.sohu.com v3.3.0 Track # Info - TrackID - TimeScale - Duration ::34.920
Media Info: Language "Undetermined" - Type "vide:avc1" - samples
Visual Track layout: x= y= width= height=
MPEG- Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size x
AVC Info: SPS - PPS - Profile Main @ Level
NAL Unit length bits: yingc@yingc:~/media/video$ MP4Box h.mp4 -hint
Hinting file with Path-MTU Bytes
Hinting track ID - Type "avc1:avc1" (H264) - BW kbps
Hinting track ID - Type "mp4a:mp4a" (mpeg4-generic) - BW kbps
Saving h.mp4: 0.500 secs Interleaving yingc@yingc:~/media/video$ ffprobe h.mp4
ffprobe version 2.2. Copyright (c) - the FFmpeg developers
built on Apr :: with gcc 4.6 (Ubuntu/Linaro 4.6.-1ubuntu5)
configuration: --prefix=/home/yingc/git/thirdparty/av/ffmpeg/output/ffmpeg_build/ --bindir=/home/yingc/git/thirdparty/av/ffmpeg/output/bin --extra-cflags=' -I/home/yingc/git/thirdparty/av/ffmpeg/output/ffmpeg_build/include' --extra-ldflags=-L/home/yingc/git/thirdparty/av/ffmpeg/output/ffmpeg_build/lib --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab --disable-stripping --enable-extra-warnings --disable-optimizations --enable-openssl --enable-static --enable-debug=
libavutil . 66.100 / . 66.100
libavcodec . 52.102 / . 52.102
libavformat . 33.100 / . 33.100
libavdevice . 10.100 / . 10.100
libavfilter . 2.100 / . 2.100
libswscale . 5.102 / . 5.102
libswresample . 18.100 / . 18.100
libpostproc . 3.100 / . 3.100
Input #, mov,mp4,m4a,3gp,3g2,mj2, from 'h.mp4':
Metadata:
major_brand : mp42
minor_version :
compatible_brands: mp42isomavc1
creation_time : -- ::
encoder : tv.sohu.com v3.3.0
Duration: ::35.16, start: 0.000000, bitrate: kb/s
Stream #:(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x368, kb/s, fps, tbr, 90k tbn, tbc (default)
Metadata:
creation_time : -- ::
Stream #:(und): Audio: aac (mp4a / 0x6134706D), Hz, stereo, fltp, kb/s (default)
Metadata:
creation_time : -- ::
Stream #:(und): Data: none (rtp / 0x20707472), kb/s (default)
Metadata:
creation_time : -- ::
handler_name : GPAC ISO Hint Handler
Stream #:(und): Data: none (rtp / 0x20707472), kb/s (default)
Metadata:
creation_time : -- ::
handler_name : GPAC ISO Hint Handler
Unsupported codec with id for input stream
Unsupported codec with id for input stream

unhint文件:

yingc@yingc:~/media/video$ MP4Box  h.mp4 -unhint
Removing hint track ID
Removing hint track ID
Saving h.mp4: 0.500 secs Interleaving yingc@yingc:~/media/video$ ffprobe h.mp4
ffprobe version 2.2. Copyright (c) - the FFmpeg developers
built on Apr :: with gcc 4.6 (Ubuntu/Linaro 4.6.-1ubuntu5)
configuration: --prefix=/home/yingc/git/thirdparty/av/ffmpeg/output/ffmpeg_build/ --bindir=/home/yingc/git/thirdparty/av/ffmpeg/output/bin --extra-cflags=' -I/home/yingc/git/thirdparty/av/ffmpeg/output/ffmpeg_build/include' --extra-ldflags=-L/home/yingc/git/thirdparty/av/ffmpeg/output/ffmpeg_build/lib --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab --disable-stripping --enable-extra-warnings --disable-optimizations --enable-openssl --enable-static --enable-debug=
libavutil . 66.100 / . 66.100
libavcodec . 52.102 / . 52.102
libavformat . 33.100 / . 33.100
libavdevice . 10.100 / . 10.100
libavfilter . 2.100 / . 2.100
libswscale . 5.102 / . 5.102
libswresample . 18.100 / . 18.100
libpostproc . 3.100 / . 3.100
Input #, mov,mp4,m4a,3gp,3g2,mj2, from 'h.mp4':
Metadata:
major_brand : mp42
minor_version :
compatible_brands: mp42isomavc1
creation_time : -- ::
encoder : tv.sohu.com v3.3.0
Duration: ::35.02, start: 0.000000, bitrate: kb/s
Stream #:(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x368, kb/s, fps, tbr, 90k tbn, tbc (default)
Metadata:
creation_time : -- ::
Stream #:(und): Audio: aac (mp4a / 0x6134706D), Hz, stereo, fltp, kb/s (default)
Metadata:
creation_time : -- ::

参考:

用mp4box来hint文件的操作很简单