我编写了一个bash脚本,在新终端中运行一些其他命令:
#!/bin/bash
# Sample script
gnome-terminal --title="blah blah" -x bash -c ffmpeg -i udp://239.1.2.1:60001?fifo_size=50000000 -acodec copy -vcodec copy -preset ultrafast \
-flags -global_header -f hls -hls_time 20 -hls_wrap 5 /var/www/html/ts/1.m3u8 &
sleep 1
gnome-terminal --title="blah blah" -x bash -c ffmpeg -i udp://239.1.2.2:60002?fifo_size=50000000 -acodec copy -vcodec copy -preset ultrafast \
-flags -global_header -f hls -hls_time 20 -hls_wrap 5 /var/www/html/ts/2.m3u8
每个的输出 ffmpeg
line是多个页面,它类似于:
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
... many pages after ....
[h264 @ 0xc04c60] decode_slice_header error
[h264 @ 0xc04c60] no frame!
[h264 @ 0xc04c60] non-existing PPS 0 referenced
.... many pages after ....
Program 105
Metadata:
service_name : IRIB-TV5
service_provider: IRIB
[adts @ 0xf943e0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
Output #0, hls, to '/home/stream/Desktop/tst/1.m3u8':
Metadata:
encoder : Lavf56.4.101
Stream #0:0: Video: h264 (libx264), yuv420p, 720x576 [SAR 12:11 DAR 15:11], q=-1--1, 25 fps, 90k tbn, 25 tbc
Metadata:
encoder : Lavc56.1.100 libx264
Stream #0:1(per): Audio: aac, 48000 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc56.1.100 aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac_latm (native) -> aac (native))
Press [q] to stop, [?] for help
[h264 @ 0xf42120] reference picture missing during reorder
[h264 @ 0xf42120] Missing reference picture, default is 65716
[h264 @ 0xf42120] reference picture missing during reorder
[h264 @ 0xf42120] Missing reference picture, default is 65717
当我在新终端中运行此脚本并启动命令时(在这种情况下) ffmpeg
),它会立即显示许多输出行,有时会显示许多页面 自动转到上一条消息 ...
如何在终端中向上和向下滚动到第一条消息,或者在第一页停止?
以及我必须做什么才能进入最后一页?
—
combo_ci
请参阅下面的更新答案或在您的计算机上搜索
—
Hastur
man less
要么 man more
。
完美... tnx很多
—
combo_ci
| more
要么| less
在第一页后停止输出(然后你需要按回车...例子gnome-terminal --title="blah blah" -x bash -c ' find ~ | less'