I have ffmpeg ver 3.1.4 using on Windows 7 32 bit with vlc ver 2.2.4.
I use this command to simultaneously record and play an internet radio station and this works fine.
I can manually stop ffmpeg record/play by either closing vlc or closing ffmpeg and this leaves me with a completed audio file.Code:ffmpeg -i "https://ais-sa1.streamon.fm/7648_48k.aac" ^ -c copy output.aac ^ -f wav -acodec pcm_s16le -ac 2 - | "C:\Program Files\videolan\vlc\vlc.exe" -
However, I want to add something to limit the record/play to a certain time, for example 30 seconds, after which ffmpeg will stop recording/playing the radio station (stop using data) and leave me with a completed audio file. I tried adding this to the code:
in various ways but was unsuccessful. In actual practice, I would like to stop the record/play about 4 hours 30 minutes.Code:-t 00:00:30
Could someone give me the exact working code (using above example radio station) that will record/play for specific time and then stop recording/playing and stop using data.
Thank you.
+ Reply to Thread
Results 1 to 4 of 4
-
Last edited by jimdagys; 25th Mar 2025 at 22:09.
-
The duration needs to have seconds as a float, not an integer.
Code:-t 00:00:30.0
It looks like your batch file needs the time limit twice:
Code:ffmpeg -i "https://ais-sa1.streamon.fm/7648_48k.aac" ^ -t 00:00:10.0 ^ -c copy output.aac ^ -t 00:00:10.0 ^ -f wav -acodec pcm_s16le -ac 2 - | "G:\program files\videolan\vlc\vlc.exe" -
Last edited by jagabo; 25th Mar 2025 at 22:20.
-
Ok, this seems to work (ffmpeg records/plays for 30 seconds).
Code:ffmpeg -i "https://ais-sa1.streamon.fm/7648_48k.aac" ^ -t 00:00:30.0 ^ -c copy output.aac ^ -t 00:00:30.0 ^ -f wav -acodec pcm_s16le -ac 2 - | "C:\program files\videolan\vlc
I do have a question. In the command output, what does the "more' mean (shown four times with red mark)? Also, why do I have to press enter to continue at that point (shown with green mark)?Last edited by jimdagys; 26th Mar 2025 at 05:36.
-
The CLI just telling you it's ready for more input since the previous line ended with a ^. I ran it from a batch file so all the lines were simply concatenated before being executed:
Code:ffmpeg -i "https://ais-sa1.streamon.fm/7648_48k.aac" -t 00:00:10.0 -c copy output.aac -t 00:00:10.0 -f wav -acodec pcm_s16le -ac 2 - | "G:\program files\videolan\vlc\vlc.exe" -
Similar Threads
-
Using a hex editor, how do I add a duration of an MKV file?
By noahsaf in forum ProgrammingReplies: 1Last Post: 24th Aug 2023, 21:09 -
Use FFMPEG or other command to make duration of each frame the same
By zydjohn in forum Video ConversionReplies: 4Last Post: 3rd Dec 2021, 09:32 -
ffmpeg - output metadata, add/remove modification then add it to the video
By kalemvar1 in forum Video ConversionReplies: 3Last Post: 30th Jul 2021, 01:29 -
automatic preset duration time for capturing say 3 hours for vhs
By devdev in forum Capturing and VCRReplies: 4Last Post: 11th Jun 2021, 13:18 -
[Audacity/ffmpeg] Audio duration unsync
By butterw in forum AudioReplies: 4Last Post: 4th Feb 2021, 12:03