V
V
Vladimir2021-03-21 11:20:09
linux
Vladimir, 2021-03-21 11:20:09

How to implement this in Ubuntu?

In the folder in Windows 10, there are about fifty bat files, also the file "ffmpeg.exe"
, they have a script of the following type installed:

ffmpeg -i http://example.com/playlist.m3u8 -c copy 1.mp4

running all the files at the same time, m3u8 streams are recorded in mp4 format to a folder.
The question arose, is it possible to organize this in Ubuntu? As far as I know BAT is not supported there, then how can this be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xotkot, 2021-03-21
@lipskoy48

also the file "ffmpeg.exe"

In Ubuntu, ffmpeg is installed like this
$ sudo apt update
$ sudo apt install ffmpeg

they have a script like this:
ffmpeg -i http://example.com/playlist.m3u8 -c copy 1.mp4

it's hard to call it a script, it doesn't even look like a one-liner, one ffmpeg program with its own keys. If the rest of the floor hundreds of bat files are like that, then what's the problem?
as an example, let's create a script myscript.sh with the content:
#!/usr/bin/env bash

ffmpeg -i "http://example.com/playlist.m3u8" -t "3:00:00" -c copy "1.mp4"

added the -t parameter from your previous question , let
's make it executable:
$ chmod +x myscript.sh
run:
$ ./myscript.sh
in general, here you are - Bash-scripts: beginning
p.s.
if the scripts there are a little more complicated, then you can manually convert if you wish, here is an approximate command conversion table - Converting DOS Batch Files to Shell Scripts

S
Sergey Karbivnichy, 2021-03-21
@hottabxp

bash

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question