[FFmpeg-user] Recording video with ffmpeg for downloading to Android tablet - corrupted video.

Nathan Sinclair nathan.sinclair at techmatics.co.nz
Tue Oct 15 02:13:19 EEST 2019

I was talking with Carl Zwanzig - thanks Carl for the advice about message
posting. Instead of having to go to the stackoverflow question I'm going to
post it here. I'm just posting this new question to not overlap on the
previous question and to provide all the information needed to answer the
question and hopefully to get more input from the mailing list.

Also some other information - Followed some advice about finding the
version number in ffmpeg. My ffmpeg version number is N-95202-g2a546fb7d5.
A look at the commit showed that they were being made currently - October
2019. However there was no snapshot on this page -
http://git.videolan.org/?p=ffmpeg.git&h=2a546fb7d5. I'm just saying this to
ensure that I have the latest version of ffmpeg. What follows is the
information that Carl suggested to give.

my FFMPEG command looks like this:

ffmpeg -i $1 -crf 18 -r 30 -vf "scale=720x406, setpts='1/(30*TB) * (N +
0.05 * sin(N*2*PI/25))', fps=fps=30" -profile:v baseline -pix_fmt yuv420p
-f mp4 -preset fast out.mp4

$1 just refers to the url i'm fetching. A bit about that - i'm needing
ffmpeg to record. This is not a streaming command. The current system uses
another program for doing the streaming. What i need from this command is
to be able to fetch the file that is being recorded. I'm setting up a video
stream by which I can download a video into the Android gallery, so that I
can play it back later. I have a problem with playing the video back from
gallery. The same problem arises when trying to view the url in a
videoview. Video information from ffmpeg displays this.

Input #0, mpjpeg, from '':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc,
bt470bg/unknown/unknown), 1280x720, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler @ 0x1cab5e0] deprecated pixel format used, make sure you did set
range correctly
[libx264 @ 0x1c6f030] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x1c6f030] profile Constrained Baseline, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x1c6f030] 264 - core 157 r2969 d4099dd - H.264/MPEG-4 AVC codec
- Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=0
ref=2 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=6 psy=1 psy_rd=1.00:0.00
mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11
fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25
scenecut=40 intra_refresh=0 rc_lookahead=30 rc=crf mbtree=1 crf=18.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out.mp4':
    encoder         : Lavf58.33.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p,
720x406, q=-1--1, 30 fps, 15360 tbn, 30 tbc
      encoder         : Lavc58.59.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Error opening file out.mp4: IsoMedia File is truncated28.56 bitrate=
734.1kbits/s speed=0.478x
[pid: 5138|app: 0|req: 1/1] () {32 vars in 406 bytes} [Mon
Oct  7 01:12:17 2019] GET /stop => generated 39 bytes in 152 msecs
(HTTP/1.1 200) 2 headers in 79 bytes (1 switches on core 0)
frame=  899 fps= 15 q=-1.0 Lsize=    2779kB time=00:00:29.93 bitrate=
760.6kbits/s speed=0.49x
video:2775kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.157041%



More information about the ffmpeg-user mailing list