Advanced search
Medias (1)
-
GetID3 - Bloc informations de fichiers
9 April 2013, by
Updated: May 2013
Language: français
Type: Picture
On other websites (126)
-
VideoJS for HLS streaming not working on iOS
13 February, by AamesI 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 GuptaI 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, Nullable
1 priority, Boolean standardInput, Boolean standardOutput, Boolean standardError)at Xabe.FFmpeg.FFmpegWrapper.<>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& next, Scope& scope, Object& state, Boolean& 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()

Code:


private async Task> PrepareVideoClips(CloudBlockBlob sourceVideoBlob, TimeSpan startTime, TimeSpan endTime)
{
 string tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());

 // Create a temporary directory to store clips locally
 Directory.CreateDirectory(tempDirectory);

 // Download the source video
 string sourceVideoPath = Path.Combine(tempDirectory, "sourceVideo.mp4");
 await sourceVideoBlob.DownloadToFileAsync(sourceVideoPath, FileMode.Create);
 FFmpeg.SetExecutablesPath("Controllers\\ffmpeg\\bin\\");
 // Use FFmpegCore to trim the video
 string outputVideoPath = Path.Combine(tempDirectory, "output.mp4");

 await FFmpeg.Conversions.New()
 .AddParameter($"-ss {startTime.TotalSeconds}") // Start time
 .AddParameter($"-i {sourceVideoPath}")
 .AddParameter($"-to {(endTime - startTime).TotalSeconds}") // Duration
 .SetOutput(outputVideoPath)
 .Start();

 // Return a list of file paths for the clips
 return new List<string> { outputVideoPath };
}
</string>


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.


-
Correct usage of fdkaac for liquidsoap->icecast
1 February, by user4893295Can't seem to get aac working using
fdkaac
with liquidsoap. It just seems to shutdown.

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

This is my starting point from the liquidsoap cookbook:


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



And this is my output from liquidsoap:


2024/02/01 20:49:05 [clock:3] Using native (high-precision) implementation for latency control
2024/02/01 20:49:07 [main:3] Standard library loaded in 1.64 seconds.
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`
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`
2024/02/01 20:49:07 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.
2024/02/01 20:49:07 [frame:3] Video frame size set to: 1280x720
2024/02/01 20:49:07 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2024/02/01 20:49:07 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2024/02/01 20:49:07 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2024/02/01 20:49:07 [sandbox:3] Could not find binary bwrap, disabling sandboxing.
2024/02/01 20:49:07 [startup:3] DSSI plugins registration: 0.00s
2024/02/01 20:49:07 [startup:3] FFmpeg filters registration: 0.02s
2024/02/01 20:49:07 [startup:3] FFmpeg bitstream filters registration: 0.00s
2024/02/01 20:49:07 [startup:3] Lilv plugins registration: 0.00s
2024/02/01 20:49:07 [startup:3] Frei0r plugin registration: 0.00s
2024/02/01 20:49:07 [startup:3] LADSPA plugins registration: 0.00s
2024/02/01 20:49:07 [startup:3] Typechecking: 1.36s
2024/02/01 20:49:07 [startup:3] Evaluation: 0.01s
2024/02/01 20:49:07 [startup:3] Typechecking: 0.02s
2024/02/01 20:49:07 [startup:3] Evaluation: 0.00s
2024/02/01 20:49:07 [startup:3] Typechecking: 0.00s
2024/02/01 20:49:07 [startup:3] Evaluation: 0.00s
2024/02/01 20:49:07 [startup:3] Typechecking: 0.00s
2024/02/01 20:49:07 [startup:3] Evaluation: 0.08s
2024/02/01 20:49:07 [startup:3] Loaded /etc/liquidsoap/index.liq: 0.08s
2024/02/01 20:49:07 [64_aac:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [cross:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [on_track:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [promos.2:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [promos:3] Content type is {}.
2024/02/01 20:49:07 [current:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [music.3:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [music.2:3] Content type is {}.
2024/02/01 20:49:07 [music:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [safe_blank:3] Content type is {audio=pcm(stereo)}.
2024/02/01 20:49:07 [clock.main:3] Streaming loop starts in auto-sync mode
2024/02/01 20:49:07 [clock.main:3] Delegating synchronization to CPU clock
2024/02/01 20:49:07 [video.converter:3] Using preferred video converter: ffmpeg.
2024/02/01 20:49:07 [audio.converter:3] Using samplerate converter: libsamplerate.
2024/02/01 20:49:07 [video.text:3] Using sdl implementation
2024/02/01 20:49:07 [mksafe:3] Switch to safe_blank.
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] }!
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
2024/02/01 20:49:07 [clock.main:2] Called from Stdlib__List.iter in file "list.ml", line 110, characters 12-15
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
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
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
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
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
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
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
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
Incorrect BOM value
Error reading lyrics, skipped
2024/02/01 20:49:07 [clock.main:2]
[mp3 @ 0x7fd5ad428000] Estimating duration from bitrate, this may be inaccurate
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)}
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)}
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)}
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)}
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}
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)}
Incorrect BOM value
Error reading lyrics, skipped
[mp3 @ 0x7fd5ad428000] Estimating duration from bitrate, this may be inaccurate
2024/02/01 20:49:07 [clock.main:3] Streaming loop stopped.
2024/02/01 20:49:07 [threads:3] Main loop exited
2024/02/01 20:49:07 [main:3] Shutdown started!
2024/02/01 20:49:07 [threads:3] Waiting for main threads to terminate...
2024/02/01 20:49:07 [threads:3] Main threads terminated.
2024/02/01 20:49:07 [threads:3] Shutting down scheduler...
2024/02/01 20:49:07 [threads:3] Scheduler shut down.
2024/02/01 20:49:07 [main:3] Cleaning downloaded files...
2024/02/01 20:49:07 [main:3] Freeing memory...
2024/02/01 20:49:07 >>> LOG END



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


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



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