我有一个正在运行的 nginx 服务器,它允许我从我们的移动制作系统流式传输实时视频。我们还在单独的服务器上有一个广播电台,并且希望向这两个服务器传输内容。但我无法使其工作,也无法获得任何日志或错误信息来解释原因。我尝试过 nginx 配置和 FFMPEG 来尝试解决这个问题。
我尝试了各种尝试,使用我认为我从在线其他页面理解的内容:
exec_push FFREPORT=file=ffreport.log:level=48 ffmpeg -i $basename.flv -vn -acodec mp3 rtmp://source:********!!@xxx.xxx.xxx.180:8000/live;
Run Code Online (Sandbox Code Playgroud)
还尝试在 nginx conf 中使用简单的重新流:
application restream {
live on;
exec_push ffmpeg -i $basename.flv -vn -acodec mp3 rtmp://source:***********@xxx.xxx.xxx.180:8000/live;
# push server2:1935
}
Run Code Online (Sandbox Code Playgroud)
我在Mixxx Live Broadcast Connection上使用了相同的信息来获取详细信息,以为我在icecast2服务器上问了同样的事情。只是源头是nginx服务器。
这是 nginx 上的完整配置
rtmp {
server {
listen 1935;
chunk_size 4000;
application live {
live on;
allow publish 127.0.0.1;
allow publish all;
allow play all;
record all;
record_path /usr/local/nginx/flv-streams;
record_unique on;
exec_record_done ffmpeg -i $basename.flv /usr/local/nginx/html/streams/$basename.mp4;
hls on; …Run Code Online (Sandbox Code Playgroud) 我搜索并找到了许多关于如何更改运费的示例。基本上我想做同样的事情,但我想使用 3rd 方 API。
我已经使用functions.php 设置了一个自定义插件并激活了它。我认为使用了这样简单的东西:
add_filter('woocommerce_package_rates','test_overwrite',10,2);
function test_overwrite($rates,$package) {
echo "<h2>Can you see me</h2>";
foreach ($rates as $rate) {
//Set the price
$rate->cost = 1000;
//Set the TAX
$rate->taxes[1] = 1000 * 0.2;
}
return $rates;
}
Run Code Online (Sandbox Code Playgroud)
但是,当我运行结帐或购物篮时,过滤器似乎没有运行,因为我看不到echo. 我也试过了print_r()。
我是否遗漏了一些关于为什么我不能运行这个过滤器的信息?
我正在尝试通过他们自己的 API 获得第 3 方运费。他们需要国家、重量和服务。我使用硬编码值发送 HTTP 请求。但是当我试图获得实际值时,我似乎在谈到 Country 时碰壁了。
当用户更改国家/地区时,需要重新发送价格,目前我正在寻找默认值,在这种情况下是英国。
但是,我无法使用以下挂钩获得该值:
woocommerce_shipping_fields
woocommerce_checkout_get_value
这是当前的代码,在这里它动态获取权重:
add_action( 'woocommerce_cart_calculate_fees', 'shipping_weight_fee', 30, 1 );
function shipping_weight_fee( $cart ) {
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
$url = 'http://********/shipping/read.php';
$args = array(
'body' => array(
'weight' => $cart->get_cart_contents_weight(),
'location' => 'United Kingdom',
'service' => 1
)
);
$data = wp_remote_post( $url, $args );
$p = json_decode($data['body']);
//print_r($p);
$fee = $p->Data->rate;
// Setting the calculated fee based on weight
$cart->add_fee( __( 'Shipping …Run Code Online (Sandbox Code Playgroud)