I got error with receiving rtsp stream from IPCam Edimax IC-3030 and I don't know what to do. Can anyone help me or show me a way to solution ?
/home/prog12# ffplay "rtsp://192.168.1.7/ipcam_h264.sdp"
ffplay version 2.1.4 Copyright (c) 2003-2014 the FFmpeg developers
built on Mar 22 2014 18:16:53 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable- libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable- libxvid --enable-x11grab --enable-libvpx --enable-libmp3lame
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied
[rtsp # 0xb0c006c0] UDP timeout, retrying with TCPsq= 0B f=0/0
[rtsp # 0xb0c006c0] method PAUSE failed: 501 Not Implemented
[rtsp # 0xb0c006c0] Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, rtsp, from 'rtsp://192.168.1.7/ipcam_h264.sdp':
Metadata:
title : IPCam
Duration: N/A, bitrate: 64 kb/s
Stream #0:0: Video: h264, 90k tbr, 90k tbn, 180k tbc
Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
SDL_OpenAudio (1 channels):
No more channel combinations to try, audio open failed
[rtsp # 0xb0c006c0] UDP timeout, retrying with TCPsq= 0B f=0/0
[rtsp # 0xb0c006c0] method PAUSE failed: 501 Not Implemented
[rtsp # 0xb0c006c0] UDP timeout, retrying with TCPsq= 0B f=0/0
[rtsp # 0xb0c006c0] method PAUSE failed: 501 Not Implementedf=0/0
[rtsp # 0xb0c006c0] UDP timeout, retrying with TCPsq= 0B f=0/0
[rtsp # 0xb0c006c0] method PAUSE failed: 501 Not Implemented
nan M-V: nan fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
nan M-V: nan fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
nan M-V: nan fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
nan M-V: nan fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
nan M-V: nan fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
Thats the output.
EDIT
ps ax| grep -i pulse
8904 ? S<l 0:01 /usr/bin/pulseaudio --start --log-target=syslog
10369 pts/1 S+ 0:00 grep --color=auto -i pulse
And for new command :
sudo ffplay -video_size 640x480 "rtsp://192.168.1.7/ipcam_h264.sdp"
ffplay version 2.1.4 Copyright (c) 2003-2014 the FFmpeg developers
built on Mar 22 2014 18:16:53 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvpx --enable-libmp3lame
Option video_size not found.aq= 0KB vq= 0KB sq= 0B f=0/0
When you meet such error You should try to force ffmpeg to use only TCP connection - I believe that when switching from UDP to TCP ffmpeg tried to pause stream what may not be supported by IPCam like Edimax IC 3030 .
Here is pice of code:
AVDictionary *opts = 0;
av_dict_set(&opts, "rtsp_transport", "tcp", 0);
avformat_open_input( &FormatContext, path.c_str(), NULL, &opts )
Related
I am using following command to create a hls aac audio file for web streaming
ffmpeg -y -i song.mp3 -c:a aac -b:a 128k -f hls -hls_time 7 -hls_list_size 0 -hls_segment_filename file%d.m4a playlist.m3u8
This command works only with some audio files. With many mp3 files I receive following output:
C:\ffmpeg>ffmpeg -y -i song.mp3 -c:a aac -b:a 128k -f hls -hls_time 7 -hls_list_size 0 -hls_segment_filename file%d.m4a playlist.m3u8
ffmpeg version git-2020-01-31-62d92a8 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.2.1 (GCC) 20200122
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 38.100 / 56. 38.100
libavcodec 58. 67.100 / 58. 67.100
libavformat 58. 37.100 / 58. 37.100
libavdevice 58. 9.103 / 58. 9.103
libavfilter 7. 72.100 / 7. 72.100
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
[mp3 # 0000027d800babc0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'song.mp3':
Metadata:
TSS : Logic Pro 8.0.2
iTunNORM : 000000EE 000000ED 00000C34 00001135 000088F0 0000B505 000080FA 00007577 00009B82 00018F49
iTunSMPB : 00000000 00000210 00000A07 00000000008783E9 00000000 007AD4E6 00000000 00000000 00000000 00000000 00000000 00000000
genre : Rock
TCM : Kevin MacLeod
album : Funk and Blues
TKE : C
TBP : 101
title : Funkorama
artist : Kevin MacLeod
date : 2008-06-16 18:35
Duration: 00:03:21.46, start: 0.000000, bitrate: 325 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 320 kb/s
Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 400x400 [SAR 72:72 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
Metadata:
comment : Other
Stream mapping:
Stream #0:1 -> #0:0 (mjpeg (native) -> h264 (libx264))
Stream #0:0 -> #0:1 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
[hls # 0000027d80100c40] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or -vsync 2
[libx264 # 0000027d800c1280] using SAR=1/1
[libx264 # 0000027d800c1280] MB rate (56250000) > level limit (16711680)
[libx264 # 0000027d800c1280] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 0000027d800c1280] profile High 4:4:4 Predictive, level 6.2, 4:4:4, 8-bit
[libx264 # 0000027d800c1280] 264 - core 159 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, hls, to 'playlist.m3u8':
Metadata:
TSS : Logic Pro 8.0.2
iTunNORM : 000000EE 000000ED 00000C34 00001135 000088F0 0000B505 000080FA 00007577 00009B82 00018F49
iTunSMPB : 00000000 00000210 00000A07 00000000008783E9 00000000 007AD4E6 00000000 00000000 00000000 00000000 00000000 00000000
genre : Rock
TCM : Kevin MacLeod
album : Funk and Blues
TKE : C
TBP : 101
title : Funkorama
artist : Kevin MacLeod
date : 2008-06-16 18:35
encoder : Lavf58.37.100
Stream #0:0: Video: h264 (libx264), yuvj444p(pc, progressive), 400x400 [SAR 72:72 DAR 1:1], q=-1--1, 90k fps, 90k tbn, 90k tbc (attached pic)
Metadata:
comment : Other
encoder : Lavc58.67.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc58.67.100 aac
[mp3float # 0000027d80146580] overread, skip -7 enddists: -6 -6 speed=68.6x
[mp3float # 0000027d80146580] overread, skip -6 enddists: -5 -5
[mp3float # 0000027d80146580] overread, skip -6 enddists: -4 -4
Last message repeated 2 times
[mp3float # 0000027d80146580] overread, skip -7 enddists: -6 -6
Last message repeated 2 times
[mp3float # 0000027d80146580] overread, skip -5 enddists: -2 -2
[mp3float # 0000027d80146580] overread, skip -7 enddists: -6 -6
[mp3float # 0000027d80146580] overread, skip -6 enddists: -4 -4
Last message repeated 1 times
[mp3float # 0000027d80146580] overread, skip -7 enddists: -6 -6
Last message repeated 1 times
[mp3float # 0000027d80146580] overread, skip -6 enddists: -4 -4
[mp3float # 0000027d80146580] overread, skip -5 enddists: -3 -3
[mp3float # 0000027d80146580] overread, skip -6 enddists: -4 -4
[mp3float # 0000027d80146580] overread, skip -7 enddists: -6 -6
Last message repeated 2 times
[mp3float # 0000027d80146580] overread, skip -5 enddists: -4 -4
[hls # 0000027d80100c40] Opening 'file0.m4a' for writingate=N/A speed=64.1x
[hls # 0000027d80100c40] Opening 'playlist.m3u8.tmp' for writing
frame= 1 fps=0.3 q=33.0 Lsize=N/A time=00:03:21.45 bitrate=N/A speed=63.7x
video:7kB audio:3209kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 # 0000027d800c1280] frame I:1 Avg QP:34.64 size: 6567
[libx264 # 0000027d800c1280] mb I I16..4: 19.5% 53.0% 27.5%
[libx264 # 0000027d800c1280] 8x8 transform intra:53.0%
[libx264 # 0000027d800c1280] coded y,u,v intra: 46.8% 26.1% 15.3%
[libx264 # 0000027d800c1280] i16 v,h,dc,p: 38% 39% 9% 14%
[libx264 # 0000027d800c1280] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 14% 26% 8% 5% 6% 5% 7% 7%
[libx264 # 0000027d800c1280] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 42% 16% 14% 7% 4% 5% 3% 4% 4%
[libx264 # 0000027d800c1280] kb/s:4728240.00
[aac # 0000027d800bcc40] Qavg: 2138.508
Notice the "mp3float overread" message.
It results in a single file0.m4a file without splitting it up after every 7 seconds as specified.
This is an example audio file I am trying to convert to a aac hls stream that results the mentioned problem: https://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100474
How can I convert an audio file to a web friendly hls stream with ffmpeg?
You are using the option -hls_list_size 0 which makes 1 container file.
I use -muxdelay 0 -f segment -sc_threshold 0 -segment_time 15 -segment_list "playlist.m3u8" -segment_format mpegts "file%d.ts" in all my HLS video encode commands.
To put this in a working command for you that would be:
ffmpeg -y -i "song.mp3" -c:a aac -b:a 128k -muxdelay 0 -f segment -sc_threshold 0 -segment_time 7 -segment_list "playlist.m3u8" -segment_format mpegts "file%d.m4a"
I need to make this chain, using computer 2 as a "bridge" between Computer 1 and the streming server.
Computer 1 ----> Computer 2 ----> Streaming server (Wowza).
So I'm trying to set this:
Computer 1 --(via UDP)--> Computer 2 --(Via RTMP)--> Wowza
What I've tried:
1. At Computer 1
Entry:
ffmpeg -i sample.mp4 -c:v copy -c:a copy -f mpegts udp://192.168.0.109:5010
Result: Worked. Computer 1 sends the data correctly.
2. At Computer 2
Entry:
ffmpeg -i upd://192.168.0.109:5010 output.mp4
Result: Worked. Computer 2 gets data correctly. Output.mp4 is generated well.
Entry:
ffmpeg -i sample.mp4 -c:v copy -c:a copy -f flv rtmp://wowzaServerAddress
Result: Worked. Wowza shows online the video from sample.mp4
Entry:
ffmpeg -re -i udp://#:5010 -f flv rtmp://wowzaServerAddress
Result:
stuck at:
ffmpeg version N-77234-g906c0b7 Copyright (c) 2000-2015 the FFmpeg
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 10.100 / 55. 10.100
libavcodec 57. 17.100 / 57. 17.100
libavformat 57. 20.100 / 57. 20.100
libavdevice 57.0.100 / 57. 0.100
libavfilter 6.21.100 / 6. 21.100
libswscale 4.0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
**Entry:**
ffmpeg -i udp://192.168.0.109:5010 -c:v copy -c:a copy -f flv rtmp://wowzaServerAddress
**Result:**
*... repeated a lot ...*
Last message repeated 1 times
[h264 # 000001cef0462200] decode_slice_header error
[h264 # 000001cef0462200] no frame!
*... repeated a lot ...*
Input #0, mpegts, from 'udp://192.168.0.109:5010':
Duration: N/A, start: 128.032333, bitrate: N/A
Program 1
Metadata:
service_name: RARBG.COM - Spotlight.2015.1080p.WEB-DL.DD5.1.H264-RARBG
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(tv, bt709), 1916x1032 [SAR 1:1 DAR 479:258], 23.98 fps, 23.98 tbr, 90k tbn, 180k tbc
Stream #0:1[0x101](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 200 kb/s
[flv # 000001cef132a1c0] Codec for stream 0 does not use global headers but container format requires global headers
[flv # 000001cef132a1c0] Codec for stream 1 does not use global headers but container format requires global headers
Output #0, flv, to '**rtmp://wowzaServerAddress**':
Metadata:
encoder: Lavf57.20.100
Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 1916x1032 [SAR
1:1 DAR 479:258], q=2-31, 23.98 fps, 23.98 tbr, 1k tbn, 90k tbc
Stream #0:1(eng): Audio: aac ([10][0][0][0] / 0x000A), 48000 Hz, stereo,
200 kb/s
Stream mapping:
Stream #0:0 - #0:0 (copy)
Stream #0:1 - #0:1 (copy)
Press [q] to stop, [?] for help
[flv # 000001cef132a1c0] Malformed AAC bitstream detected: use the audio
bitstream filter 'aac_adtstoasc' to fix it ('-bsf:a aac_adtstoasc' option with ffmpeg)
av_interleaved_write_frame(): Invalid data found when processing input
[flv # 000001cef132a1c0] Malformed AAC bitstream detected: use the audio bitstream filter 'aac_adtstoasc' to fix it ('-bsf:a aac_adtstoasc' option with ffmpeg)
[flv # 000001cef132a1c0] Failed to update header with correct duration.
[flv # 000001cef132a1c0] Failed to update header with correct filesize.
Error writing trailer of rtmp://**wowzaServerAddress**: Invalid data found when processing inputframe= 1 fps=0.0 q=-1.0 Lsize= 0kB time= 00:00:02.13 bitrate= 1.6kbits/s
video:33kB audio:59kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
I'd like to make video streaming to distribute it in a streaming.
The mp3 file is being extracted from a video file (which is being recorded live) and, while audio being extracted (MP3), I want to take this audio file and a image it and spread it in a real time streaming. But -re is not working for this.
To extract audio file i use:
ffmpeg.exe -re -i file(LIVE).AVI -vn -ar 22050 -ab 16k -r 1 -ac 1 -f mp3 C:\Users\" & wshNetwork.Username & "\Documents\audio.mp3"
This work very well to make the MP3 file. Using -re.
After that, I'm using this command to marge the auvio file with the jpg image:
ffmpeg.exe -loop 1 -f image2 -i c:\picture.jpg -re -i c:\Users\" & wshNetwork.Username & "\Documents\audio.mp3 -vb 10k -ar 22050 -ab 16k -ac 1 -r 1 -bufsize 300k -f webm www.adress.com
This second command is not working because the -re is not working, and produce a video with the picture and a choppy audio.
the output is:
ffmpeg version N-63113-g72dcd48 Copyright (c) 2000-2014 the FFmpeg developers
built on May 12 2014 22:10:08 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
ack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable
-decklink --enable-zlib
libavutil 52. 83.100 / 52. 83.100
libavcodec 55. 61.100 / 55. 61.100
libavformat 55. 37.102 / 55. 37.102
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 5.100 / 4. 5.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, image2, from 'c:\imagens\radiobb.jpg':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p(pc), 553x342 [SAR 96:96 DAR 553:342], 25
fps, 25 tbr, 25 tbn, 25 tbc
[mp3 # 0000000002b8f660] Estimating duration from bitrate, this may be inaccurat
e
Input #1, mp3, from 'C:\Users\f3548956\Documents\audio.mp3':
Metadata:
encoder : Lavf55.37.102
Duration: 00:00:09.34, start: 0.050113, bitrate: 16 kb/s
Stream #1:0: Audio: mp3, 22050 Hz, mono, s16p, 16 kb/s
[swscaler # 0000000002ae1640] deprecated pixel format used, make sure you did se
t range correctly
[libvpx # 0000000002a8da40] v1.3.0
Output #0, webm, to 'http://172.17.146.***:8080/publish/tvbb100?password=****'
:
Metadata:
encoder : Lavf55.37.102
Stream #0:0: Video: vp8 (libvpx), yuv420p, 553x342 [SAR 1:1 DAR 553:342], q=
-1--1, 10 kb/s, 1k tbn, 25 tbc
Stream #0:1: Audio: vorbis (libvorbis), 22050 Hz, mono, fltp, 16 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> libvpx)
Stream #1:0 -> #0:1 (mp3 -> libvorbis)
Press [q] to stop, [?] for help
frame= 33 fps=0.0 q=0.0 size= 4kB time=00:00:01.32 bitrate= 23.3kbits/s
frame= 67 fps= 66 q=0.0 size= 4kB time=00:00:02.68 bitrate= 11.5kbits/s
frame= 101 fps= 66 q=0.0 size= 11kB time=00:00:04.04 bitrate= 22.4kbits/s
frame= 133 fps= 66 q=0.0 size= 11kB time=00:00:05.32 bitrate= 17.0kbits/s
Can anybody help me?
I am trying to merge a png image with 11 seconds of audio and create an mp4 file. When I execute ffmpeg I end up with a total duration of 10 seconds for the mp4 file. The command I'm using is...
ffmpeg -r 6 -loop 1 -i "image1.png" -i "audio1.wav" out.mp4
UPDATE: Here is the log that is produced...
FFmpeg version SVN-r15986, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --extra-cflags=-fno-common --enable-memalign-hack --enable-pthr
eads --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-libtheora
--enable-libspeex --enable-libfaac --enable-libgsm --enable-libx264 --enable-lib
schroedinger --enable-avisynth --enable-swscale --enable-gpl
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 6. 0 / 52. 6. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libswscale 0. 6. 1 / 0. 6. 1
built on Dec 3 2008 01:59:37, gcc: 4.2.4
Input #0, image2, from 'image1.png':
Duration: 00:00:00.16, start: 0.000000, bitrate: N/A
Stream #0.0: Video: png, rgb32, 400x300, 6.00 tb(r)
Input #1, wav, from 'audio1.wav':
Duration: 00:00:11.07, bitrate: 88 kb/s
Stream #1.0: Audio: pcm_u8, 11025 Hz, mono, s16, 88 kb/s
File 'out.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'out.mp4':
Stream #0.0: Video: mpeg4, yuv420p, 400x300, q=2-31, 200 kb/s, 6.00 tb(c)
Stream #0.1: Audio: libfaac, 11025 Hz, mono, s16, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #1.0 -> #0.1
Press [q] to stop encoding
frame= 1 fps= 0 q=4.1 Lsize= 42kB time=0.17 bitrate=2063.7kbits/s
video:14kB audio:26kB global headers:0.kB muxing overhead 4.894235%
I have also tried using
ffmpeg -loop 1 -i "image1.png" -i "audio1.wav" -t 11 out.mp4
This command does create an mp4 of 11 seconds but the audio is still cut off at 10 seconds.
Why is the audio being cutoff at 10 seconds?
Thanks,
Gary
One possible thing is that your audio file is just 10 seconds long.
Are you sure you are losing a whole second of the audio? Maybe it is just a few miliseconds which could cause some rounding issues? You can check this by running
ffprobe "audio1.wav"
and then
ffprobe "out.mp4"
Adding some options of codec/bitrate (e.g. -c:a copy -b:a copy) might help
I ran this command
ffmpeg -i v-16418145218d8d7abdaabec46beb22ecffd2f5d1625.flv -y -acodec aac -ac 2 -ab 160k -vcodec libx264 -vpre iPod640 -vpre slow -f mp4 -threads 0 OUTPUT.mp4
Got this response:
[flv # 0x10ff670]Estimating duration from bitrate, this may be inaccurate
Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, flv, from 'v-16418145218d8d7abdaabec46beb22ecffd2f5d1625.flv':
Metadata:
duration : 14
width : 320
height : 240
videodatarate : 500
framerate : 25
videocodecid : 2
audiodatarate : 0
audiosamplerate : 22050
audiosamplesize : 16
stereo : true
audiocodecid : 2
filesize : 912970
Duration: 00:00:13.92, start: 0.000000, bitrate: 576 kb/s
Stream #0.0: Video: flv, yuv420p, 320x240, 512 kb/s, 25 tbr, 1k tbn, 1k tbc
Stream #0.1: Audio: mp3, 22050 Hz, 2 channels, s16, 64 kb/s
File for preset 'iPod640' not found
But after doing a find, this is what I found.
/usr/share/ffmpeg/libx264-ipod320.ffpreset
/usr/share/ffmpeg/libx264-ipod640.ffpreset **** ITS HERE ******
/usr/share/ffmpeg/libx264-lossless_fast.ffpreset
/usr/share/ffmpeg/libx264-lossless_max.ffpreset
/usr/share/ffmpeg/libx264-lossless_medium.ffpreset
/usr/share/ffmpeg/libx264-lossless_slow.ffpreset
/usr/share/ffmpeg/libx264-lossless_slower.ffpreset
/usr/share/ffmpeg/libx264-lossless_ultrafast.ffpreset
/usr/share/ffmpeg/libx264-main.ffpreset
/usr/share/ffmpeg/libx264-max.ffpreset
/usr/share/ffmpeg/libx264-medium.ffpreset
/usr/share/ffmpeg/libx264-medium_firstpass.ffpreset
/usr/share/ffmpeg/libx264-normal.ffpreset
/usr/share/ffmpeg/libx264-placebo.ffpreset
/usr/share/ffmpeg/libx264-placebo_firstpass.ffpreset
/usr/share/ffmpeg/libx264-slow.ffpreset
/usr/share/ffmpeg/libx264-slow_firstpass.ffpreset
/usr/share/ffmpeg/libx264-slower.ffpreset
I alos tried with -vpre libx264-ipod640 and still no luck. I get preset libx264-ipod640 is not found.... Do i have to enable presets somehow? ffmpeg -- enable presets ? or something?
** EDIT: My ffmpeg version info **
FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
FFmpeg 0.6.5
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
Found the solution while experimenting. I had the wrong order of presets. It has to be the -vcodec then -vpre (speed) -vpre (presetprofile [aka ipod640])