Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (52)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Qualité du média après traitement

    21 juin 2013, par

    Le bon réglage du logiciel qui traite les média est important pour un équilibre entre les partis ( bande passante de l’hébergeur, qualité du média pour le rédacteur et le visiteur, accessibilité pour le visiteur ). Comment régler la qualité de son média ?
    Plus la qualité du média est importante, plus la bande passante sera utilisée. Le visiteur avec une connexion internet à petit débit devra attendre plus longtemps. Inversement plus, la qualité du média est pauvre et donc le média devient dégradé voire (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (8344)

  • How to set crontab in order to run multiple python and a shell scripts ?

    5 janvier 2021, par Alexander Mitsou

    I need to start three python3 scripts and a shell script using crontab. These scripts should run at the same time without any delay. Each script runs exactly for one minute. For instance I have scheduled crontab to run these scripts every 5 minutes.

    


    My problem is that, if I attempt to run each script individually from terminal it executes with no further errors, but using crontab nothing happens.

    


    DISCLAIMER : If I set up the Python3 scripts individually in crontab, they work fine !

    


    Here's my crontab set up :

    


    */5 * * * * cd /home/user/Desktop/ && /usr/bin/python3 script1.py >> report1.log

*/5 * * * * cd /home/user/Desktop/ && /usr/bin/python3 script2.py >> report2.log

*/5 * * * * cd /home/user/Desktop/ && /usr/bin/python3 script3.py >> report3.log

*/5 * * * * cd /home/user/Desktop/ && /usr/bin/sh script4.sh >> report4.log 


    


    In addition I need to mention that the shell script contains this command (FFMPEG) :

    


    #!/bin/bash

parent_dir=`dirname \`pwd\`` 
folder_name="/Data/Webcam" 
new_path=$parent_dir$folder_name  


if [ -d "$new_path" ]; then
    echo "video_audio folder exists..."
else
    echo "Creating video_audio folder in the current directory..."
    mkdir -p -- "$new_path"
    sudo chmod 777 "$new_path"
    echo "Folder created"
    echo
fi

now=$(date +%F) 
now="$( echo -e "$now" | tr  '-' '_'  )"
sub_dir=$new_path'/'$now 

if [ -d "$sub_dir" ]; then
    echo "Date Sub-directory exists..."
    echo
else
    echo "Error: ${sub_dir} not found..."
    echo "Creating date sub-directory..."
    mkdir -p -- "$sub_dir"
    sudo chmod 777 "$sub_dir"
    echo "Date sub-directory created..."
    echo
fi

fname=$(date +%H_%M_%S)".avi"
video_dir=$sub_dir'/'$fname
ffmpeg -f pulse -ac 1 -i default -f v4l2 -i  /dev/video0 -vcodec libx264 -t 00:01:00 $video_dir 


    


    The log file of that script contain the following :

    


    video_audio folder exists...
Date Sub-directory exists...

Package ffmpeg is already installed...
Package v4l-utils is already installed...

Package: ffmpeg
Status: install ok installed
Priority: optional
Section: video
Installed-Size: 2010
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: foreign
Version: 7:4.2.4-1ubuntu0.1
Replaces: libav-tools (<< 6:12~~), qt-faststart (<< 7:2.7.1-3~)
Depends: libavcodec58 (= 7:4.2.4-1ubuntu0.1), libavdevice58 (= 7:4.2.4-1ubuntu0.1), libavfilter7 (= 7:4.2.4-1ubuntu0.1), libavformat58 (= 7:4.2.4-1ubuntu0.1), libavresample4 (= 7:4.2.4-1ubuntu0.1), libavutil56 (= 7:4.2.4-1ubuntu0.1), libc6 (>= 2.29), libpostproc55 (= 7:4.2.4-1ubuntu0.1), libsdl2-2.0-0 (>= 2.0.10), libswresample3 (= 7:4.2.4-1ubuntu0.1), libswscale5 (= 7:4.2.4-1ubuntu0.1)
Suggests: ffmpeg-doc
Breaks: libav-tools (<< 6:12~~), qt-faststart (<< 7:2.7.1-3~), winff (<< 1.5.5-5~)
Description: Tools for transcoding, streaming and playing of multimedia files
 FFmpeg is the leading multimedia framework, able to decode, encode, transcode,
 mux, demux, stream, filter and play pretty much anything that humans and
 machines have created. It supports the most obscure ancient formats up to the
 cutting edge.
 .
 This package contains:
  * ffmpeg: a command line tool to convert multimedia files between formats
  * ffplay: a simple media player based on SDL and the FFmpeg libraries
  * ffprobe: a simple multimedia stream analyzer
  * qt-faststart: a utility to rearrange Quicktime files
Homepage: https://ffmpeg.org/
Original-Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
Package: v4l-utils
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 2104
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Version: 1.18.0-2build1
Replaces: ivtv-utils (<< 1.4.1-2), media-ctl
Depends: libv4l-0 (= 1.18.0-2build1), libv4l2rds0 (= 1.18.0-2build1), libc6 (>= 2.17), libgcc-s1 (>= 3.0), libstdc++6 (>= 5.2), libudev1 (>= 183)
Breaks: ivtv-utils (<< 1.4.1-2), media-ctl
Description: Collection of command line video4linux utilities
 v4l-utils contains the following video4linux command line utilities:
 .
  decode_tm6000: decodes tm6000 proprietary format streams
  rds-ctl: tool to receive and decode Radio Data System (RDS) streams
  v4l2-compliance: tool to test v4l2 API compliance of drivers
  v4l2-ctl, cx18-ctl, ivtv-ctl: tools to control v4l2 controls from the cmdline
  v4l2-dbg: tool to directly get and set registers of v4l2 devices
  v4l2-sysfs-path: sysfs helper tool
Original-Maintainer: Gregor Jasny <gjasny@googlemail.com>
Homepage: https://linuxtv.org/downloads/v4l-utils/


    


    Due to the reason that the python files are of the same structure I'm uploading a sample file here :

    


    # -*- coding: utf-8 -*-
from threading import Timer
from pynput.mouse import Listener
import logging
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(
    os.path.realpath(__file__)), "../"))

from Functions import utils as ut

if __name__=='__main__':

    ut.initialize_dirs()
    rec_file = ''.join(('mouse_',ut.get_date(),'.txt'))
    raw_data = ut.get_name('Mouse')
    rec_file = os.path.join(raw_data,rec_file)
    logging.basicConfig(filename=rec_file,level=logging.DEBUG,format="%(asctime)s    %(message)s")

    try:
        with Listener(on_move=ut.on_move, on_click=ut.on_click,on_scroll=ut.on_scroll) as listener:
            Timer(60, listener.stop).start()
            listener.join()
    except KeyboardInterrupt as err:
        print(err)
        sys.exit(0)

    print('Exiting logger...')



    


    I'm also uploading the functions that I use :

    


    # -*- coding: utf-8 -*-&#xA;from serial import Serial&#xA;from datetime import datetime, timedelta&#xA;import pandas as pd&#xA;import collections&#xA;import logging&#xA;import shutil&#xA;import serial&#xA;import time&#xA;import sys&#xA;import os&#xA;&#xA;click_held = False&#xA;button = None&#xA;&#xA;&#xA;def on_move(x,y):&#xA;    """The callback to call when mouse move events occur&#xA;&#xA;    Args:&#xA;        x (float): The new pointer position&#xA;        y (float): The new pointer poisition&#xA;    """&#xA;    if click_held:&#xA;        logging.info("MV    {0:>8}  {1:>8}  {2:>8}:".format(x,y,str(None)))&#xA;    else:&#xA;        logging.info("MV    {0:>8}  {1:>8}  {2:>8}:".format(x,y,str(None)))&#xA;&#xA;&#xA;def on_click(x,y,button,pressed):&#xA;    """The callback to call when a mouse button is clicked&#xA;&#xA;    Args:&#xA;        x (float): Mouse coordinates on screen&#xA;        y (float): Mouse coordinates on screen&#xA;        button (str): one of the Button values&#xA;        pressed (bool): Pressed is whether the button was pressed&#xA;    """&#xA;    global click_held&#xA;    if pressed:&#xA;        click_held = True&#xA;        logging.info("CLK    {0:>7}    {1:>6}    {2:>13}".format(x,y,button))&#xA;    else:&#xA;        click_held = False&#xA;        logging.info("RLS    {0:>7}    {1:>6}    {2:>13}".format(x,y,button))&#xA;&#xA;&#xA;def on_scroll(x,y,dx,dy):&#xA;    """The callback to call when mouse scroll events occur&#xA;&#xA;    Args:&#xA;        x (float): The new pointer position on screen&#xA;        y (float): The new pointer position on screen&#xA;        dx (int): The horizontal scroll. The units of scrolling is undefined&#xA;        dy (int): The vertical scroll. The units of scrolling is undefined&#xA;    """&#xA;    if dy == -1:&#xA;        logging.info("SCRD    {0:>6}    {1:>6}    {2:>6}".format(x,y,str(None)))&#xA;    elif dy == 1:&#xA;        logging.info("SCRU    {0:>6}    {1:>6}    {2:>6}".format(x,y,str(None)))&#xA;    else:&#xA;        pass&#xA;&#xA;&#xA;def on_press_keys(key):&#xA;    """The callback to call when a button is pressed.&#xA;&#xA;    Args:&#xA;        key (str): A KeyCode,a Key or None if the key is unknown&#xA;    """&#xA;    subkeys = [&#xA;    &#x27;Key.alt&#x27;,&#x27;Key.alt_gr&#x27;,&#x27;Key.alt_r&#x27;,&#x27;Key.backspace&#x27;,&#xA;    &#x27;Key.space&#x27;,&#x27;Key.ctrl&#x27;,&#x27;Key.ctrl_r&#x27;,&#x27;Key.down&#x27;,&#xA;    &#x27;Key.up&#x27;,&#x27;Key.left&#x27;,&#x27;Key.right&#x27;,&#x27;Key.page_down&#x27;,&#xA;    &#x27;Key.page_up&#x27;,&#x27;Key.enter&#x27;,&#x27;Key.shift&#x27;,&#x27;Key.shift_r&#x27;&#xA;    ]&#xA;&#xA;    key = str(key).strip(&#x27;\&#x27;&#x27;)&#xA;    if(key in subkeys):&#xA;        #print(key)&#xA;        logging.info(key)&#xA;    else:&#xA;        pass&#xA;&#xA;&#xA;def record_chair(output_file):&#xA;    """Read the data stream coming from the serial monitor&#xA;       in order to get the sensor readings&#xA;&#xA;    Args:&#xA;        output_file (str): The file name, where the data stream will be stored&#xA;    """&#xA;    serial_port = "/dev/ttyACM0"&#xA;    baud_rate = 9600&#xA;    ser = serial.Serial(serial_port,baud_rate)&#xA;    logging.basicConfig(filename=output_file,level=logging.DEBUG,format="%(asctime)s    %(message)s")&#xA;    flag = False&#xA;    start = time.time()&#xA;    while time.time() - start &lt; 60.0:&#xA;        try:&#xA;            serial_data = str(ser.readline().decode().strip(&#x27;\r\n&#x27;))&#xA;            time.sleep(0.2)&#xA;            tmp = serial_data.split(&#x27;  &#x27;)[0] #Getting Sensor Id&#xA;            if(tmp == &#x27;A0&#x27;):&#xA;                flag = True&#xA;            if (flag and tmp != &#x27;A4&#x27;):&#xA;                #print(serial_data)&#xA;                logging.info(serial_data)&#xA;            if(flag and tmp == &#x27;A4&#x27;):&#xA;                flag = False&#xA;                #print(serial_data)&#xA;                logging.info(serial_data)&#xA;        except (UnicodeDecodeError, KeyboardInterrupt) as err:&#xA;            print(err)&#xA;            print(err.args)&#xA;            sys.exit(0)&#xA;&#xA;&#xA;def initialize_dirs():&#xA;    """Create the appropriate directories in order to save&#xA;       and process the collected data&#xA;    """&#xA;    current_path = os.path.abspath(os.getcwd())&#xA;    os.chdir(&#x27;..&#x27;)&#xA;    current_path = (os.path.abspath(os.curdir)) #/Multodal_User_Monitoring&#xA;    current_path = os.path.join(current_path,&#x27;Data&#x27;)&#xA;    create_subdirs([current_path])&#xA;&#xA;    #Create mouse log folder&#xA;    mouse = os.path.join(current_path,&#x27;Mouse&#x27;)&#xA;    create_subdirs([mouse])&#xA;    #Create mouse subfolders&#xA;    names = concat_names(mouse)&#xA;    create_subdirs(names)&#xA;&#xA;    #Create keyboard log  folder&#xA;    keyboard = os.path.join(current_path,&#x27;Keyboard&#x27;)&#xA;    create_subdirs([keyboard])&#xA;    #Create keyboard subfolders&#xA;    names = concat_names(keyboard)&#xA;    create_subdirs(names)&#xA;&#xA;    #Create the chair log folder&#xA;    chair = os.path.join(current_path,&#x27;Chair&#x27;)&#xA;    create_subdirs([chair])&#xA;    #Create chair subfolders&#xA;    names = concat_names(chair)&#xA;    create_subdirs(names)&#xA;&#xA;    #Create webcam log folder&#xA;    webcam = os.path.join(current_path,&#x27;Webcam&#x27;)&#xA;    create_subdirs([webcam])&#xA;&#xA;def concat_names(dir) -> str:&#xA;    """Concatenate the given folder names&#xA;       with the appropriate path&#xA;&#xA;    Args:&#xA;        dir (str): The directory to create the subfolders&#xA;&#xA;    Returns:&#xA;        list: The new absolute paths&#xA;    """&#xA;    raw_data = os.path.join(dir,&#x27;Raw&#x27;)&#xA;    edited_data = os.path.join(dir,&#x27;Edited_logs&#x27;)&#xA;    csv_data = os.path.join(dir,&#x27;CSV&#x27;)&#xA;    features = os.path.join(dir,&#x27;Features&#x27;)&#xA;    dirs = [raw_data,edited_data,csv_data,features]&#xA;    return dirs&#xA;&#xA;&#xA;def create_subdirs(paths):&#xA;    """Create sub directories given some absolute paths&#xA;&#xA;    Args:&#xA;        paths (list): A list containing the paths to be created&#xA;    """&#xA;    for index,path in enumerate(paths):&#xA;        if(os.path.isdir(paths[index])):&#xA;            pass&#xA;        else:&#xA;            os.mkdir(paths[index])&#xA;&#xA;&#xA;def round_down(num,divisor) -> int:&#xA;    """Round the number of lines contained into the recording file,&#xA;       down to the nearest multiple of the given divisor&#xA;&#xA;    Args:&#xA;        num (int): The number of lines contained into the given log file&#xA;        divisor (int): The divisor in order to get tuples of divisor&#xA;&#xA;    Returns:&#xA;        int: The nearest multiple of five&#xA;    """&#xA;    return num-(num%divisor)&#xA;&#xA;&#xA;def get_date() -> str:&#xA;    """Get the current date in order to properly name&#xA;       the recored log files&#xA;    Returns:&#xA;        str: The current date in: YY_MM_DD format&#xA;    """&#xA;    return datetime.now().strftime(&#x27;%Y_%m_%d&#x27;)&#xA;&#xA;&#xA;def get_name(modality) -> str:&#xA;    """Save the recorded log into /Data//Raw&#xA;&#xA;    Args:&#xA;        modality (str): The log data source&#xA;&#xA;    Returns:&#xA;        str: The absolute path where each recording is saved&#xA;    """&#xA;    current_path = os.path.abspath(os.getcwd())&#xA;    current_path = os.path.join(current_path,&#x27;Data&#x27;)&#xA;&#xA;    if modality == &#x27;Chair&#x27;:&#xA;        chair_path = os.path.join(current_path,modality,&#x27;Raw&#x27;)&#xA;        return chair_path&#xA;&#xA;    elif modality == &#x27;Mouse&#x27;:&#xA;        mouse_path = os.path.join(current_path,modality,&#x27;Raw&#x27;)&#xA;        return mouse_path&#xA;&#xA;    elif modality == &#x27;Keyboard&#x27;:&#xA;        keyboard_path = os.path.join(current_path,modality,&#x27;Raw&#x27;)&#xA;        return keyboard_path&#xA;&#xA;&#xA;def crawl_dir(target,folder) -> str:&#xA;    """Enumerate all the given files in a directory&#xA;       based on the given file extension&#xA;&#xA;    Args:&#xA;        target (str): The file to search for&#xA;        folder (str): The folder to search&#xA;&#xA;    Returns:&#xA;        [type]: A list containing the file names&#xA;    """&#xA;    current_path = os.path.abspath(os.getcwd())&#xA;    path = os.path.join(current_path,folder)&#xA;    file_names =[]&#xA;    for f in os.listdir(path):&#xA;        if(f.endswith(target)):&#xA;            fname=os.path.join(path,f)&#xA;            file_names.append(fname)&#xA;    return file_names&#xA;&#xA;&#xA;def convert_keys2_csv(input_file,output_file):&#xA;    """Convert the data stream file(keylogger recording) from .txt to .csv format&#xA;&#xA;    Args:&#xA;        input_file (str): The data stream file in .txt format&#xA;        output_file (str): The csv extension file name&#xA;    """&#xA;    df = pd.read_fwf(input_file)&#xA;    col_names = [&#x27;Date&#x27;,&#x27;Time&#x27;,&#x27;Key&#x27;]&#xA;    df.to_csv(output_file,header=col_names,encoding=&#x27;utf-8&#x27;,index=False)&#xA;&#xA;&#xA;def convert_mouse2_csv(input_file,output_file):&#xA;    """Convert the data stream file(mouselogger recording) from .txt to .csv format&#xA;&#xA;    Args:&#xA;        input_file (str): The data stream file in .txt format&#xA;        output_file (str): The csv extension file name&#xA;    """&#xA;    df = pd.read_fwf(input_file)&#xA;    col_names = [&#x27;Date&#x27;,&#x27;Time&#x27;,&#x27;Action&#x27;,&#x27;PosX&#x27;,&#x27;PosY&#x27;,&#x27;Button&#x27;]&#xA;    df.to_csv(output_file,header=col_names,encoding=&#x27;utf-8&#x27;,index=False)&#xA;&#xA;&#xA;def convert_chair_2_csv(input_file,output_file):&#xA;    """Convert the data stream file(chair recording)&#xA;       from .txt to .csv format&#xA;&#xA;    Args:&#xA;        input_file (str): The data stream file in .txt format&#xA;        output_file (str): The csv extension file name&#xA;    """&#xA;    if(os.path.isfile(input_file)):&#xA;        pass&#xA;    else:&#xA;        print(&#x27;Invalid working directory...&#x27;)&#xA;        print(&#x27;Aborting...&#x27;)&#xA;        sys.exit(0)&#xA;&#xA;    tmp0,tmp1,tmp2,tmp3,tmp4 = 0,1,2,3,4&#xA;&#xA;    line_number = 0&#xA;    for line in open(input_file).readlines():&#xA;        line_number &#x2B;= 1&#xA;&#xA;    rounded_line = round_down(line_number,5)&#xA;    d = collections.defaultdict(list)&#xA;&#xA;    with open(input_file,&#x27;r&#x27;) as f1:&#xA;        lines = f1.readlines()&#xA;        for i in range(rounded_line // 5):&#xA;            #Sensor:Analog input 0 values&#xA;            Sid0 = lines[i&#x2B;tmp0]&#xA;            temp = Sid0.split()&#xA;            d[&#x27;Sid0&#x27;].append([temp[0],temp[1],temp[2],temp[3]])&#xA;            #Sensor:Analog input 1 values&#xA;            Sid1 = lines[i&#x2B;tmp1]&#xA;            temp = Sid1.split()&#xA;            d[&#x27;Sid1&#x27;].append([temp[0],temp[1],temp[2],temp[3]])&#xA;            #Sensor:Analog input 2 values&#xA;            Sid2 = lines[i&#x2B;tmp2]&#xA;            temp = Sid2.split()&#xA;            d[&#x27;Sid2&#x27;].append([temp[0],temp[1],temp[2],temp[3]])&#xA;            #Sensor:Analog input 3 values&#xA;            Sid3 = lines[i&#x2B;tmp3]&#xA;            temp = Sid3.split()&#xA;            d[&#x27;Sid3&#x27;].append([temp[0],temp[1],temp[2],temp[3]])&#xA;            #Sensor:Analog input 4 values&#xA;            Sid4 = lines[i&#x2B;tmp4]&#xA;            temp = Sid4.split()&#xA;            d[&#x27;Sid4&#x27;].append([temp[0],temp[1],temp[2],temp[3]])&#xA;&#xA;            tmp0 &#x2B;= 4&#xA;            tmp1 &#x2B;= 4&#xA;            tmp2 &#x2B;= 4&#xA;            tmp3 &#x2B;= 4&#xA;            tmp4 &#x2B;= 4&#xA;&#xA;    l = []&#xA;    for i in range(rounded_line // 5):&#xA;        date = d[&#x27;Sid0&#x27;][i][0]&#xA;        time = d[&#x27;Sid0&#x27;][i][1]&#xA;        A0_val = d[&#x27;Sid0&#x27;][i][3]&#xA;        A1_val = d[&#x27;Sid1&#x27;][i][3]&#xA;        A2_val = d[&#x27;Sid2&#x27;][i][3]&#xA;        A3_val = d[&#x27;Sid3&#x27;][i][3]&#xA;        A4_val = d[&#x27;Sid4&#x27;][i][3]&#xA;        l.append([date,time,A0_val,A1_val,A2_val,A3_val,A4_val])&#xA;&#xA;    sensor_readings_df = pd.DataFrame.from_records(l)&#xA;    sensor_readings_df.columns = [&#x27;Date&#x27;,&#x27;Time&#x27;,&#x27;A0&#x27;,&#x27;A1&#x27;,&#x27;A2&#x27;,&#x27;A3&#x27;,&#x27;A4&#x27;]&#xA;    sensor_readings_df.to_csv(output_file, encoding=&#x27;utf-8&#x27;, index=False)&#xA;    del l&#xA;&#xA;&#xA;def parse_raw_data(modality):&#xA;    """Convert each modality&#x27;s raw data into csv format and move&#xA;       the edited raw data into the appropriate Edited_logs folder&#xA;&#xA;    Args:&#xA;        modality (str): The data source&#xA;    """&#xA;    #Change directories&#xA;    current_path = os.path.abspath(os.getcwd()) #/Functions&#xA;    os.chdir(&#x27;..&#x27;)&#xA;    current_path = (os.path.abspath(os.curdir)) #/Multimodal_User_Monitoring&#xA;    os.chdir(&#x27;./Data&#x27;)#/Multimodal_User_Monitoring/Data&#xA;    current_path = (os.path.abspath(os.curdir)) #/Multimodal_User_Monitoring/Data&#xA;    current_path = os.path.join(current_path,modality) #example: /Multimodal_User_Monitoring/Data/<modality>&#xA;    raw_data_path = os.path.join(current_path,&#x27;Raw&#x27;)&#xA;    csv_data_path = os.path.join(current_path,&#x27;CSV&#x27;)&#xA;    edited_logs_path = os.path.join(current_path,&#x27;Edited_logs&#x27;)&#xA;&#xA;    txt_names = crawl_dir(&#x27;.txt&#x27;,raw_data_path)&#xA;    csv_names = []&#xA;    for elem in txt_names:&#xA;        name = elem.split(&#x27;/&#x27;)[-1].split(&#x27;.&#x27;)[0]&#xA;        csv_name = name&#x2B;&#x27;.csv&#x27;&#xA;        tmp = os.path.join(csv_data_path,csv_name)&#xA;        csv_names.append(tmp)&#xA;&#xA;    if modality == &#x27;Mouse&#x27;:&#xA;        if len(txt_names) == len(csv_names):&#xA;            for i, elem in enumerate(txt_names):&#xA;            #for i in range(len(txt_names)):&#xA;                convert_mouse2_csv(txt_names[i],csv_names[i])&#xA;                shutil.move(txt_names[i],edited_logs_path)&#xA;&#xA;    elif modality == &#x27;Keyboard&#x27;:&#xA;        if len(txt_names) == len(csv_names):&#xA;            for i, elem in enumerate(txt_names):&#xA;            #for i in range(len(txt_names)):&#xA;                convert_keys2_csv(txt_names[i],csv_names[i])&#xA;                shutil.move(txt_names[i],edited_logs_path)&#xA;&#xA;    elif modality == &#x27;Chair&#x27;:&#xA;        if len(txt_names) == len(csv_names):&#xA;            for i, elem in enumerate(txt_names):&#xA;            #for i in range(len(txt_names)):&#xA;                convert_chair_2_csv(txt_names[i],csv_names[i])&#xA;                shutil.move(txt_names[i],edited_logs_path)&#xA;&#xA;</modality>

    &#xA;

    I need to mention that the logs of the python3 scripts are empty

    &#xA;

  • How to set output file while using subprocess.Popen and hide cmd window at the same time ?

    2 mars 2021, par Nande

    I made a simple app that can convert video files using FFMpeg. I used Kivy for UI. I used os.system() to execute ffmpeg commands but while using this method, there is always a cmd window popping up. Therefore i am trying to use subprocess.Popen() to execute ffmpeg commands but i also want to save ffmpeg output to a text file.

    &#xA;

    I tried this but it didn't work :

    &#xA;

    subprocess.Popen(f"ffmpeg -i {path} -acodec {acodec} {output} > output.txt 2>&amp;1", creationflags = 0x08000000, stdout="output.txt")&#xA;

    &#xA;

    FFMpeg converts the video but there is no output.txt file. This code works with os.system()

    &#xA;

    How can i hide cmd window while saving output to a text file ?

    &#xA;

    My full python code :

    &#xA;

    import os&#xA;from signal import SIGINT&#xA;import psutil&#xA;from time import sleep&#xA;from threading import Thread&#xA;from kivy.config import Config&#xA;Config.set(&#x27;graphics&#x27;, &#x27;resizable&#x27;, False)&#xA;Config.set(&#x27;graphics&#x27;, &#x27;width&#x27;, &#x27;400&#x27;)&#xA;Config.set(&#x27;graphics&#x27;, &#x27;height&#x27;, &#x27;330&#x27;)&#xA;from kivy.app import App&#xA;from kivy.uix.widget import Widget&#xA;from kivy.core.window import Window&#xA;from kivy.uix.popup import Popup&#xA;from kivy.properties import ObjectProperty&#xA;&#xA;Window.clearcolor = (1, 1, 1, 1)&#xA;&#xA;desktop = os.path.join(os.path.join(os.path.expanduser(&#x27;~&#x27;)), &#x27;Desktop&#x27;) &#x2B; "\\"&#xA;&#xA;&#xA;def cmd(command):&#xA;    os.system(command)&#xA;&#xA;&#xA;def getpid(prcs):&#xA;    for proc in psutil.process_iter():&#xA;        try:&#xA;            pinf = proc.as_dict(attrs=["pid", "name"])&#xA;            if prcs.lower() in pinf["name"].lower():&#xA;                return pinf["pid"]&#xA;        except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):&#xA;            return False&#xA;    return False&#xA;&#xA;&#xA;# noinspection PyGlobalUndefined&#xA;def progress(app, path):&#xA;    app.root.prgrss_bar.value = 0&#xA;    app.root.prgrss_lbl.text = "Progress: %0"&#xA;&#xA;    if not os.getcwd().endswith("ffmpeg"):&#xA;        os.chdir("ffmpeg")&#xA;&#xA;    inputpath = app.root.label.text&#xA;    if inputpath.startswith("Choose"):&#xA;        return&#xA;    audio = app.root.audio.state&#xA;    video = app.root.video.state&#xA;    both = app.root.both.state&#xA;&#xA;    global line1&#xA;    global line2&#xA;&#xA;    if video == "down" or both == "down":&#xA;        command = f"ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 {inputpath} > output2.txt 2>&amp;1"&#xA;        os.system(command)&#xA;        ffprobe = open("output2.txt", "r")&#xA;        frames = int(ffprobe.read())&#xA;&#xA;        control = True&#xA;        while control:&#xA;            sleep(0.5)&#xA;&#xA;            with open(path, "r") as f:&#xA;                for last_line in f:&#xA;                    pass&#xA;                line1 = last_line&#xA;            sleep(0.5)&#xA;&#xA;            with open(path, "r") as f:&#xA;                for last_line in f:&#xA;                    pass&#xA;                line2 = last_line&#xA;            if line1 == line2:&#xA;                app.root.prgrss_bar.value = 100&#xA;                app.root.prgrss_lbl.text = "Progress: Finished"&#xA;                control = False&#xA;            else:&#xA;                try:&#xA;                    current_frame = int(line2.split("=")[1].split()[0])&#xA;                    percentage = int(current_frame / frames * 100)&#xA;                    text = f"Progress: %{percentage}"&#xA;                    app.root.prgrss_lbl.text = text&#xA;                    app.root.prgrss_bar.value = percentage&#xA;                    if percentage == 100:&#xA;                        control = False&#xA;                except ValueError or TypeError:&#xA;                    pass&#xA;&#xA;    elif audio == "down":&#xA;        command = f"ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 {app.root.label.text} > output2.txt 2>&amp;1"&#xA;        os.system(command)&#xA;        ffprobe = open("output2.txt", "r")&#xA;        duration = round(float(ffprobe.read()), 2)&#xA;        control = True&#xA;        while control:&#xA;            sleep(0.5)&#xA;            with open(path, "r") as f:&#xA;                for last_line in f:&#xA;                    pass&#xA;                line1 = last_line&#xA;            sleep(0.5)&#xA;&#xA;            with open(path, "r") as f:&#xA;                for last_line in f:&#xA;                    pass&#xA;                line2 = last_line&#xA;            if line1 == line2:&#xA;                app.root.prgrss_bar.value = 100&#xA;                app.root.prgrss_lbl.text = "Progress: Finished"&#xA;                control = False&#xA;            else:&#xA;                try:&#xA;                    current = line2.split("=")[2].split()[0].split(":")&#xA;                    seconds = round((int(current[0]) * 3600) &#x2B; (int(current[1]) * 60) &#x2B; float(current[2]), 2)&#xA;                    percentage = int(seconds / duration * 100)&#xA;                    text = f"Progress: %{percentage}"&#xA;                    app.root.prgrss_lbl.text = text&#xA;                    app.root.prgrss_bar.value = percentage&#xA;                    if percentage == 100:&#xA;                        control = False&#xA;                except ValueError or TypeError:&#xA;                    pass&#xA;&#xA;&#xA;class Window(Widget):&#xA;&#xA;    @staticmethod&#xA;    def popup_open():&#xA;        popup = FolderPopup()&#xA;        popup.open()&#xA;&#xA;    @staticmethod&#xA;    def exists_open():&#xA;        popup = Exists()&#xA;        popup.open()&#xA;&#xA;    @staticmethod&#xA;    def choose_open():&#xA;        popup = ChooseFormat()&#xA;        popup.open()&#xA;&#xA;    @staticmethod&#xA;    def path_popup():&#xA;        popup = ChoosePath()&#xA;        popup.open()&#xA;&#xA;    @staticmethod&#xA;    def unsupported_audio():&#xA;        popup = UnsupportedAudio()&#xA;        popup.open()&#xA;&#xA;    @staticmethod&#xA;    def no_video_format():&#xA;        popup = NoVideoFormat()&#xA;        popup.open()&#xA;&#xA;    @staticmethod&#xA;    def no_process():&#xA;        popup = NoFFMPEGProcess()&#xA;        popup.open()&#xA;&#xA;    def start(self, app):&#xA;        path = app.root.label.text&#xA;        if path.startswith("Choose"):&#xA;            self.path_popup()&#xA;            return&#xA;&#xA;        outname = app.root.outname.text&#xA;        video_f = app.root.spinner.text&#xA;        audio_f = app.root.spinner2.text&#xA;        video = app.root.video.state&#xA;        audio = app.root.audio.state&#xA;        both = app.root.both.state&#xA;&#xA;        audio_supported = {"MP4": ["AAC", "MP3", "Opus"],&#xA;                           "MKV": ["AAC", "MP3", "Opus"],&#xA;                           "MOV": ["AAC", "MP3"],&#xA;                           "AVI": ["AAC", "MP3"],&#xA;                           "WMV": ["AAC", "MP3"]}&#xA;&#xA;        audio_ce = {"AAC": ["aac", ".m4a"],&#xA;                    "MP3": ["libmp3lame", ".mp3"],&#xA;                    "Opus": ["libopus", ".opus"],&#xA;                    "WAV": ["pcm_u8", ".wav"],&#xA;                    "Choose": ["Choose", "Choose"]}&#xA;&#xA;        if not os.getcwd().endswith("ffmpeg"):&#xA;            os.chdir("ffmpeg")&#xA;&#xA;        video_ext = video_f.lower()&#xA;        acodec = audio_ce[audio_f][0]&#xA;        audio_ext = audio_ce[audio_f][1]&#xA;        command = ""&#xA;&#xA;        if (video == "normal" and audio == "normal" and both == "normal") or (&#xA;                video_f == "Choose" and audio_f == "Choose"):&#xA;            self.choose_open()&#xA;            return&#xA;        elif video == "down":&#xA;            if video_f == "Choose":&#xA;                self.no_video_format()&#xA;                return&#xA;            output = f"{desktop}{outname}.{video_ext}"&#xA;            if not os.path.exists(output):&#xA;                command &#x2B;= f"ffmpeg -i {path} -an {output} > output.txt 2>&amp;1"&#xA;            else:&#xA;                self.exists_open()&#xA;                return&#xA;        elif audio == "down":&#xA;            output = f"{desktop}{outname}{audio_ext}"&#xA;            if not os.path.exists(output):&#xA;                command &#x2B;= f"ffmpeg -i {path} -vn -acodec {acodec} {output} > output.txt 2>&amp;1"&#xA;            else:&#xA;                self.exists_open()&#xA;                return&#xA;        elif both == "down":&#xA;            if video_f == "Choose":&#xA;                self.no_video_format()&#xA;                return&#xA;            elif audio_f == "Choose":&#xA;                output = f"{desktop}{outname}.{video_ext}"&#xA;                if not os.path.exists(output):&#xA;                    command &#x2B;= f"ffmpeg -i {path} {output} > output.txt 2>&amp;1"&#xA;                else:&#xA;                    self.exists_open()&#xA;                    return&#xA;            else:&#xA;                if audio_f not in audio_supported[video_f]:&#xA;                    self.unsupported_audio()&#xA;                    return&#xA;                else:&#xA;                    output = f"{desktop}{outname}.{video_ext}"&#xA;                    if not os.path.exists(output):&#xA;                        command &#x2B;= f"ffmpeg -i {path} -acodec {acodec} {output} > output.txt 2>&amp;1"&#xA;                    else:&#xA;                        self.exists_open()&#xA;                        return&#xA;&#xA;        thrd = Thread(target=cmd, args=(command,))&#xA;        thrd.start()&#xA;        print("Thread started.")&#xA;&#xA;    def stop(self):&#xA;        pid = getpid("ffmpeg")&#xA;        if not pid:&#xA;            self.no_process()&#xA;        else:&#xA;            os.kill(pid, SIGINT)&#xA;&#xA;    def test_open(self, app):&#xA;        if not os.getcwd().endswith("ffmpeg"):&#xA;            os.chdir("ffmpeg")&#xA;&#xA;        video = app.root.label.text&#xA;        if video.startswith("Choose"):&#xA;            return self.path_popup()&#xA;&#xA;        command = f"ffplay {video}"&#xA;        os.system(command)&#xA;&#xA;    @staticmethod&#xA;    def check_progress(app):&#xA;        path = os.getcwd() &#x2B; r"\output.txt"&#xA;        chkprgrss = Thread(target=progress, args=(app, path,))&#xA;        chkprgrss.start()&#xA;&#xA;&#xA;class FolderPopup(Popup):&#xA;    dosya = ObjectProperty(None)&#xA;    desktop = desktop&#xA;&#xA;    @staticmethod&#xA;    def no_path_submit():&#xA;        popup = NoPathSubmit()&#xA;        popup.open()&#xA;&#xA;    def buton(self, app):&#xA;&#xA;        try:&#xA;            app.root.label.text = self.dosya.selection[0]&#xA;            self.dismiss()&#xA;        except:&#xA;            self.no_path_submit()&#xA;&#xA;&#xA;class Exists(Popup):&#xA;    def buton(self):&#xA;        self.dismiss()&#xA;&#xA;&#xA;class ChooseFormat(Popup):&#xA;    def buton(self):&#xA;        self.dismiss()&#xA;&#xA;&#xA;class ChoosePath(Popup):&#xA;    def buton(self):&#xA;        self.dismiss()&#xA;&#xA;&#xA;class UnsupportedAudio(Popup):&#xA;    def buton(self):&#xA;        self.dismiss()&#xA;&#xA;&#xA;class NoVideoFormat(Popup):&#xA;    def buton(self):&#xA;        self.dismiss()&#xA;&#xA;&#xA;class NoPathSubmit(Popup):&#xA;    def buton(self):&#xA;        self.dismiss()&#xA;&#xA;&#xA;class NoFFMPEGProcess(Popup):&#xA;    def buton(self):&#xA;        self.dismiss()&#xA;&#xA;&#xA;class GUI(App):&#xA;    def build(self):&#xA;        return Window()&#xA;&#xA;&#xA;if __name__ == "__main__":&#xA;    GUI().run()&#xA;

    &#xA;

  • Transcoding with the GCP Transcoder API results in a time gap

    3 mars 2021, par banyan

    I've been trying GCP's Transcoder API and having trouble with the time randomly becoming shorter than specified in certain cases.

    &#xA;

    The specific cases are as follows :

    &#xA;

      &#xA;
    1. Specifying startTimeOffset and endTimeOffset (cut off 2 seconds before and after the video)
    2. &#xA;

    3. fMP4 is used as container
    4. &#xA;

    5. input video is mp4 with screen recording on iPad Pro
    6. &#xA;

    &#xA;

    For example, if I don't specify startTimeOffset and endTimeOffset, the time will not be shortened. Also, there is no problem when MPEG2-TS is specified for container. There may be a problem with the video itself, but I haven't found a clue how to set it up.

    &#xA;

    I'm not sure whether this is a problem with the Transcoder API or with me.

    &#xA;

    The test input video : https://gofile.io/d/DUT9rr

    &#xA;

    ❯ ffprobe input.mp4&#xA;ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers&#xA;  built with Apple clang version 12.0.0 (clang-1200.0.32.28)&#xA;  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_8 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;input.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 1&#xA;    compatible_brands: isommp41mp42&#xA;    creation_time   : 2021-02-26T15:08:58.000000Z&#xA;  Duration: 00:02:51.15, start: 0.000000, bitrate: 551 kb/s&#xA;    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 246 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2021-02-26T15:08:58.000000Z&#xA;      handler_name    : Core Media Audio&#xA;    Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709/bt709/iec61966-2-1), 1920x1342, 302 kb/s, 12.39 fps, 120 tbr, 600 tbn, 1200 tbc (default)&#xA;    Metadata:&#xA;      rotate          : 180&#xA;      creation_time   : 2021-02-26T15:08:58.000000Z&#xA;      handler_name    : Core Media Video&#xA;    Side data:&#xA;      displaymatrix: rotation of -180.00 degrees&#xA;

    &#xA;

    #!/bin/bash -eu&#xA;&#xA;cat > request.json &lt;&lt; EOF&#xA;{&#xA;  "config": {&#xA;    "inputs": [&#xA;      {&#xA;        key: "input0"&#xA;      }&#xA;    ],&#xA;    "editList": [&#xA;      {&#xA;        "key": "atom0",&#xA;        "inputs": [&#xA;          "input0"&#xA;        ],&#xA;        "startTimeOffset": "2s",&#xA;        "endTimeOffset": "169s",&#xA;      },&#xA;    ],&#xA;    "elementaryStreams": [&#xA;      {&#xA;        "videoStream": {&#xA;          "codec": "h265",&#xA;          "heightPixels": 480,&#xA;          "bitrateBps": 1200000,&#xA;          "rateControlMode": "vbr",&#xA;          "enableTwoPass": true,&#xA;          "frameRate": 30,&#xA;          "crfLevel": 31,&#xA;          "gopDuration": "3.0s",&#xA;        },&#xA;        "key": "h265-stream0"&#xA;      },&#xA;      {&#xA;        "videoStream": {&#xA;          "codec": "h265",&#xA;          "heightPixels": 720,&#xA;          "bitrateBps": 1550000,&#xA;          "rateControlMode": "vbr",&#xA;          "enableTwoPass": true,&#xA;          "frameRate": 30,&#xA;          "crfLevel": 31,&#xA;          "gopDuration": "3.0s",&#xA;        },&#xA;        "key": "h265-stream1"&#xA;      },&#xA;      {&#xA;        "videoStream": {&#xA;          "codec": "h265",&#xA;          "heightPixels": 1080,&#xA;          "bitrateBps": 2600000,&#xA;          "rateControlMode": "vbr",&#xA;          "enableTwoPass": true,&#xA;          "frameRate": 30,&#xA;          "crfLevel": 31,&#xA;          "gopDuration": "3.0s",&#xA;        },&#xA;        "key": "h265-stream2"&#xA;      },&#xA;      {&#xA;        "audioStream": {&#xA;          "codec": "aac",&#xA;          "bitrateBps": 64000,&#xA;          "channelCount": 2,&#xA;          "channelLayout": [&#xA;            "fl",&#xA;            "fr"&#xA;          ],&#xA;          "sampleRateHertz": 48000&#xA;        },&#xA;        "key": "audio-stream0"&#xA;      },&#xA;    ],&#xA;    "muxStreams": [&#xA;      {&#xA;        "key": "media-sd",&#xA;        "fileName": "media-sd.m4s",&#xA;        "container": "fmp4",&#xA;        "elementaryStreams": [&#xA;          "h265-stream0",&#xA;        ],&#xA;        "segmentSettings": {&#xA;          "individualSegments": true&#xA;        },&#xA;      },&#xA;      {&#xA;        "key": "media-hd",&#xA;        "fileName": "media-hd.m4s",&#xA;        "container": "fmp4",&#xA;        "elementaryStreams": [&#xA;          "h265-stream1",&#xA;        ],&#xA;        "segmentSettings": {&#xA;          "individualSegments": true&#xA;        },&#xA;      },&#xA;      {&#xA;        "key": "media-fhd",&#xA;        "fileName": "media-fhd.m4s",&#xA;        "container": "fmp4",&#xA;        "elementaryStreams": [&#xA;          "h265-stream2",&#xA;        ],&#xA;        "segmentSettings": {&#xA;          "individualSegments": true&#xA;        },&#xA;      },&#xA;      {&#xA;        "key": "audio-only",&#xA;        "fileName": "audio-only.m4s",&#xA;        "container": "fmp4",&#xA;        "elementaryStreams": [&#xA;          "audio-stream0"&#xA;        ],&#xA;        "segmentSettings": {&#xA;          "individualSegments": true&#xA;        },&#xA;      },&#xA;    ],&#xA;    "manifests": [&#xA;      {&#xA;        "fileName": "manifest-h265.mpd",&#xA;        "type": "DASH",&#xA;        "muxStreams": [&#xA;          "media-sd",&#xA;          "media-hd",&#xA;          "media-fhd",&#xA;          "audio-only",&#xA;        ]&#xA;      },&#xA;    ]&#xA;  }&#xA;}&#xA;EOF&#xA;&#xA;curl -X POST \&#xA;-H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \&#xA;-H "Content-Type: application/json; charset=utf-8" \&#xA;-d @request.json \&#xA;https://transcoder.googleapis.com/v1beta1/projects/MY_PROJECT/locations/asia-east1/jobTemplates?jobTemplateId=test-template&#xA;

    &#xA;

    #!/bin/bash -eu&#xA;&#xA;cat > request.json &lt;&lt; EOF&#xA;{&#xA;  "inputUri": "gs://my-bucket/input.mp4",&#xA;  "outputUri": "gs://my-bucket/output/",&#xA;  "templateId": "test-template"&#xA;}&#xA;EOF&#xA;&#xA;curl -X POST \&#xA;-H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \&#xA;-H "Content-Type: application/json; charset=utf-8" \&#xA;-d @request.json \&#xA;https://transcoder.googleapis.com/v1beta1/projects/MY_PROJECT/locations/asia-east1/jobs&#xA;

    &#xA;

    The following is a ffprobe of the resulting manifest file, which is 2 seconds shorter than specified. (expected : 00:02:47.00, actual : 00:02:45.00) In this case, it's a 2-second gap, but it can be 10 seconds or 30 seconds, and it varies from video to video.

    &#xA;

    ❯ ffprobe manifest-h265.mpd&#xA;ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers&#xA;  built with Apple clang version 12.0.0 (clang-1200.0.32.28)&#xA;  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_8 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;Input #0, dash, from &#x27;manifest-h265.mpd&#x27;:&#xA;  Duration: 00:02:45.00, start: 0.000000, bitrate: 0 kb/s&#xA;  Program 0&#xA;    Stream #0:0: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709/unknown/unknown), 686x480, 112 kb/s, 30 fps, 120 tbr, 10k tbn, 30 tbc&#xA;    Metadata:&#xA;      variant_bitrate : 113679&#xA;      id              : 113679&#xA;    Stream #0:1: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709/unknown/unknown), 1030x720, 205 kb/s, 30 fps, 120 tbr, 10k tbn, 30 tbc&#xA;    Metadata:&#xA;      variant_bitrate : 189219&#xA;      id              : 189219&#xA;    Stream #0:2: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709/unknown/unknown), 1544x1080, 384 kb/s, 30 fps, 120 tbr, 10k tbn, 30 tbc&#xA;    Metadata:&#xA;      variant_bitrate : 358043&#xA;      id              : 358043&#xA;    Stream #0:3: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 65 kb/s&#xA;    Metadata:&#xA;      variant_bitrate : 70245&#xA;      id              : 70245&#xA;

    &#xA;

    The following is the time as specified for h264 + MPEG2-TS + Apple HLS.

    &#xA;

    ❯ ffprobe manifest-h264.m3u8 | pbcopy&#xA;ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers&#xA;  built with Apple clang version 12.0.0 (clang-1200.0.32.28)&#xA;  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_8 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;[hls @ 0x7fe23100f200] Opening &#x27;h264-sd-ts.m3u8&#x27; for reading&#xA;[hls @ 0x7fe23100f200] Skip (&#x27;#EXT-X-VERSION:4&#x27;)&#xA;[hls @ 0x7fe23100f200] Opening &#x27;h264-hd-ts.m3u8&#x27; for reading&#xA;[hls @ 0x7fe23100f200] Skip (&#x27;#EXT-X-VERSION:4&#x27;)&#xA;[hls @ 0x7fe23100f200] Opening &#x27;h264-fhd-ts.m3u8&#x27; for reading&#xA;[hls @ 0x7fe23100f200] Skip (&#x27;#EXT-X-VERSION:4&#x27;)&#xA;[hls @ 0x7fe23100f200] Opening &#x27;h264-sd0000000000.ts&#x27; for reading&#xA;[hls @ 0x7fe23100f200] Opening &#x27;h264-hd0000000000.ts&#x27; for reading&#xA;[hls @ 0x7fe23100f200] Opening &#x27;h264-fhd0000000000.ts&#x27; for reading&#xA;Input #0, hls, from &#x27;manifest-h264.m3u8&#x27;:&#xA;  Duration: 00:02:47.00, start: 0.000000, bitrate: 0 kb/s&#xA;  Program 0&#xA;    Metadata:&#xA;      variant_bitrate : 511576&#xA;    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 686x480, 120 tbr, 90k tbn, 2000k tbc&#xA;    Metadata:&#xA;      variant_bitrate : 511576&#xA;    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp&#xA;    Metadata:&#xA;      variant_bitrate : 511576&#xA;  Program 1&#xA;    Metadata:&#xA;      variant_bitrate : 793711&#xA;    Stream #0:2: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1030x720, 120 tbr, 90k tbn, 2000k tbc&#xA;    Metadata:&#xA;      variant_bitrate : 793711&#xA;    Stream #0:3: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp&#xA;    Metadata:&#xA;      variant_bitrate : 793711&#xA;  Program 2&#xA;    Metadata:&#xA;      variant_bitrate : 1305288&#xA;    Stream #0:4: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1544x1080, 120 tbr, 90k tbn, 2000k tbc&#xA;    Metadata:&#xA;      variant_bitrate : 1305288&#xA;    Stream #0:5: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp&#xA;    Metadata:&#xA;      variant_bitrate : 1305288&#xA;

    &#xA;