kaltura / nginx-vod-module

NGINX-based MP4 Repackager
GNU Affero General Public License v3.0
2k stars 439 forks source link

400 Bad Request #1200

Open Cramac opened 4 years ago

Cramac commented 4 years ago

hello. http://site.com/hls/3.mp4/index.m3u8 return error 400 bad request

i have: `mediainfo /var/www/html/3.mp4 General Complete name : /var/www/html/3.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/avc1/iso6/mp41) File size : 476 MiB Duration : 1 h 0 min Overall bit rate : 1 109 kb/s Movie name : Recording Writing application : Lavf57.83.100

Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4.2 Format settings : CABAC / 1 Ref Frames Format settings, CABAC : Yes Format settings, ReFrames : 1 frame Format settings, GOP : M=1, N=50 Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 1 h 0 min Bit rate : 1 108 kb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Variable Frame rate : 25.042 FPS Minimum frame rate : 20.000 FPS Maximum frame rate : 33.333 FPS Original frame rate : 25.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.021 Stream size : 476 MiB (100%) Color range : Full Color primaries : BT.709 Transfer characteristics : BT.709 Matrix coefficients : BT.709

ffmpeg: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/html/3.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1iso6mp41 title 👍 Recording encoder : Lavf57.83.100 Duration: 01:00:00.94, start: 0.000000, bitrate: 1109 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1920x1080, 1107 kb/s, 25.04 fps, 25 tbr, 90k tbn, 50 tbc (default) Metadata: handler_name : VideoHandler`

when I want to look in hls, I get in the log

ngx_http_vod_validate_streams: no matching streams were found ... ngx_http_vod_validate_streams: no matching streams were found while reading media header

Cramac commented 4 years ago

this one also gave an error

`mediainfo /var/www/html/2.mp4 General Complete name : /var/www/html/2.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/avc1/iso6/mp41) File size : 1.68 GiB Duration : 1 h 0 min Overall bit rate mode : Variable Overall bit rate : 4 016 kb/s Movie name : Recording Writing application : Lavf57.83.100

Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : Main@L4.1 Format settings : CABAC / 1 Ref Frames Format settings, CABAC : Yes Format settings, ReFrames : 1 frame Format settings, GOP : M=1, N=50 Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 1 h 0 min Bit rate mode : Variable Bit rate : 4 015 kb/s Maximum bit rate : 13.4 Mb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Variable Frame rate : 20.002 FPS Minimum frame rate : 12.500 FPS Maximum frame rate : 25.641 FPS Original frame rate : 20.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.097 Stream size : 1.68 GiB (100%) Color range : Full Color primaries : BT.709 Transfer characteristics : BT.709 Matrix coefficients : BT.709 `

only works like this ` mediainfo /var/www/html/88221.mp4 General Complete name : /var/www/html/88221.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/mp41) File size : 280 MiB Duration : 1 h 0 min Overall bit rate : 652 kb/s Movie name : Recording Writing application : Lavf57.83.100

Video ID : 1 Format : HEVC Format/Info : High Efficiency Video Coding Format profile : Main@L4.1@Main Codec ID : hev1 Codec ID/Info : High Efficiency Video Coding Duration : 1 h 0 min Bit rate : 651 kb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate : 10.827 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Bits/(Pixel*Frame) : 0.029 Stream size : 279 MiB (100%) Color range : Full`

Cramac commented 4 years ago

debug debug.log

config `#user root root;

worker_processes auto; worker_cpu_affinity auto;

error_log logs/error.log;

error_log logs/error.log notice;

error_log logs/error.log info;

error_log logs/debug.log debug;

pid logs/nginx.pid;

events { worker_connections 1024; multi_accept on; accept_mutex off; use epoll; }

http { include mime.types; charset utf-8;

sendfile on;
tcp_nopush on;
tcp_nodelay on;
reset_timedout_connection on;

vhost_traffic_status_zone;

server {
    listen       8080;
    server_name  localhost;

    # file handle caching / aio
    #open_file_cache          max=1000 inactive=5m;
    #open_file_cache_valid    2m;
    #open_file_cache_min_uses 1;
    #open_file_cache_errors   on;
    #aio on;

    gzip on;
    gzip_types application/vnd.apple.mpegurl;

    vod_mode local;
    vod_metadata_cache metadata_cache 512m;
    vod_response_cache response_cache 256m;

    location /status/ {
        vhost_traffic_status_display;
        vhost_traffic_status_display_format html;
    }

    location /mp4/ {
        alias /var/www/html/;

        vod none;
    }

    location /hls/ {
        alias /var/www/html/;

        vod hls;
        vod_segment_duration 300000;
        vod_align_segments_to_key_frames on;
        vod_manifest_segment_durations_mode accurate;

    }

    location /dash/ {
        alias /var/www/html/;

        vod dash;
        vod_segment_duration 30000;
        vod_align_segments_to_key_frames on;
        vod_manifest_segment_durations_mode accurate;
    }
}

}`

erankor commented 3 years ago

From the log, I think at least some of these files are fragmented MP4, e.g. - 2020/10/17 08:54:42 [debug] 11739#11739: *1 mp4_parser_parse_atoms: atom name=stco, size=16

Fragmented MP4 is not supported.