8000 Merge pull request #440 from raulpy271/master · nicecoding1/ffmpeg-python@e044890 · GitHub
[go: up one dir, main page]

Skip to content

Commit e044890

Browse files
authored
Merge pull request kkroening#440 from raulpy271/master
adding http server example
2 parents 2931580 + 5b6b583 commit e044890

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

examples/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,32 @@ process2.wait()
214214
)
215215
```
216216

217+
## Stream from a local video to HTTP server
218+
219+
```python
220+
video_format = "flv"
221+
server_url = "http://127.0.0.1:8080"
222+
223+
process = (
224+
ffmpeg
225+
.input("input.mp4")
226+
.output(
227+
server_url,
228+
codec = "copy", # use same codecs of the original video
229+
listen=1, # enables HTTP server
230+
f=video_format)
231+
.global_args("-re") # argument to act as a live stream
232+
.run()
233+
)
234+
235+
```
236+
237+
to receive the video you can use ffplay in the terminal:
238+
239+
```
240+
$ ffplay -f flv http://localhost:8080
241+
```
242+
217243
## Stream from RTSP server to TCP socket
218244

219245
```python

0 commit comments

Comments
 (0)
0