Menu

Live DASH streaming using an IP Camera (Network camera)

Help
Anonymous
2013-12-27
2014-01-09
  • Anonymous

    Anonymous - 2013-12-27

    Hi,

    I am trying to build a Live-DASH-streaming-server using an IP Camera (Network camera). Its output is stored as raw H.264 stream in real-time and I can handle the duration of the stream data.

    I set the duration of each segmented raw H.264 stream data to 4 sec. The Name of raw H.264 stream files are saved periodically to VIDEO$NUMBER$.h264

    The VIDEO$NUMBER$.h264 are already segmented stream data (Duration: 4 sec).

    I converts the VIDEO$NUMBER$.h264 to MPEG-4 video file and fragmented MP4 using FFmpeg and MP4Box. The MP4Box's command line is "MP4Box VIDEO0.mp4 -frag 4000 -dash 4000 -url-template -base-url http://127.0.0.1/ -profile live -segment-ext mp4 -segment-name DASH_ -out sample.mpd".

    Result of the command, I got a sample.mpd, DASH_init.mp4 and DASH_1.mp4 and I confirmed that in Dashplayer. It works!

    But the output files are only for first segment. So I tried that again with next input VIDEO1.mp4 for getting a next Fragmented MP4 (DASH_2.mp4). Unfortunately, the MP4Box give same output files... which are sample.mp4, DASH_init.mp4 and DASH_1.mp4.
    Video streams are VIDEO1.mp4's stream data, but I want only the DASH_2.mp4

    In my case, how can I get only the second file (DASH_2.mp4)?

    IP Camera / FFmpeg / MP4Box
    raw h.264 / MPEG-4 / Fragmented MP4

    VIDEO0.h264 / VIDEO0.mp4 / DASH_1.mp4 -- first segmented file (Succeeded)
    VIDEO1.h264 / VIDEO1.mp4 / DASH_2.mp4 -- second segmented file ( Only needs the DASH_2.mp4)
    ...
    ...
    ...


    In case of using the FFmpeg. It can specific the name of output file and the format of output file. But the MP4Box only can specific the name of output segment using the option "-segment-name NAME".
    The "-segment-name NAME" is useless for already segmented file...

    For live streaming, how can I handle the already segmented video files? At the second step, I only want to convert the VIDEO$NUMBER$.mp4 to DASH_2.mp4
    Or can i handle the starting $NUMBER$ in the name of output fragmented mp4 file(in option "-segment-name NAME_$NUMBER$)?

     
  • Anonymous

    Anonymous - 2013-12-30

    MP4Box -dash-ctx DASH.txt -dash 4000 -profile live -segment-ext mp4 -out DASHsample.mpd -add VIDEO%d.h264 -fps 30 DASH.mp4

    OK... i solved it.

    USE "-dash-ctx"

    Result of the "-dash-ctx" :
    DASH.txt
    [DASH]
    SessionType=static
    TimeShiftBufferDepth=0
    StoreParams=no
    PeriodSwitch=no
    GenerationTime=Mon Dec 30 07:26:21 2013
    GenerationNTP=3597377181
    GenerationNTPFraction=886867796
    MaxSegmentDuration=4.000000
    SegmentTemplate=DASH_dash

    [Representation_1]
    ID=1
    Source=DASH.mp4
    Setup=yes
    InitializationSegment=DASH_dashinit.mp4
    InitializationSegmentSize=858
    TKID_1_NextDecodingTime=480000
    NextSegmentIndex=5
    NextFragmentIndex=5
    CumulatedDuration=16.000000
    Bandwidth=283042

    [SegmentsStartTimes]
    DASH_dash1.mp4=0
    DASH_dash2.mp4=4
    DASH_dash3.mp4=8
    DASH_dash4.mp4=12

     
  • Cyril Concolato

    Cyril Concolato - 2014-01-06

    Hi,

    Thanks for sharing the solution. Indeed, -dash-ctx maintains the DASH context across executions of MP4Box. I'm curious, are you still using ffmpeg in between? Why?

    Cyril

     
  • Anonymous

    Anonymous - 2014-01-09

    HI,

    I didn't know that mp4box supports to change the fps.
    Previously, I used ffmpeg to change the fps. But Now Im using "-add input.h264 -fps 30 output.mp4"

    thx for reply