How to show my camera?

I can get video stream and save it as m38u with ffmpeg:

 VIDSOURCE="rtsp://admin:[email protected]/cam/realmonitor?channel=1&subtype=0"
 AUDIO_OPTS="-c:a aac -b:a 160000 -ac 2"
 VIDEO_OPTS="-s 854*480 -c:v libx264 -b:v 800000"
 OUTPUT_HLS="-hls_time 10 -hls_list_size 10 -start_number 1"
 ffmpeg -i "$VIDSOURCE" -y $AUDIO_OPTS $VIDEO_OPTS $OUTPUT_HLS /tmp/mystream.m3u8

Now add it to homeassistant:

vim  configuration.yaml
camera:
    - platform: ffmpeg
    name: dahua
    input: -rtsp_transport tcp -i  rtsp://admin:password@http://192.168.31.97/cam/realmonitor?channel=1&subtype=0

Reboot hass and

How can get the id for my dahua camera and add it ,so can watch the video on homeassistant ?

simply add this to your lovelace.

type: picture-entity
entity: camera.dahua
camera_view: live
show_state: false

If your camera supports ONVIF I would strongly advise you to integrate it into HA using that rather than the ffmpeg platform. You should then get a better image (frame rate), plus it will bring through any smart options that the camera has such as motion detection.