Skip to content

Instantly share code, notes, and snippets.

@bilson
Forked from mowings/readme.md
Created April 9, 2024 20:51
Show Gist options
  • Select an option

  • Save bilson/c2a26fb13fd2b90ad48a1f42d6ab9dbd to your computer and use it in GitHub Desktop.

Select an option

Save bilson/c2a26fb13fd2b90ad48a1f42d6ab9dbd to your computer and use it in GitHub Desktop.

Revisions

  1. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -9,8 +9,9 @@ Simple stream to file. Full resolution
    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -c copy -map 0 foo.mp4

    ### Break streamed file into 10 second segments
    ffmpeg can save file in arbitrary segments at fixed intervals
    ### Break streamed file into time segments
    ffmpeg can save file in arbitrary segments at fixed intervals. In this example, we save a new file at
    10 second intervals, but the value for `segment_time` can be any positive integer

    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
  2. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## Use ffmpeg to pull data from a dahua 4300s to a file or files
    ## Use ffmpeg to stream video from a dahua 4300s to a file or files
    You can use ffmpeg to directly pull frames off of a dahua 4300s at full resolution. May be a good
    alternative to pricey dvrs which likely cannot record at full resolution, may not work with
    the camera, or are prohibitevly expensive
  3. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## Use ffmpeg to pull dta from a dahua 4300s to a file or files
    ## Use ffmpeg to pull data from a dahua 4300s to a file or files
    You can use ffmpeg to directly pull frames off of a dahua 4300s at full resolution. May be a good
    alternative to pricey dvrs which likely cannot record at full resolution, may not work with
    the camera, or are prohibitevly expensive
  4. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 7 additions and 4 deletions.
    11 changes: 7 additions & 4 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,10 @@ Output files can be timestamped as well.
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -strftime 1 -c copy -map 0 dauphine-%Y%m%d-%H%M%S.mp4

    # Read from streams. `subtype` determines stream: 0 = main, 1 = sub
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin@198.175.207.135:554/cam/realmonitor?channel=1&subtype=1" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -strftime 1 -c copy -map 0 test-%Y%m%d-%H%M%S.mp4
    ### Select stream to read from.
    A different url is used to select the substream. Set `subtype` to 0 for main hi-res stream, or
    1 for low res substream. Channel looks to always be set to 1

    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=1" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -strftime 1 -c copy -map 0 test-%Y%m%d-%H%M%S.mp4
  5. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 17 additions and 8 deletions.
    25 changes: 17 additions & 8 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,27 @@
    ## Use ffmpeg to pull dta from a dahua 4300s to a file or files
    You can use ffmpeg to directly pull frames off of a dahua 4300s at full resolution. May be a good
    alternative to pricey dvrs which likely cannot record at full resolution, may not work with
    the camera, or are prohibitevly expensive

    ### Simple Stream to file
    Simple stream to file. Full resolution

    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -c copy -map 0 foo.mp4

    # 10 second segments
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin@198.175.207.61:554/live" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -c copy -map 0 test%d.mp4
    ### Break streamed file into 10 second segments
    ffmpeg can save file in arbitrary segments at fixed intervals

    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -c copy -map 0 test%d.mp4

    ### Timestamped output
    Output files can be timestamped as well.

    # 10 second segments, timestamped output
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin@198.175.207.135:554/live" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -strftime 1 -c copy -map 0 dauphine-%Y%m%d-%H%M%S.mp4
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -strftime 1 -c copy -map 0 dauphine-%Y%m%d-%H%M%S.mp4

    # Read from streams. `subtype` determines stream: 0 = main, 1 = sub
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin@198.175.207.135:554/cam/realmonitor?channel=1&subtype=1" \
  6. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    # Stream to file
    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:admin@198.175.207.61:554/live" \
    -c copy -map 0 foo.mp4
    ## Use ffmpeg to pull dta from a dahua 4300s to a file or files

    ### Simple Stream to file
    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -c copy -map 0 foo.mp4

    # 10 second segments
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin@198.175.207.61:554/live" \
  7. @mowings mowings renamed this gist Oct 26, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -strftime 1 -c copy -map 0 dauphine-%Y%m%d-%H%M%S.mp4

    # Read from streams. 0 = main, 1 = sub
    # Read from streams. `subtype` determines stream: 0 = main, 1 = sub
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=1" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -strftime 1 -c copy -map 0 test-%Y%m%d-%H%M%S.mp4
  9. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,9 @@ ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    # 10 second segments, timestamped output
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -strftime 1 -c copy -map 0 dauphine-%Y%m%d-%H%M%S.mp4
    -strftime 1 -c copy -map 0 dauphine-%Y%m%d-%H%M%S.mp4

    # Read from streams. 0 = main, 1 = sub
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=1" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -strftime 1 -c copy -map 0 test-%Y%m%d-%H%M%S.mp4
  10. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    # Stream to file
    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -c copy -map 0 foo.mp4

    @@ -6,7 +7,7 @@ ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -c copy -map 0 test%d.mp4

    # Timestamped output
    # 10 second segments, timestamped output
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -strftime 1 -c copy -map 0 dauphine-%Y%m%d-%H%M%S.mp4
  11. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" -c copy -map 0 foo.mp4
    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -c copy -map 0 foo.mp4

    # 10 second segments
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
  12. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,6 @@ ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -c copy -map 0 test%d.mp4

    # Timestamped output
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live"\
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1\
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -strftime 1 -c copy -map 0 dauphine-%Y%m%d-%H%M%S.mp4
  13. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,9 @@ ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:[email protected]
    # 10 second segments
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -c copy -map 0 test%d.mp4
    -c copy -map 0 test%d.mp4

    # Timestamped output
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live"\
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1\
    -strftime 1 -c copy -map 0 dauphine-%Y%m%d-%H%M%S.mp4
  14. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" -c copy -map 0 foo.mp4

    # 5 minute segments
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" -f segment -segment_time 300 -segment_format mp4\
    # 10 second segments
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \
    -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 \
    -c copy -map 0 test%d.mp4
  15. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:<pw>@198.175.207.61:554/live" -c copy -map 0 foo.mp4
    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:admin@198.175.207.61:554/live" -c copy -map 0 foo.mp4

    # 5 minute segments
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" -f segment -segment_time 300 -segment_format mp4\
  16. @mowings mowings revised this gist Oct 26, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1 +1,5 @@
    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:<pw>@198.175.207.61:554/live" -c copy -map 0 foo.mp4
    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:<pw>@198.175.207.61:554/live" -c copy -map 0 foo.mp4

    # 5 minute segments
    ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" -f segment -segment_time 300 -segment_format mp4\
    -c copy -map 0 test%d.mp4
  17. @mowings mowings created this gist Oct 26, 2015.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:<pw>@198.175.207.61:554/live" -c copy -map 0 foo.mp4