Welcome! Log In Create A New Profile

Advanced

increase video image size

Posted by neuronetv 
neuronetv
increase video image size
June 07, 2018 06:10PM
I use ffmpeg to stream a live video from my home to a vps running nginx. The
video size coming from source (home) is 320x180. Is there any way nginx can
inflate the video image? Can it be done in the nginx.conf file? This is my
nginx.conf file:

-----------------------------------------
worker_processes 1;
error_log logs/error.log debug;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
allow play all;

#creates our "live" full-resolution HLS videostream from our incoming
encoder stream and tells where to put the HLS video manifest and video
fragments
application live {
allow play all;
live on;
record all;
record_path /video_recordings;
record_unique on;
hls on;
hls_nested on;
hls_path /HLS/live;
hls_fragment 10s;

}

#creates our "mobile" lower-resolution HLS videostream from the
ffmpeg-created stream and tells where to put the HLS video manifest and
video fragments
application mobile {
allow play all;
live on;
hls on;
hls_nested on;
hls_path /HLS/mobile;
hls_fragment 10s;
}

#allows you to play your recordings of your live streams using a URL like
"rtmp://my-ip:1935/vod/filename.flv"
application vod {
play /video_recordings;
}
}
}


http {
include mime.types;
default_type application/octet-stream;

server {
listen 90;
server_name 192.168.254.178;

#creates the http-location for our full-resolution (desktop) HLS stream -
"http://my-ip/live/my-stream-key/index.m3u8";
location /live {
types {
application/vnd.apple.mpegurl m3u8;
}
alias /HLS/live;
add_header Cache-Control no-cache;
}

#creates the http-location for our mobile-device HLS stream -
"http://my-ip/mobile/my-stream-key/index.m3u8";
location /mobile {
types {
application/vnd.apple.mpegurl m3u8;
}
alias /HLS/mobile;
add_header Cache-Control no-cache;
}

#allows us to see how stats on viewers on our Nginx site using a URL like:
"http://my-ip/stats";
location /stats {
stub_status;
}

#allows us to host some webpages which can show our videos:
"http://my-ip/my-page.html";
location / {
root html;
index index.html index.htm;
}
}
}
--------------------------------------

I got this nginx.conf file off the internet because it worked in streaming
video to mobile phones. The videao stream in question is:
http://198.91.92.112:90/mobile/index.m3u8. If I paste this url into google
chrome it plays but it's small. Is there any way to modify this url so
chrome plays a larger image? I know google chrome has a zoom function under
settings but I'd like to do this with minimal fuss to the viewer. Thanks for
any help.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,280079,280079#msg-280079

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Roman Arutyunyan
Re: increase video image size
June 07, 2018 06:30PM
Hi,

On Thu, Jun 07, 2018 at 12:09:01PM -0400, neuronetv wrote:
> I use ffmpeg to stream a live video from my home to a vps running nginx. The
> video size coming from source (home) is 320x180. Is there any way nginx can
> inflate the video image? Can it be done in the nginx.conf file?

You can set up exec_push with ffmpeg at your incoming application and republish
your stream to another application with any change, including size change.
Something like this should work:

application /src {
live on;
exec_push ffmpeg -i rtmp://localhost/src/$name -c:a copy -c:v libx264
-s 640x480 -f flv rtmp://localhost/dst/$name;
}

application /dst {
# proceed here
}

> This is my
> nginx.conf file:
>
> -----------------------------------------
> worker_processes 1;
> error_log logs/error.log debug;
> events {
> worker_connections 1024;
> }
> rtmp {
> server {
> listen 1935;
> allow play all;
>
> #creates our "live" full-resolution HLS videostream from our incoming
> encoder stream and tells where to put the HLS video manifest and video
> fragments
> application live {
> allow play all;
> live on;
> record all;
> record_path /video_recordings;
> record_unique on;
> hls on;
> hls_nested on;
> hls_path /HLS/live;
> hls_fragment 10s;
>
> }
>
> #creates our "mobile" lower-resolution HLS videostream from the
> ffmpeg-created stream and tells where to put the HLS video manifest and
> video fragments
> application mobile {
> allow play all;
> live on;
> hls on;
> hls_nested on;
> hls_path /HLS/mobile;
> hls_fragment 10s;
> }
>
> #allows you to play your recordings of your live streams using a URL like
> "rtmp://my-ip:1935/vod/filename.flv"
> application vod {
> play /video_recordings;
> }
> }
> }
>
>
> http {
> include mime.types;
> default_type application/octet-stream;
>
> server {
> listen 90;
> server_name 192.168.254.178;
>
> #creates the http-location for our full-resolution (desktop) HLS stream -
> "http://my-ip/live/my-stream-key/index.m3u8";
> location /live {
> types {
> application/vnd.apple.mpegurl m3u8;
> }
> alias /HLS/live;
> add_header Cache-Control no-cache;
> }
>
> #creates the http-location for our mobile-device HLS stream -
> "http://my-ip/mobile/my-stream-key/index.m3u8";
> location /mobile {
> types {
> application/vnd.apple.mpegurl m3u8;
> }
> alias /HLS/mobile;
> add_header Cache-Control no-cache;
> }
>
> #allows us to see how stats on viewers on our Nginx site using a URL like:
> "http://my-ip/stats";
> location /stats {
> stub_status;
> }
>
> #allows us to host some webpages which can show our videos:
> "http://my-ip/my-page.html";
> location / {
> root html;
> index index.html index.htm;
> }
> }
> }
> --------------------------------------
>
> I got this nginx.conf file off the internet because it worked in streaming
> video to mobile phones. The videao stream in question is:
> http://198.91.92.112:90/mobile/index.m3u8. If I paste this url into google
> chrome it plays but it's small. Is there any way to modify this url so
> chrome plays a larger image? I know google chrome has a zoom function under
> settings but I'd like to do this with minimal fuss to the viewer. Thanks for
> any help.
>
> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,280079,280079#msg-280079
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

--
Roman Arutyunyan
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
neuronetv
Re: increase video image size
June 08, 2018 11:20AM
Roman Arutyunyan Wrote:
-------------------------------------------------------

> Something like this should work:
>
> application /src {
> live on;
> exec_push ffmpeg -i rtmp://localhost/src/$name -c:a copy -c:v
> libx264
> -s 640x480 -f flv rtmp://localhost/dst/$name;
> }
>
> application /dst {
> # proceed here
> }
>

thanks, does this go in my nginx.conf file?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,280079,280097#msg-280097

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Roman Arutyunyan
Re: increase video image size
June 08, 2018 12:30PM
Hi,

On Fri, Jun 08, 2018 at 05:15:57AM -0400, neuronetv wrote:
> Roman Arutyunyan Wrote:
> -------------------------------------------------------
>
> > Something like this should work:
> >
> > application /src {
> > live on;
> > exec_push ffmpeg -i rtmp://localhost/src/$name -c:a copy -c:v
> > libx264
> > -s 640x480 -f flv rtmp://localhost/dst/$name;
> > }
> >
> > application /dst {
> > # proceed here
> > }
> >
>
> thanks, does this go in my nginx.conf file?

Yes, it does.

> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,280079,280097#msg-280097
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

--
Roman Arutyunyan
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Sorry, only registered users may post in this forum.

Click here to login