Advanced search

Medias (1)

Tag: - Tags -/getid3

On other websites (126)

  • VideoJS for HLS streaming not working on iOS

    13 February, by Aames

    I have a website where I stream audio using HLS (m3u8 playlist + ts files).
I use VideoJS 8.3.0 to handle the stream in the frontend side.
The streaming works in all devices (PC, Android, Mac) except in iOS where it works intermittently and often it blocks.

    


    Here is my videojs initialization:

    


    player = videojs('stream-id', {
            controls: false, autoplay: true, preload: 'auto',
            html5: {
               vhs: {overrideNative: false},
               nativeAudioTracks: true
           }
        });

...

player.src({ type: 'application/x-mpegURL', src: 'https://.../master.m3u8' });



    


    And these are the headers of the m3u8 file:

    


    #EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-PROGRAM-DATE-TIME:2024-02-13T09:00:00Z
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-DISCONTINUITY
#EXTINF:10.007800,
master0.ts
#EXTINF:7.214989,
master1.ts
....


    


    I use ffmpeg to create the playlist from mp3 files:

    


    ffmpeg -i inputFileName -c:a aac -b:a 128k -ac 2 -f hls -hls_time 10 -preset ultrafast -map 0:a -flags -global_header -hls_list_size 0 -hls_flags append_list outputFileName



    


    Am I doing something wrong? Any help would be appreciated
Thanks

    


    I tried this solution: Videojs HLS m3u8 files are not playing in iOS devices and safari browser but it does not work for me

    


  • FFMPEG is not working in app service post deployment

    1 March, by Tushar Gupta

    I using the Xabe.FFmpeg package to generate clips from a video. The code is basically converting a video to multiple clips and it's working fine in my local but whenever I am uploading the code to app service the code is not working.

    


    Stack: .net
App Service OS : Windows

    


    Error:

    


    2024-02-13 08:57:34.092 +00:00 [Error] Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer: Connection ID "16573246629528734243", Request ID "40000a24-0000-e600-b63f-84710c7967bb": An unhandled exception was thrown by the application.System.ComponentModel.Win32Exception (193): An error occurred trying to start process 'C:\home\site\wwwroot\Controllers\ffmpeg\bin\ffmpeg.exe' with working directory 'C:\home\site\wwwroot'. The specified executable is not a valid application for this OS platform.at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)at System.Diagnostics.Process.Start()at Xabe.FFmpeg.FFmpeg.RunProcess(String args, String processPath, Nullable1 priority, Boolean standardInput, Boolean standardOutput, Boolean standardError)at Xabe.FFmpeg.FFmpegWrapper.&lt;>c__DisplayClass14_0.<runprocess>b__0()at System.Threading.Tasks.Task</runprocess>1.InnerInvoke()at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj)at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)--- End of stack trace from previous location ---at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)--- End of stack trace from previous location ---at Xabe.FFmpeg.Conversion.Start(String parameters, CancellationToken cancellationToken)at ExtractResponseAPI.Controllers.HomeController.PrepareVideoClips(CloudBlockBlob sourceVideoBlob, TimeSpan startTime, TimeSpan endTime) in C:\Users\tushar.h.gupta\source\repos\ExtractResponseAPI\Controllers\HomeController.cs:line 164at ExtractResponseAPI.Controllers.HomeController.GetIntervalsAsync(String query) in C:\Users\tushar.h.gupta\source\repos\ExtractResponseAPI\Controllers\HomeController.cs:line 60at ExtractResponseAPI.Controllers.HomeController.Get(String query) in C:\Users\tushar.h.gupta\source\repos\ExtractResponseAPI\Controllers\HomeController.cs:line 24at lambda_method4(Closure, Object)at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<invokenextactionfilterasync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State&amp; next, Scope&amp; scope, Object&amp; state, Boolean&amp; isCompleted)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<invokeinnerfilterasync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<invokefilterpipelineasync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<invokeasync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<invokeasync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT</invokeasync></invokeasync></invokefilterpipelineasync></invokeinnerfilterasync></invokenextactionfilterasync>1.ProcessRequestAsync()

    &#xA;

    Code:

    &#xA;

    private async Task> PrepareVideoClips(CloudBlockBlob sourceVideoBlob, TimeSpan startTime, TimeSpan endTime)&#xA;{&#xA;    string tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());&#xA;&#xA;    // Create a temporary directory to store clips locally&#xA;    Directory.CreateDirectory(tempDirectory);&#xA;&#xA;    // Download the source video&#xA;    string sourceVideoPath = Path.Combine(tempDirectory, "sourceVideo.mp4");&#xA;    await sourceVideoBlob.DownloadToFileAsync(sourceVideoPath, FileMode.Create);&#xA;    FFmpeg.SetExecutablesPath("Controllers\\ffmpeg\\bin\\");&#xA;    // Use FFmpegCore to trim the video&#xA;    string outputVideoPath = Path.Combine(tempDirectory, "output.mp4");&#xA;&#xA;    await FFmpeg.Conversions.New()&#xA;        .AddParameter($"-ss {startTime.TotalSeconds}") // Start time&#xA;        .AddParameter($"-i {sourceVideoPath}")&#xA;        .AddParameter($"-to {(endTime - startTime).TotalSeconds}") // Duration&#xA;        .SetOutput(outputVideoPath)&#xA;        .Start();&#xA;&#xA;    // Return a list of file paths for the clips&#xA;    return new List<string> { outputVideoPath };&#xA;}&#xA;</string>

    &#xA;

    I tried deploying the app service using different OS but still facing the same issue, I also tried using different packages but the result is same.

    &#xA;

  • Correct usage of fdkaac for liquidsoap->icecast

    1 February, by user4893295

    Can't seem to get aac working using fdkaac with liquidsoap. It just seems to shutdown.

    &#xA;

    TBF I have no idea which aot or transmux to use for "normal" icecast stuff. mp3 works fine, and the icecast server works fine with aac from other sources (BUTT etc).

    &#xA;

    This is my starting point from the liquidsoap cookbook:

    &#xA;

    %fdkaac(channels=2, samplerate=44100, bandwidth="auto", bitrate=64, afterburner=false, aot="mpeg2_he_aac_v2", transmux="adts", sbr_mode=false)&#xA;

    &#xA;

    And this is my output from liquidsoap:

    &#xA;

    2024/02/01 20:49:05 [clock:3] Using native (high-precision) implementation for latency control&#xA;2024/02/01 20:49:07 [main:3] Standard library loaded in 1.64 seconds.&#xA;2024/02/01 20:49:07 [lang:2] WARNING: "set" is deprecated and will be removed in future version. Please use `settings.path.to.key := value`&#xA;2024/02/01 20:49:07 [lang:2] WARNING: "set" is deprecated and will be removed in future version. Please use `settings.path.to.key := value`&#xA;2024/02/01 20:49:07 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.&#xA;2024/02/01 20:49:07 [frame:3] Video frame size set to: 1280x720&#xA;2024/02/01 20:49:07 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.&#xA;2024/02/01 20:49:07 [frame:3] Targeting &#x27;frame.duration&#x27;: 0.04s = 1764 audio samples = 1764 ticks.&#xA;2024/02/01 20:49:07 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.&#xA;2024/02/01 20:49:07 [sandbox:3] Could not find binary bwrap, disabling sandboxing.&#xA;2024/02/01 20:49:07 [startup:3] DSSI plugins registration: 0.00s&#xA;2024/02/01 20:49:07 [startup:3] FFmpeg filters registration: 0.02s&#xA;2024/02/01 20:49:07 [startup:3] FFmpeg bitstream filters registration: 0.00s&#xA;2024/02/01 20:49:07 [startup:3] Lilv plugins registration: 0.00s&#xA;2024/02/01 20:49:07 [startup:3] Frei0r plugin registration: 0.00s&#xA;2024/02/01 20:49:07 [startup:3] LADSPA plugins registration: 0.00s&#xA;2024/02/01 20:49:07 [startup:3] Typechecking: 1.36s&#xA;2024/02/01 20:49:07 [startup:3] Evaluation: 0.01s&#xA;2024/02/01 20:49:07 [startup:3] Typechecking: 0.02s&#xA;2024/02/01 20:49:07 [startup:3] Evaluation: 0.00s&#xA;2024/02/01 20:49:07 [startup:3] Typechecking: 0.00s&#xA;2024/02/01 20:49:07 [startup:3] Evaluation: 0.00s&#xA;2024/02/01 20:49:07 [startup:3] Typechecking: 0.00s&#xA;2024/02/01 20:49:07 [startup:3] Evaluation: 0.08s&#xA;2024/02/01 20:49:07 [startup:3] Loaded /etc/liquidsoap/index.liq: 0.08s&#xA;2024/02/01 20:49:07 [64_aac:3] Content type is {audio=pcm(stereo)}.&#xA;2024/02/01 20:49:07 [cross:3] Content type is {audio=pcm(stereo)}.&#xA;2024/02/01 20:49:07 [on_track:3] Content type is {audio=pcm(stereo)}.&#xA;2024/02/01 20:49:07 [promos.2:3] Content type is {audio=pcm(stereo)}.&#xA;2024/02/01 20:49:07 [promos:3] Content type is {}.&#xA;2024/02/01 20:49:07 [current:3] Content type is {audio=pcm(stereo)}.&#xA;2024/02/01 20:49:07 [music.3:3] Content type is {audio=pcm(stereo)}.&#xA;2024/02/01 20:49:07 [music.2:3] Content type is {}.&#xA;2024/02/01 20:49:07 [music:3] Content type is {audio=pcm(stereo)}.&#xA;2024/02/01 20:49:07 [safe_blank:3] Content type is {audio=pcm(stereo)}.&#xA;2024/02/01 20:49:07 [clock.main:3] Streaming loop starts in auto-sync mode&#xA;2024/02/01 20:49:07 [clock.main:3] Delegating synchronization to CPU clock&#xA;2024/02/01 20:49:07 [video.converter:3] Using preferred video converter: ffmpeg.&#xA;2024/02/01 20:49:07 [audio.converter:3] Using samplerate converter: libsamplerate.&#xA;2024/02/01 20:49:07 [video.text:3] Using sdl implementation&#xA;2024/02/01 20:49:07 [mksafe:3] Switch to safe_blank.&#xA;2024/02/01 20:49:07 [clock.main:2] Source 64_aac failed while streaming: Lang.Runtime_error { kind: "encoder", msg: "Invalid configuration: aot", pos: [at /etc/liquidsoap/index.liq, line 52, char 2-144] }!&#xA;2024/02/01 20:49:07 [clock.main:2] Raised at Liquidsoap_lang__Runtime_error.raise in file "src/lang/runtime_error.ml", line 48, characters 14-21&#xA;2024/02/01 20:49:07 [clock.main:2] Called from Stdlib__List.iter in file "list.ml", line 110, characters 12-15&#xA;2024/02/01 20:49:07 [clock.main:2] Called from Fdkaac_encoder.create_encoder in file "src/core/encoder/encoders/fdkaac_encoder.ml", line 69, characters 2-22&#xA;2024/02/01 20:49:07 [clock.main:2] Called from Fdkaac_encoder.encoder in file "src/core/encoder/encoders/fdkaac_encoder.ml", line 73, characters 12-35&#xA;2024/02/01 20:49:07 [clock.main:2] Called from Encoder.get_factory.(fun) in file "src/core/encoder/encoder.ml", line 344, characters 8-32&#xA;2024/02/01 20:49:07 [clock.main:2] Called from Icecast2.output#icecast_start in file "src/core/outputs/icecast2.ml", line 555, characters 16-67&#xA;2024/02/01 20:49:07 [clock.main:2] Called from Icecast2.output#send in file "src/core/outputs/icecast2.ml", line 544, characters 12-30&#xA;2024/02/01 20:49:07 [clock.main:2] Called from Output.encoded#send_frame.output_chunks.f in file "src/core/outputs/output.ml", line 256, characters 10-24&#xA;2024/02/01 20:49:07 [clock.main:2] Called from Output.output#output in file "src/core/outputs/output.ml", line 192, characters 45-70&#xA;2024/02/01 20:49:07 [clock.main:2] Called from Clock.MkClock.clock#end_tick.(fun) in file "src/core/clock.ml", line 318, characters 16-24&#xA;Incorrect BOM value&#xA;Error reading lyrics, skipped&#xA;2024/02/01 20:49:07 [clock.main:2]&#xA;[mp3 @ 0x7fd5ad428000] Estimating duration from bitrate, this may be inaccurate&#xA;2024/02/01 20:49:07 [decoder.ffmpeg:3] Requested content-type for "/data/dropbox/promos/current/24-7 promo 1 remix.mp3": {audio=pcm(stereo)}&#xA;2024/02/01 20:49:07 [decoder.ffmpeg:3] FFmpeg recognizes "/data/dropbox/promos/current/24-7 promo 1 remix.mp3" as audio: {codec: mp3, 44100Hz, 2 channel(s)}&#xA;2024/02/01 20:49:07 [decoder.ffmpeg:3] Decoded content-type for "/data/dropbox/promos/current/24-7 promo 1 remix.mp3": {audio=pcm(stereo)}&#xA;2024/02/01 20:49:07 [decoder.ffmpeg:3] Requested content-type for "/data/music/Bruno Mars - Locked out of Heaven.mp3": {audio=pcm(stereo)}&#xA;2024/02/01 20:49:07 [decoder.ffmpeg:3] FFmpeg recognizes "/data/music/Bruno Mars - Locked out of Heaven.mp3" as audio: {codec: mp3, 44100Hz, 2 channel(s)}, video: {codec: mjpeg, 640x640, yuvj444p}, video_2: {codec: mjpeg, 640x640, yuvj444p}&#xA;2024/02/01 20:49:07 [decoder.ffmpeg:3] Decoded content-type for "/data/music/Bruno Mars - Locked out of Heaven.mp3": {audio=pcm(stereo)}&#xA;Incorrect BOM value&#xA;Error reading lyrics, skipped&#xA;[mp3 @ 0x7fd5ad428000] Estimating duration from bitrate, this may be inaccurate&#xA;2024/02/01 20:49:07 [clock.main:3] Streaming loop stopped.&#xA;2024/02/01 20:49:07 [threads:3] Main loop exited&#xA;2024/02/01 20:49:07 [main:3] Shutdown started!&#xA;2024/02/01 20:49:07 [threads:3] Waiting for main threads to terminate...&#xA;2024/02/01 20:49:07 [threads:3] Main threads terminated.&#xA;2024/02/01 20:49:07 [threads:3] Shutting down scheduler...&#xA;2024/02/01 20:49:07 [threads:3] Scheduler shut down.&#xA;2024/02/01 20:49:07 [main:3] Cleaning downloaded files...&#xA;2024/02/01 20:49:07 [main:3] Freeing memory...&#xA;2024/02/01 20:49:07 >>> LOG END&#xA;

    &#xA;

    EDIT it does seem to be using video, which wouldn't help? Looking at this bit:

    &#xA;

    2024/02/01 20:49:07 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.&#xA;2024/02/01 20:49:07 [frame:3] Video frame size set to: 1280x720&#xA;

    &#xA;

    But no idea why or how to stop that...

    &#xA;