I'm building an FFMPEG stream in iOS that should convert any file type to wav and send it to an http stream
ffmpeg -i "/path/to/audio/track.suffix" -vn -strict -2 -acodec pcm_u8 -f wav -listen 1 -seekable 1 http://localhost:8090/restream.wav
I posted a question to the ffmpeg user list and someone said:
You are not sending valid wav files like this.
Can anyone help me to see what's wrong with this ffmpeg cmd?
Thanks!
I cant see why this command should send invalid wav files. I thik you can safely use this. But why dont you just try it out ?
Related
I'm trying to decode a .m3u8 to mp4 using ffmpeg, but keep getting this error message:
Error applying bitstream filters to an output packet for stream #0:0
https://....../audio.m3u8: Invalid data found when processing input.
This is the command I'm using:
ffmpeg -y -f hls -i https://www.video-cdn.com/video/encrypt/7b35e1550e7dac1fa9d6f34eb0b55148/R915dD-90d3ac3f-48d9-4da1-84d4-d354a7ed03de/90d3ac3f-48d9-4da1-84d4-d354a7ed03de/audio.m3u8 -bsf:v h264_mp4toannexb,dump_extra -bsf:a aac_adtstoasc -map 0 -c copy -flags +global_header -max_interleave_delta 0 -f mp4 test.mp4
cmdExample
Any ideas?
The HLS stream is encrypted. You can see this because of the following line in the m3u8 playlist file:
#EXT-X-KEY:METHOD=AES-128,URI="blob:https://www.video-cdn.com/90d3ac3f-48d9-4da1-84d4-d354a7ed03de",IV=0xa2dccda29716795b6a22bec559144723
Since the URI is with the Blob-Prefix, FFmpeg can not decrypt the stream, because this blob is only valid where you have received this URL (e.g. your browser).
To solve this, you need to manually download the m3u8 playlist file to your local drive, download also the AES-128 key manually, modify the playlist and pass this into FFmpeg. You can find a short tutorial here.
I would like to create a thumbnail for HLS stream.
I am doing it already with mp4 files
like this ffmpeg -y -ss 00:00:10.000 -i file.mp4 -vframes 1 -vf scale=256:144 out.jpg
And it works great.
But when I try it with HLS live stream, it just spams
Opening 'liveX.ts' for reading.
Even though 10th second is in 'live1.ts'
Any solution to this? And I would like if duration is not in stream, just report error.
I know this is an old question, but I was working with FFMPEG today to see how this could be done with a live stream. I discovered that it can be done pretty easily.
Here is what I use...
ffmpeg.exe -y -i http://username:password#[hls feed ip address]/[path.m3u8] -s 800x450 -vframes 1 -f image2 -updatefirst 1 MyThumbnail.jpg
This is similar to the way you get a thumbnail from an rtsp stream, but seems to work faster.
I hope this helps someone.
I am developing an application that listens for RTP data using GStreamer and converts the received raw data packets using FFMPEG.
I works well for codes: PCMA, PCMU, G722 and G729 and converts the received audio files into wav and mp3. But the conversion fails when G729b packet is received. FFMPEG has support for G729 as mentioned here but nothing is mentioned about G729a/b. GStreamer also has not mentioned anything about G729a/b though has a decoder for G729. I also didn't find any other library that can convert G729b to wav or mp3.
Can anyone please suggest any way or any library to convert G729a/b to wav.
Thanks in advance!
Command used:
ffmpeg -f g729 -i .g729 -acodec pcm_s16le -ar 8000 output.wav
Please find the two files here
Having an issue here using ffmpeg's add-on Rubberband. When I try to stretch a WAV audio file with a given ratio, the WAV file is generated fine but then, when I want to parse its header, I can see an invalid audio format.
'Unknwon format: 22127'
Have reported this issue on this GitHub tracker. All details are there:
https://github.com/rackfx/Node-WAV-File-Info/issues/11
But now I am very unsure and wonder if it's not a Rubberband bug? Or am I missing something in the ffmpeg command to ensure correct audio format is set?
That's the ffmpeg command I used to generate that stretched WAV file with the invalid audio format (using ffmpeg v3.0.2 here)
ffmpeg -thread_queue_size 2048 -i /home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebd-f5430180-84c7-074d5706928b/videomail_preview.wav -y -acodec libvorbis -ac 1 -filter:a rubberband=tempo=1.454366279637038 -loglevel warning /home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebd-f5430180-84c7-074d5706928b/videomail_preview_for_webm_stretched.wav
Any clues?
Remove -c:a libvorbis. ffmpeg will then automatically choose a common and compatible audio format for WAV.
I have setup Darwin Streaming Server which streams the included sample 3GP files pretty well. However when I try to encode my own 3GPs using FFMPEG and stream them, it doesn't work. (I test the streaming using VLC Player).
Here is the command I use for encoding:
ffmpeg -i test.flv -acodec aac -ar 22050 -ab 128kb -vcodec mpeg4 -b 256k -mbd 2 -flags +4mv+aic -trellis 1 -cmp 1 -y test.3gp
Do I need a special way to encode the 3gp's for streaming?
DSS has no idea about file content. So, you have to "hint" (or give an idea to the server how to stream your file) media file. You can use M4Box for hinting - http://gpac.sourceforge.net/doc_mp4box.php
On the following link you can find how to configure a DSS server
http://www.howtoforge.com/apples-darwin-streaming-server-on-centos-5.2
The second page describe how to convert files with FFMPEG and MP4 creator to hint the vodeo to be streamed. The link can be find at the bottom of the page before the comments.