Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (97)

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (7440)

  • Unable to find replacement for -vol [closed]

    21 février 2024, par Michael Benton

    I'm referring to this thread posted years ago.

    


    While I was testing Downmixing without discarding the LFE channel (Dave_750's answer) on ffmpeg, which included the formula

    


    ffmpeg -i "sourcetrack.dts" -c dca -vol 425 -af "pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3" "outputstereo.dts"


    


    the cmd raised the following error :

    


    Unrecognized option 'vol'. Error splitting the argument list: Option not found


    


    The formula I put in cmd wasn't the same as the one in the thread at the beginning, because I replaced in it the attributes of my ac3 track.

    


    ffmpeg -i "inputsurround.ac3" -vol 425 -af "pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3" -c:a ac3 -b:a 320k -ar 48000 "outputstereo.ac3"


    


    Through this thread, I discovered that the -vol function was deprecated years ago.

    


    I found another thread where the syntax used was

    


    -af volume=N


    


    (where N stands for a percentage or, if N is followed by "dB", a dB value).

    


    I'm not sure if -af volume behaves exactly like -vol while downmixing to stereo the ac3.

    


    I went back editing the formula :

    


    ffmpeg -i "inputsurround.ac3" -af "volume=425" -af "pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3" -c:a ac3 -b:a 320k -ar 48000 "outputstereo.ac3"


    


    It raised the following warning (which didn't stop the file generation) :

    


    Multiple -filter/-af/-vf options specified for stream 0, only the last option '-filter:a pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3' will be used


    


    As I already suspected, I couldn't use two "-af" in the same command. The generated file is useless, because ffmpeg only applied one of the two commands. I also tried with N defined in dB, with no success.

    


    I continued my search and, from another thread, I learned that I could use

    


    -filter_complex "[1] formula1;[0] formula2"


    


    to resolve my issue.

    


    My formula then became :

    


    ffmpeg -i "inputsurround.ac3" -filter_complex "[1]volume=425;[0]pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3" -c:a ac3 -b:a 320k -ar 48000 "outputstereo.ac3"


    


    And it still raised an error :

    


    Invalid file index 1 in filtergraph description [1]volume=425;[0]pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3.
Error initializing complex filters: Invalid argument


    


    To simplify the formula, I went back using -af with the properties of -filter_complex. And I got :

    


    ffmpeg -i "inputsurround.ac3" -af "[1]volume=425;[0]pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3" -c:a ac3 -b:a 320k -ar 48000 "outputstereo.ac3"


    


    Again, another error :

    


    Simple filtergraph '[1]volume=425;[0]pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3' was expected to have exactly 1 input and 1 output. However, it had 2 input(s) and 2 output(s). Please adjust, or use a complex filtergraph (-filter_complex) instead.
[aost#0:0/ac3 @ 000001d83b4c4200] Error initializing a simple filtergraph
Error opening output file outputstereo.ac3.
Error opening output files: Invalid argument


    


    whether I used a semicolon or comma as a separator.

    


    I'm completely lost at this point as I don't have deep knowledge of the topic.

    


      

    • has -vol been deprecated or I've searched badly/it's a syntax typo ?

      


    • 


    • if -vol has been deprecated, is there a way to rewrite the formula such that it outputs the result intended by the original user ?

      


    • 


    • if I replace c0, c1, c2, c3, c4, c5 to FL, FR, FC, LF, BL, BR in the formula, would I get a different channel layout ? (my file is : L, R, C, LFE, Ls, Rs)

      


    • 


    


    I'll try to clear every doubt. Any help is highly appreciated !

    


  • FileNotFoundError : [WinError 2] The system cannot find the file specified - FFMPEG

    5 avril 2024, par shiftyscales

    I am running a script using conda environment on Windows and getting this error (stack trace below), which is apparently caused by python executable not being able to find the ffmpeg.exe. There are numerous questions about this, but none of the solutions unfortunately worked for me, so I hope someone has fresh ideas.

    


    What I tried :

    


      

    • conda install -c conda-forge ffmpeg (after this I can run ffmpeg in command line, but still getting the error)
    • 


    • pip install ffmpeg-python
    • 


    • Added the folder where ffmpeg.exe is located in conda env to the Windows Path as well as to sys.path in python.
    • 


    • copied the same ffmpeg.exe a) to the location of python.exe in conda env, b) to the location of the script I am running, c) to the location of subprocess.py.
    • 


    • Downloaded ffmpeg windows binary and repeated the last two steps with that file.
    • 


    


    Is there anything else that I can try to make it work ?

    


    ---------------------------------------------------------------------------&#xA;FileNotFoundError                         Traceback (most recent call last)&#xA;Cell In[10], line 22&#xA;     19 truncate_second = 8.2         # Video end = start_second &#x2B; truncate_second&#xA;     21 # Extract Video CAVP Features &amp; New Video Path:&#xA;---> 22 cavp_feats, new_video_path = extract_cavp(video_path, start_second, truncate_second, tmp_path=tmp_path)&#xA;&#xA;File D:\Software\Anaconda\envs\diff_foley\Lib\site-packages\torch\nn\modules\module.py:1518, in Module._wrapped_call_impl(self, *args, **kwargs)&#xA;   1516     return self._compiled_call_impl(*args, **kwargs)  # type: ignore[misc]&#xA;   1517 else:&#xA;-> 1518     return self._call_impl(*args, **kwargs)&#xA;&#xA;File D:\Software\Anaconda\envs\diff_foley\Lib\site-packages\torch\nn\modules\module.py:1527, in Module._call_impl(self, *args, **kwargs)&#xA;   1522 # If we don&#x27;t have any hooks, we want to skip the rest of the logic in&#xA;   1523 # this function, and just call forward.&#xA;   1524 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks&#xA;   1525         or _global_backward_pre_hooks or _global_backward_hooks&#xA;   1526         or _global_forward_hooks or _global_forward_pre_hooks):&#xA;-> 1527     return forward_call(*args, **kwargs)&#xA;   1529 try:&#xA;   1530     result = None&#xA;&#xA;File D:\Software\Anaconda\envs\diff_foley\Lib\site-packages\torch\utils\_contextlib.py:115, in context_decorator.<locals>.decorate_context(*args, **kwargs)&#xA;    112 @functools.wraps(func)&#xA;    113 def decorate_context(*args, **kwargs):&#xA;    114     with ctx_factory():&#xA;--> 115         return func(*args, **kwargs)&#xA;&#xA;File D:\Work\DIff-Foley\Diff-Foley\inference\demo_util.py:131, in Extract_CAVP_Features.forward(self, video_path, start_second, truncate_second, tmp_path)&#xA;    129 print("truncate second: ", truncate_second)&#xA;    130 # Load the video, change fps:&#xA;--> 131 video_path_low_fps = reencode_video_with_diff_fps(video_path, self.tmp_path, self.fps, start_second, truncate_second)&#xA;    132 video_path_high_fps = reencode_video_with_diff_fps(video_path, self.tmp_path, 21.5, start_second, truncate_second)&#xA;    134 # read the video:&#xA;&#xA;File D:\Work\DIff-Foley\Diff-Foley\inference\demo_util.py:42, in reencode_video_with_diff_fps(video_path, tmp_path, extraction_fps, start_second, truncate_second)&#xA;     31 def reencode_video_with_diff_fps(video_path: str, tmp_path: str, extraction_fps: int, start_second, truncate_second) -> str:&#xA;     32     &#x27;&#x27;&#x27;Reencodes the video given the path and saves it to the tmp_path folder.&#xA;     33 &#xA;     34     Args:&#xA;   (...)&#xA;     40         str: The path where the tmp file is stored. To be used to load the video from&#xA;     41     &#x27;&#x27;&#x27;&#xA;---> 42     assert which_ffmpeg() != &#x27;&#x27;, &#x27;Is ffmpeg installed? Check if the conda environment is activated.&#x27;&#xA;     43     # assert video_path.endswith(&#x27;.mp4&#x27;), &#x27;The file does not end with .mp4. Comment this if expected&#x27;&#xA;     44     # create tmp dir if doesn&#x27;t exist&#xA;     45     os.makedirs(tmp_path, exist_ok=True)&#xA;&#xA;File D:\Work\DIff-Foley\Diff-Foley\inference\demo_util.py:26, in which_ffmpeg()&#xA;     20 def which_ffmpeg() -> str:&#xA;     21     &#x27;&#x27;&#x27;Determines the path to ffmpeg library&#xA;     22 &#xA;     23     Returns:&#xA;     24         str -- path to the library&#xA;     25     &#x27;&#x27;&#x27;&#xA;---> 26     result = subprocess.run([&#x27;which&#x27;, &#x27;ffmpeg&#x27;], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)&#xA;     27     ffmpeg_path = result.stdout.decode(&#x27;utf-8&#x27;).replace(&#x27;\n&#x27;, &#x27;&#x27;)&#xA;     28     return ffmpeg_path&#xA;&#xA;File D:\Software\Anaconda\envs\diff_foley\Lib\subprocess.py:548, in run(input, capture_output, timeout, check, *popenargs, **kwargs)&#xA;    545     kwargs[&#x27;stdout&#x27;] = PIPE&#xA;    546     kwargs[&#x27;stderr&#x27;] = PIPE&#xA;--> 548 with Popen(*popenargs, **kwargs) as process:&#xA;    549     try:&#xA;    550         stdout, stderr = process.communicate(input, timeout=timeout)&#xA;&#xA;File D:\Software\Anaconda\envs\diff_foley\Lib\subprocess.py:1026, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)&#xA;   1022         if self.text_mode:&#xA;   1023             self.stderr = io.TextIOWrapper(self.stderr,&#xA;   1024                     encoding=encoding, errors=errors)&#xA;-> 1026     self._execute_child(args, executable, preexec_fn, close_fds,&#xA;   1027                         pass_fds, cwd, env,&#xA;   1028                         startupinfo, creationflags, shell,&#xA;   1029                         p2cread, p2cwrite,&#xA;   1030                         c2pread, c2pwrite,&#xA;   1031                         errread, errwrite,&#xA;   1032                         restore_signals,&#xA;   1033                         gid, gids, uid, umask,&#xA;   1034                         start_new_session, process_group)&#xA;   1035 except:&#xA;   1036     # Cleanup if the child failed starting.&#xA;   1037     for f in filter(None, (self.stdin, self.stdout, self.stderr)):&#xA;&#xA;File D:\Software\Anaconda\envs\diff_foley\Lib\subprocess.py:1538, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session, unused_process_group)&#xA;   1536 # Start the process&#xA;   1537 try:&#xA;-> 1538     hp, ht, pid, tid = _winapi.CreateProcess(executable, args,&#xA;   1539                              # no special security&#xA;   1540                              None, None,&#xA;   1541                              int(not close_fds),&#xA;   1542                              creationflags,&#xA;   1543                              env,&#xA;   1544                              cwd,&#xA;   1545                              startupinfo)&#xA;   1546 finally:&#xA;   1547     # Child is launched. Close the parent&#x27;s copy of those pipe&#xA;   1548     # handles that only the child should have open.  You need&#xA;   (...)&#xA;   1551     # pipe will not close when the child process exits and the&#xA;   1552     # ReadFile will hang.&#xA;   1553     self._close_pipe_fds(p2cread, p2cwrite,&#xA;   1554                          c2pread, c2pwrite,&#xA;   1555                          errread, errwrite)&#xA;&#xA;FileNotFoundError: [WinError 2] The system cannot find the file specified&#xA;</locals>

    &#xA;

  • avio_open() function returns -138

    8 avril 2024, par checkright

    When I use ffmpeg4.4.1 to push rtmp to the desktop, the program returns -138 when running avio_open().I use dshow's screen-capture-recorder on the input side. My purpose is to capture the desktop in real time and use rtmp to push the stream.

    &#xA;

        avdevice_register_all();&#xA;    avformat_network_init();&#xA;&#xA;    AVFormatContext* pFmtCtx_In = nullptr;&#xA;    AVFormatContext* pFmtCtx_Out = nullptr;&#xA;    AVInputFormat*   pInFmt  = nullptr;&#xA;    AVDictionary* options = nullptr;&#xA;    int nVideoIndex          = -1;&#xA;    int              ret     = 0;&#xA;&#xA;    AVCodecParameters* pCodecParam = nullptr;&#xA;    AVCodecContext   * pCodecCtx   = nullptr;&#xA;    AVCodec          * pCodec      = nullptr;&#xA;&#xA;    AVFrame* pFrame    = av_frame_alloc();&#xA;    AVFrame* pFrameRGB = av_frame_alloc();&#xA;    AVPacket* pkt      = nullptr;&#xA;&#xA;    pFrame    = av_frame_alloc();&#xA;    pFrameRGB = av_frame_alloc();&#xA;    pkt       = nullptr;&#xA;    img_convert_ctx = nullptr;&#xA;&#xA;    pFmtCtx_In = avformat_alloc_context();&#xA;    if(!pFmtCtx_In)&#xA;    {&#xA;        qDebug() &lt;&lt; "create AVFormatContext failed." ;&#xA;        return;&#xA;    }&#xA;&#xA;    QString urlString = QString("video=screen-capture-recorder");&#xA;    const char* rtmpAddress = "rtmp://192.168.0.136:8554/myapp/test";&#xA;    &#xA;    if(1){&#xA;        pInFmt = const_cast(av_find_input_format("dshow"));&#xA;        ret = avformat_open_input(&amp;pFmtCtx_In, urlString.toStdString().c_str(), pInFmt, nullptr);&#xA;    }else{&#xA;        pInFmt = const_cast(av_find_input_format("gdigrab"));&#xA;        av_dict_set(&amp;options, "video_device_index", "1", 0);  &#xA;        av_dict_set(&amp;options, "offset_x", "1920", 0);&#xA;        av_dict_set(&amp;options, "offset_y", "0", 0);&#xA;        av_dict_set(&amp;options, "draw_mouse", "1", 0);&#xA;        av_dict_set(&amp;options, "video_size", "1920x1080", 0);&#xA;        ret = avformat_open_input(&amp;pFmtCtx_In, "desktop", pInFmt, &amp;options);&#xA;    }&#xA;&#xA;    if(!pInFmt)&#xA;    {&#xA;        qDebug() &lt;&lt; "find AVInputFormat failed." ;&#xA;        return;&#xA;    }&#xA;&#xA;    if(ret &lt; 0)&#xA;    {&#xA;        qDebug() &lt;&lt; "open camera failed."&lt;nb_streams; i&#x2B;&#x2B;){&#xA;        if(pFmtCtx_In->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO){&#xA;            nVideoIndex = i;&#xA;            continue;&#xA;        }&#xA;    }&#xA;&#xA;    if(nVideoIndex == -1){&#xA;        qDebug() &lt;&lt; "cannot find video stream." ;&#xA;        return;&#xA;    }&#xA;&#xA;&#xA;    pCodecParam = pFmtCtx_In->streams[nVideoIndex]->codecpar;&#xA;    pCodec = avcodec_find_decoder(pCodecParam->codec_id);&#xA;    if(!pCodec)&#xA;    {&#xA;        qDebug() &lt;&lt; "cannot find codec." ;&#xA;        return;&#xA;    }&#xA;&#xA;    ret = avformat_alloc_output_context2(&amp;pFmtCtx_Out, NULL, "flv", rtmpAddress);&#xA;    //    ret = avformat_alloc_output_context2(&amp;pFmtCtx_Out, NULL, "rtsp", rtmpAddress);&#xA;    if (ret &lt; 0) {&#xA;        qDebug() &lt;&lt; "cannot avformat_alloc_output_context2." ;&#xA;        return ;&#xA;    }&#xA;&#xA;    for (int i = 0; i &lt; pFmtCtx_In->nb_streams; i&#x2B;&#x2B;) {&#xA;        AVStream *outStream = avformat_new_stream(pFmtCtx_Out, pFmtCtx_In->streams[i]->codec->codec);&#xA;        if (!outStream) {&#xA;            qDebug() &lt;&lt; "cannot outStream." ;&#xA;&#xA;            return ;&#xA;        }&#xA;&#xA;        ret = avcodec_parameters_copy(outStream->codecpar, pFmtCtx_In->streams[i]->codecpar);&#xA;        if (ret &lt; 0) {&#xA;             qDebug() &lt;&lt; "cannot avcodec_parameters_copy." ;&#xA;            return ;&#xA;        }&#xA;        outStream->codec->codec_tag = 0;&#xA;    }&#xA;  &#xA;    av_dump_format(pFmtCtx_Out, 0, rtmpAddress, 1);&#xA;&#xA;    ret = avio_open(&amp;pFmtCtx_Out->pb, rtmpAddress, AVIO_FLAG_WRITE);&#xA;    if (ret &lt; 0) {&#xA;        qDebug() &lt;&lt; "cannot avio_open." &lt;code>

    &#xA;

    An error occurs here.According to the data, the problem occurs at the input end, and the input end can display the desktop normally. How can I make it run successfully ? How do I need to modify the above code ?

    &#xA;